flat assembler
Message board for the users of flat assembler.
  
|  Index
      > DOS > initial segment registers in DOS vs bootcode | 
| Author | 
 | 
| vid 06 Feb 2006, 10:02 segment register in virtual-real mode (DOS under win32) cannot be 0, because then code would be placed 0:100h, eg. in place where interrupt vector table should be placed...
 bootup register values may differ by BIOSes i think | |||
|  06 Feb 2006, 10:02 | 
 | 
| shoorick 06 Feb 2006, 11:41 cs = ds = es = ss = df7 means that your program loaded into segment 0DF7. this segment vary from current os status and may vary on: amount of loaded resident programs and drivers, current os version etc.: to be simple: the first empty memory block is used to load com-file, and first instruction will start from cs:100h, in this case: 0DF7:0100. boot code may think it is started from 0000:7C00. i did not know about gs=f000, but it can be usefull on 386+ systems as ready bios segment: then reboot code should be at gs:fff0h | |||
|  06 Feb 2006, 11:41 | 
 | 
| lazer1 06 Feb 2006, 14:24 shoorick wrote: cs = ds = es = ss = df7 means that your program loaded into segment 0DF7. this segment vary from current os status and may vary on: amount of loaded resident programs and drivers, current os version etc.: to be simple: the first empty memory block is used to load com-file, and first instruction will start from cs:100h, in this case: 0DF7:0100. boot code may think it is started from 0000:7C00. i did not know about gs=f000, but it can be usefull on 386+ systems as ready bios segment: then reboot code should be at gs:fff0h ok, I think I understand,   "org 100h" just means the offset, I thought it meant flat address 100h but now I see it means flat address ????0100   whereas "org 7c00h" boot code really is at flat address 00007c00h | |||
|  06 Feb 2006, 14:24 | 
 | 
| vid 06 Feb 2006, 14:39 well, model is never really "flat", you are always relative to some segment. But these segments can be all set to 0 (like in bootup code), or to something else (like in DOS progs). | |||
|  06 Feb 2006, 14:39 | 
 | 
| < Last Thread | Next Thread > | 
| Forum Rules: 
 | 
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.