So I go to try it. I convert my clear screen function (which works) into a macro and compile. Nothing happens but my "h" is written. This comes after the clear screen. The macro didn't through an error. It just skipped it. I convert it back and it worked again.
So I was wondering if the problem is obvious (like some option I must pass to nasm at compile time) or is something more subtle.
I have seen someone use a macro to do a realmode print function.
Thanks in advance
BTW: I compiled my SCRN functions alone into a file (SYS file). (just them, the clear screen and my beginnings of a putch function both of which were macros.) The file came out as being empty. (0 bytes) I loaded it with Notepad++ and it was empty.
My clear screen code:
Code: Select all
%macro clrscrn 0
pusha
mov ebx, 0x18
mov es, ebx
mov ebx, 0
mov al, " "
mov ah, 8Fh
%%loopscrn:
mov word [es: ebx], ax
inc ebx
inc ebx
cmp ebx, 0xFA0
jne %%loopscrn
mov ebx, 0
popa
ret
%endmacro