flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > Variable in quotes? |
Author |
|
Madis731 24 Jul 2009, 06:37
how about:
Code: var equ "234" db "1",var,"5" or Code: macro itoa var { display "1",`var,"5" ;debug db "1",`var,"5" } itoa 234 |
|||
24 Jul 2009, 06:37 |
|
Azu 24 Jul 2009, 20:10
Let me post my exact code okay and tell me why it doesn't work together please
Code: struc edb[a]{ common . dd .len label .data byte forward local l,b done equ match =reverse b, a \{ done equ 1 l db b repeat ($-l)/2 load b1 byte from l+%-1 load b2 byte from $-% store byte b1 at $-% store byte b2 at l+%-1 end repeat \} match , done \{ db a \} common .len = $-.data} MrString edb 'Hello, I am ',`MrString.len,' bytes long. In otherwords, ',`(MrString.len*8),' bits.' It fails to compile with "value out of range"! |
|||
24 Jul 2009, 20:10 |
|
bitRAKE 25 Jul 2009, 01:54
Please, tell the value of MrString.len that you have calculated. It this equation possible to solve? I believe there are several correct answers, but haven't worked it out.
|
|||
25 Jul 2009, 01:54 |
|
Azu 25 Jul 2009, 01:59
Expected output:
Code: MrString.len = 51 MrString.l: dd MrString.len MrString: db 'Hello, I am 51 bytes long. In otherwords, 408 bits.' It would solve it by counting how long the string is, inserting the count into the right spots, and then recounting until the number stops changing, I guess. Or maybe it has a more optimized way. |
|||
25 Jul 2009, 01:59 |
|
bitRAKE 25 Jul 2009, 02:25
# and ` must be used in a macro.
Eh, should work in a struc too. Last edited by bitRAKE on 25 Jul 2009, 02:29; edited 1 time in total |
|||
25 Jul 2009, 02:25 |
|
Azu 25 Jul 2009, 02:28
So if I put it in a dummy rept or irp block it should work? It doesn't.
Any other ideas? |
|||
25 Jul 2009, 02:28 |
|
bitRAKE 25 Jul 2009, 02:37
I can't get it to interpret MrString.len as a number - always a string.
Adding: Code: display 13,10,`.len,13,10 (Even in Madis731's example above the macro argument is a string.) Last edited by bitRAKE on 25 Jul 2009, 02:41; edited 1 time in total |
|||
25 Jul 2009, 02:37 |
|
Azu 25 Jul 2009, 02:39
That wouldn't work anyways.. I need to be able to put it anywhere in the string, not in a hard coded location x_x
Thanks anyways though |
|||
25 Jul 2009, 02:39 |
|
bitRAKE 25 Jul 2009, 02:42
Well, when testing we might try other things to discover.
(I wasn't implying this was a solution to your problem.) The manual says ` quotes a string as well. |
|||
25 Jul 2009, 02:42 |
|
bitRAKE 25 Jul 2009, 03:08
I suspect the macro invocation is stripping the ` as well.
(Put as many as you want and they are gone: ````````MrString.len) Last edited by bitRAKE on 25 Jul 2009, 03:11; edited 1 time in total |
|||
25 Jul 2009, 03:08 |
|
Azu 25 Jul 2009, 03:09
Aww
Is there a way to fix this besides making more changes to FASM's source? I'm sick of having to change it.. and then re-apply all my changes to it every time a new version comes out.. Please??????? |
|||
25 Jul 2009, 03:09 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.