flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Macro with size of operand |
Author |
|
revolution 04 Mar 2012, 11:35
Firstly "$FFh" is not right. Try with "$FF" or "0FFh"
Secondly, you can't use "end" as a parameter, it is a directive. |
|||
04 Mar 2012, 11:35 |
|
shutdownall 04 Mar 2012, 12:33
revolution wrote: Firstly "$FFh" is not right. Try with "$FF" or "0FFh" Okay, already corrected $FFh in $FF. And changed parameter end to ed. But same error as before regarding last parameter: "illegal instruction" => "if eq" But this was exactly the example in FASM main documentation. So how can I ask if parameter val is given or not ? I thought about a misstype of eq which should be equ but this throws an error on "else" line (illegal instruction). My code now is: Code: macro REM line,start,ed,val { db line shr 8 ; line number of REM statement db line and $FF ; line number of REM statement if val equ dw ed-start+2 ; lenght of line db $EA ; REM statement (token code) else db ??? db $EA ; REM statement (token code) db val db NEWLINE end if } And should be used like REM 1,asmcode_st,asmcode_end or REM 20,0,0,'some_data' |
|||
04 Mar 2012, 12:33 |
|
revolution 04 Mar 2012, 12:34
You have "if val equ". That is a different thing.
|
|||
04 Mar 2012, 12:34 |
|
shutdownall 04 Mar 2012, 12:42
Okay - I found the problem.
I am using this in my Z80 version of FASM and accidently I removed the if else end instructions. Sorry for asking. But one thing remains. How can I get the length of val in this macro (which now works regarding the length, marked with 3 ???. Code: macro REM line,start,ed,val { db line shr 8 ; line number of REM statement db line and $FF ; line number of REM statement if val eq dw ed-start+2 ; lenght of line db $EA ; REM statement (token code) else db ??? ; should be length of val (string) db $EA ; REM statement (token code) db val db NEWLINE end if } |
|||
04 Mar 2012, 12:42 |
|
revolution 04 Mar 2012, 12:44
Code: ;... local .x,.length db .length db $EA .x db val .length = $-.x ;... |
|||
04 Mar 2012, 12:44 |
|
shutdownall 04 Mar 2012, 13:10
Thanks for help, works fine now.
|
|||
04 Mar 2012, 13:10 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.