flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Print macro

Author
Thread Post new topic Reply to topic
me239



Joined: 06 Jan 2011
Posts: 200
me239 21 Feb 2011, 06:46
Hello, recently I've been trying to make some macro that mimic QBasic and I've had quite a bit of success with input and others, but one problem I'm having is the print macro. In QB you can type
Code:
 a = "hey"
PRINT "Hello World!", a
    
and have no problem. So what I already have it able to do is have it so you can write
Code:
print "Hello"    
and print the word hello, but what I also want is to be able to type
Code:
print a
a db "Hello!", 0    
using the same macro. I want it so I could put it together like so
Code:
 print "Hello", a
a db "user", 0    
My question is, HOW DO I DETECT QUOTE MARKS? Here is my code...
Code:
macro print [string]{
mov si, $+5
jmp @f
db string, 0
@@:
lodsb
cmp al, 0
jz @f
mov ah, 0eh
int 10h
jmp @b
@@:
}
    
Post 21 Feb 2011, 06:46
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 21 Feb 2011, 07:51
check "eqtype" in FASM manual.
Post 21 Feb 2011, 07:51
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
me239



Joined: 06 Jan 2011
Posts: 200
me239 21 Feb 2011, 21:38
JohnFound wrote:
check "eqtype" in FASM manual.
Thanks! Very Happy
Post 21 Feb 2011, 21:38
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.