flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2 |
Author |
|
Tomasz Grysztar
It seems you forgot to map your code into memory, you have only mapped a single page at address 0.
|
|||
![]() |
|
Fulgurance
...Hum, if i understand, i have forget to map since 0x1000 address ? Is it that ?
Last edited by Fulgurance on 06 Feb 2020, 13:22; edited 2 times in total |
|||
![]() |
|
Tomasz Grysztar
Yes, if your code is at address 0x1000, then you need to actually map the memory containing that code there, otherwise CPU is not going to have anything to execute.
|
|||
![]() |
|
Tomasz Grysztar
Remember that all page tables need to have addresses of form 0XXXXX000h, what you can ensure with ALIGN directive:
Code: align 1000h PageDirectory: dd PageTable + 111b dd 1023 dup 0x0 PageTable: dd 0x0B8000 + 111b dd 0x001000 + 111b dd 1022 dup 0x0 |
|||
![]() |
|
Fulgurance
Oh yes ... Thanks for your help
![]() Just little question. I'm tired to always calculate the good size of my size to have always multipe of 512 bytes. Are there any solution to calculate the appropriate size ? For example if my file after compilation have size of 6000 bytes, if i would like to calculate how many 512 sectors i need, is it possible to test the result when the result is decimal number ? (6000 / 512 = 11.71865) -> i need 12 sectors (for make floppy image) |
|||
![]() |
|
Tomasz Grysztar
You can use ALIGN to find out the nearest boundary and then pad with a filling of your choice:
Code: virtual align 512 PADDING = $ - $$ end virtual db PADDING dup 0 Code: align 512 store byte 90h at $-1 |
|||
![]() |
|
Fulgurance
Hum interesting, i don't know this command. And i have finally found other way to do that. I have seen FASM support conditionnal instruction. Thanks you very much for your help !
|
|||
![]() |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.