Re: [fasm-help] My macro doesn\'t work
Brought to you by:
privalov
From: Tomasz G. <fa...@me...> - 2002-07-15 18:43:57
|
> See my little dummy prog > org 100h > use16 > ;In this line I've got "Value out of range" > ;why? > display kk > blad: > mov ah,4ch > int 21h > macro display slowo > { > mov ah,9eh > mov dx,slowo > int 21h > } > error db 'Error Ocurred$' > kk db 'Hi!$' > Where is the problem? You should define macro before you use it. "display kk" is here interpreted as a built-in "display" directive, which needs bytes or string as an arguments, and the kk is larger than byte (because it's above 100h due to the "org" directive) that's why you've got "value out of range" error. If the kk was less than 100h, you'd have simply this byte displayed at compile time and no code generated before "mov ah,4ch". To do what you wanted, simply move the macro definition to the beginning of your source. This happens only with preprocessor symbols (macros and equ's), labels and constants can be accessed from anywhere. -- Tomasz |