flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Macro newbie

Author
Thread Post new topic Reply to topic
Hjortur



Joined: 15 Dec 2006
Posts: 2
Hjortur
Hello all, a am just moving from masm to fasm. I am a total macro newbie and was just trying out the macro engine. Why does this return gibberish ?

Code:
macro printc imm
{
        mov ah,02h
        mov dl,imm
        int 21h
}
macro prints imm
{       
        mov dx,imm
        mov ah,09h
        int 21h
}
macro endprogram
{
        mov ax,4c00h
        int 21h
}

push cs
pop ds
printc 'a'
prints message
endprogram
message db "hallo$"    


Looks like printc macro works fine.
Post 16 Dec 2006, 01:35
View user's profile Send private message Reply with quote
Goplat



Joined: 15 Sep 2006
Posts: 181
Goplat
Nothing to do with macros actually. If this is supposed to be a .COM file, you forgot the "org 100h"; if it's supposed to be an .EXE file you forgot "format MZ".
Post 16 Dec 2006, 01:57
View user's profile Send private message Reply with quote
Hjortur



Joined: 15 Dec 2006
Posts: 2
Hjortur
yeah ofcourse!! Very Happy

what was I thinking ?
Post 16 Dec 2006, 02:37
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.