flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution
The first instantiation of the macro will print "haha" and then RETurn to the caller (BIOS) so ANY code you place after your macro will not be executed. Try this:
Code: org 0x7c00 use16 mov ax, 0x0000 mov ds, ax start: macro print String{ local .Printer local .Nextchar local .Done local .a .Printer: mov si, .a mov ah, 0Eh jmp .Nextchar .Nextchar: lodsb or al, al jz .Done int 10h jmp .Nextchar jmp .Done .a db String,10,13,0 .Done: } print "haha" print "akimbo" ret times 505-($-start) db 0 ;512 bytes dw 0xaa55 BTW: does the follwing line really compile properly? Code: times 505-($-start) db 0 512 bytes |
|||
![]() |
|
oscar
it does....but it may not actually be 512 bytes...i saw it in an example i was looking at and i never actaully figured out if stuff in the bootsector HAS to be 512 bytes or if it can be less than that.
point being it compiles for me...sould be Code: times 505-($-start) db 0 ;512 bytes (the 512 bytes was a comment) anyway, Thanks heaps, i had the idea that "ret " just returned you to where you were in the main program (kind of like an exit in BASIC). i can't beleive i spent 2 days trying to figure out something so simple |
|||
![]() |
|
Tomasz Grysztar
oscar: I think you are using the macro where what you wanted was actually the procedure. The fact that you used "called" terminology and "ret" instruction seems to confirm it.
|
|||
![]() |
|
revolution
Quote: i never actaully figured out if stuff in the bootsector HAS to be 512 bytes or if it can be less than that. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.