flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Memory location |
Author |
|
zhak 15 Nov 2005, 15:38
The value of SI cannot be greater than 0FFFFh; You get an overflow. Try to set the DS value, for example, MOV AX, 1000h/MOV DS, AX
|
|||
15 Nov 2005, 15:38 |
|
dasyar 15 Nov 2005, 17:01
I think I may of understated my concern. When I use my boot loader to load the kern/prog to 0x10000 (0x0001:0x0000) location, why would I have to use ESI as opposed to SI. I guess maybe this is a compiler concern, when you choose different org locations, you end up with different results. It seems to me that when you choose ORG 0x0000 or ORG 0x10000, SI should work for both. Basically all you are doing is changing the segment location, meaning the values are still between 0x0000 - 0xffff.
|
|||
15 Nov 2005, 17:01 |
|
LocoDelAssembly 15 Nov 2005, 21:42
The address 10000h can be accessed at 0x1000:0x0000, not 0x0001:0x0000. Your source is in 16-bit flat memory model so there is impossible to use SI to store the address of the label. To fix this do that zhak says, load the kern/prog at 0x10000 BUT before jumping to it change DS to 0x1000 (or do it in the loaded code) and use ORG 0.
[edit]Of course there are others pairs of SEG:OFFSET that allows you to access the memory address 0x10000, for example the one that you suggested but with offset 0xFFF0 (0x0001:0xFFF0).[/edit] |
|||
15 Nov 2005, 21:42 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.