flat assembler
Message board for the users of flat assembler.
Index
> Main > Add "sar" and "size-reporting" operators |
Author |
|
Tomasz Grysztar 22 Sep 2004, 22:14
There is a trick that allows to do it in macro, a bit complicated though, here a sample for 32-bit mode:
Code: if arg eqtype [0] virtual at 0 inc arg load opcode byte from 0 end virtual if opcode = 0FEh display 'byte variable' else if opcode = 0FFh display 'dword variable' else if opcode = 66h display 'word variable' end if end if Also with similar trick you can whether the 32-bit or 16-bit mode is used and adjust the tests. |
|||
22 Sep 2004, 22:14 |
|
MCD 14 Oct 2004, 17:51
Yes, this works, but looks a bit provisory. Perhaps I should write something for myself when the "Guide to Fasm internals" gets finished.
Do you remeber, once, we fasm-people also used macros for alignments lol: |
|||
14 Oct 2004, 17:51 |
|
comrade 14 Oct 2004, 19:10
Privalov, what about rol and ror?
|
|||
14 Oct 2004, 19:10 |
|
MCD 14 Oct 2004, 21:26
Rol and ror would be nice to, and not to difficult to implement. (GFI)
It is only a matter of concept: you could add lots and lots and lots of operators, but this will be a waste of time/code size, since you won't probably use all. So here are some usefull operators you probably won't use any time soon: trn: reverses bit pattern chksum: calculates bitwize checksum ibs/xbs: insert/extract bit string rcl/rcr: rotate with 2^n + 1 bits (9,17,33...) ... many many others. I think, not every operator should be implemented directly, since this causes the code to become messy. |
|||
14 Oct 2004, 21:26 |
|
Madis731 15 Oct 2004, 09:49
i.e. you would mess up rcl/rcr with rotations through carry
r2l/r2r gives you a hint maybe that its using 2^n (maybe rnl/rnr) |
|||
15 Oct 2004, 09:49 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.