flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
beppe85 29 May 2005, 23:18
Why not you define a flat code segment? I.e.
Code: SysCodeSel = $ - GDT dw 0xffff dw 0x0000 db 0x00 db 0x9a ; present, ring 0, code, non-conforming, execute/read db 0xcf db 0x00 But to use a segmented model, it's the base address and program size constant? I guess it is, so you can get the preprocessor to do the job. Code: SysCodeSel = $ - GDT dw end_program and 0xffff dw my_program and 0xffff db my_program shr 16 and 0xff db 0x9a ; present, ring 0, code, non-conforming, execute/read db 0xc0 or end_program shr 16 and 0xf db my_program shr 24 and 0xff There's is an aside in this model. This base address is added to every address refered via CS. So if tell Fasm to use 0x1000 as base for my_program, "jmp my_program" will really jump to 0x2000. You could use "org 0" and put in the GDT the address where the file is loaded in memory by the bootloader. Sorry if I was not clear. PS: This kind of questions should be posted in the "OS Construction" section. _________________ "I assemble, therefore I am" If you got some spare time, visit my blog: http://www.beppe.theblog.com.br/ and sign my guestmap |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.