I want to create macro in FASM, which could directly print string (int DOS) like this:
prints 'hey there!!!!'
I have written such code:
format MZ
use16
stack 0x100
entry _TEXT@16:_start
;
macro prints str
{
call @f
db str, 0x24
@@:
pop dx
mov ah, 9
int 0x21
}
segment _DATA@16 use16
msg db 'hi!', 0xd, 0xa, 0x24
segment _TEXT@16 use16
_start:
push _DATA@16
pop ds
prints 'hi there))) !!!!'
prints 'me'
mov ax, 0x4c00
int 0x21
ret
The problem is: when I leave my _DATA@16 segment empty (without any variables) all is fine. But when I define new variable in that segment some raw extra symbols begin to appear like this: http://board.flatassembler.net/files/err_758.png
So can you help me? where is my mistake? Maybe I have chosen the wrong way to achieve that thing I want? Help please....