flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > 16 bit os... |
Author |
|
bubach 08 Dec 2006, 10:16
the [] thing can be tricky. for a normal variable the name give you the var address, and [] will give you it's contents. for a register bx will give you the content while [bx] give you the content from the address in bx. since registers don't have addresses it's a bit diffrent.
|
|||
08 Dec 2006, 10:16 |
|
rhyno_dagreat 08 Dec 2006, 12:47
Thanks
|
|||
08 Dec 2006, 12:47 |
|
rhyno_dagreat 09 Dec 2006, 19:14
I tried something in a hex editor I use (Icy Hexplorer - pretty nice one for free, might I add), I looked up the jmp command in GotoFile, and it jumps to some odd area in memory where there's an X at. So then I tried to comment out GotoFile all together, as well as the contents of ReadFileStart, and put inside of it "jmp FData", and instead of printing the string like it should it reprints the "Hello World!" message (msg) three times.
|
|||
09 Dec 2006, 19:14 |
|
rhyno_dagreat 09 Dec 2006, 22:50
Does anyone know what it could be doing wrong?
|
|||
09 Dec 2006, 22:50 |
|
cod3b453 10 Dec 2006, 20:55
If I'm reading your code right then
1) You load the next sectors to es:bx = 0x0000:0x0060 not 0x0000:0x0600 mov bx, 0060h => mov bx,0x0600 or mov ax,0x0060 mov es,ax mov bx,0x0000 ; xor bx,bx 2) It loops until the value of bx is 0xFD00, not the value pointed to by bx, it should also be byte not word: cmp bx,0xFD00 => cmp byte [bx],0xFD HTH |
|||
10 Dec 2006, 20:55 |
|
rhyno_dagreat 11 Dec 2006, 03:43
You... Are... AWESOME! THANK YOU!!!! This thing's had me stumped for the past weekend! I was doing the segment:offset thing wrong (backwards) when I was calculating the get the absolute address.
|
|||
11 Dec 2006, 03:43 |
|
cod3b453 11 Dec 2006, 13:27
hehe I've done it so many times myself it's almost second nature to correct now
|
|||
11 Dec 2006, 13:27 |
|
rhyno_dagreat 11 Dec 2006, 16:13
For me it's just something else I'm getting used to. Is the BX register set apart from the other general registers in the sense that it can act as a pointer?
|
|||
11 Dec 2006, 16:13 |
|
cod3b453 11 Dec 2006, 17:45
no. you can use any general register (ax bx cx dx si di bp sp (in 16bit)) as a pointer to a value at the address of the register
e.g. mov byte [ax],0xFF or more complex code up to 2 general purpose registers, 1 allowed to have a multiplier, and a constant value: e.g. mov byte [di+4*cx+2],dl This moves the byte value in dl to the address pointed to by di + (4 × cx) + 2. This is useful if di points to the destination of a block of data and your using cx as the loop counter for some algorithm, the constant allows you to adjust as necessary. |
|||
11 Dec 2006, 17:45 |
|
LocoDelAssembly 11 Dec 2006, 18:04
No you can't use any register in 16-bit mode http://www.sandpile.org/ia32/opc_rm16.htm
32-bit mode is more flexible http://www.sandpile.org/ia32/opc_rm32.htm , http://www.sandpile.org/ia32/opc_sib.htm . |
|||
11 Dec 2006, 18:04 |
|
rhyno_dagreat 15 Dec 2006, 03:44
Thank you all for clarifying that!
|
|||
15 Dec 2006, 03:44 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.