flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > 'pk' macro (works this time :) |
Author |
|
vid 04 Feb 2006, 16:15
it would be nice to say what your macro should do first. "pk" isn't very descriptive
|
|||
04 Feb 2006, 16:15 |
|
RedGhost 05 Feb 2006, 09:42
The_Grey_Beast wrote: mov bx, 0x0501 ; bh is 5 and bl is 1 that never even crossed my mind when you need to set the low and high byte to just set the 16bit register (one less mov instruction) i think im gonna optimize some of my realmode/dos apps, thanks _________________ redghost.ca |
|||
05 Feb 2006, 09:42 |
|
Borsuc 08 Feb 2006, 10:51
You're welcome.
I tried to explain it in the Description quote, if you think you can add something there to make it more 'descriptive' feel free to suggest it |
|||
08 Feb 2006, 10:51 |
|
vid 08 Feb 2006, 11:10
oh, sorry. but description should come first because then you don't know what are you reading about until you reach description
|
|||
08 Feb 2006, 11:10 |
|
Borsuc 08 Feb 2006, 11:38
thanks
fixed |
|||
08 Feb 2006, 11:38 |
|
vid 08 Feb 2006, 11:55
by the way: are you sure "err" signals error to assembler? How did you define it? Because if it's undefined symbol then it causes error during parsing, meaning that
Code: if 0
err
end if |
|||
08 Feb 2006, 11:55 |
|
Borsuc 08 Feb 2006, 12:13
it's not defined, since it's not a valid instruction anyway.
not to worry, i tested, but I'm also a little confused between parser and assembler. |
|||
08 Feb 2006, 12:13 |
|
vid 08 Feb 2006, 12:17
after preprocessing, you have TEXTUAL source. During parsing, everything is translated into FASM internal binary form. All expressions, instruction arguments, strings etc. have some binary representation. But representation for directives/instructions (treated same by FASM) are pointers to handler of that directive/instruction. And of course, for undefined ones there is no handler, so error occurs during preprocessing, as there is no binary representation for undefined symbol and textual source cannot be translated to binary form.
|
|||
08 Feb 2006, 12:17 |
|
Borsuc 08 Feb 2006, 12:19
I thought parser stops when it sees if 0 because it only recognizes eqtype in eq..
it worked when I tested, maybe there's some trick I coded and I am not even aware of |
|||
08 Feb 2006, 12:19 |
|
vid 08 Feb 2006, 13:06
oh, yes, i forgot, parser can actually also remove if-ed blocks which are already predictable without assembling (if 0, if abcd eq abcd, if a in <a,b,c> etc.) i shouldn't forget that, especially because it was my idea ...
but in this example it will (hopefully) cause error: Code: a=1 if a=0 err end if |
|||
08 Feb 2006, 13:06 |
|
Borsuc 08 Feb 2006, 13:09
it doesn't give error when i compile.
maybe because that's the assembly stage, not parse stage, and maybe it's different? (parser doesn't have numeric constants, that's why it's assembly stage) |
|||
08 Feb 2006, 13:09 |
|
Tomasz Grysztar 08 Feb 2006, 13:19
There are almost no errors that may happen during parsing stage - the illegal instruction error like here happens at the assembly stage, not parsing.
|
|||
08 Feb 2006, 13:19 |
|
vid 08 Feb 2006, 13:22
you store something that stores such "parser" error and signals them only if they occur in final assembling pass? Or how does it work... i know you wrote you want to do something like that but then you didn't do because not all errors can be romeved from parser
|
|||
08 Feb 2006, 13:22 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.