SETSTR directive not recognized
vitococl opened this issue · comments
Is there a problem or restriction for SETSTR pseudo-op?
This piece of code from the manual:
processor 6502
org $F800
; Use SETSTR to output a parameter as a string
MAC CALL ; {1} = function name
.FNAME SETSTR {1}
ECHO "This is the function name :", .FNAME
ENDM
CALL HelloWorld ; test it ...
displays the following error:
setstr.asm (10): error: Unknown Mnemonic 'SETSTR'.
Unrecoverable error(s) in pass, aborting assembly!
Complete.
I'm using latest x64 Windows version (2.20.13).
BTW, I searched for "SETSTR" inside the binary executable and I didn't find it as I did for other directives, so it might be a build problem.
It's working here. I did a "git pull" to ensure I had the latest version...
boo@Andrews-MacBook-Pro Chess3E+ % ../dasm/bin/dasm test.asm -f3 -v5 -otest.bin
START OF PASS: 1
----------------------------------------------------------------------
SEGMENT NAME INIT PC INIT RPC FINAL PC FINAL RPC
INITIAL CODE SEGMENT 0000 ???? 0000 ????
----------------------------------------------------------------------
0 references to unknown symbols.
0 events requiring another assembler pass.
--- Symbol List (sorted by symbol)
1.FNAME 6c6c6f576f726c64 str (R ) "HelloWorld"
--- End of Symbol List.
This is the function name : HelloWorld
Complete. (0)
boo@Andrews-MacBook-Pro Chess3E+ % cd ..
boo@Andrews-MacBook-Pro Atari 2600 % cd dasm
boo@Andrews-MacBook-Pro dasm % git pull
Already up to date.
boo@Andrews-MacBook-Pro dasm % git log
commit b6c869f0a10c5925dc5dc608eff8c75b0bb9e7aa (HEAD -> master, origin/master, origin/HEAD)
Merge: 29b8397 4fbb2d0
Author: Dion Olsthoorn <dion.olsthoorn@gmail.com>
Date: Thu Sep 10 21:33:35 2020 +0200
Merge pull request #83 from thomas374b/master
Corrections and testcases for issue #82
can you please just type dasm on a command line and copy/paste what it says as regards version #?
C:\Users\vitoco\Documents\Atari\2600\DASM\test>dasm
DASM 2.20.13
Copyright (c) 1988-2020 by the DASM team.
License GPLv2+: GNU GPL version 2 or later (see file LICENSE).
DASM is free software: you are free to change and redistribute it.
There is ABSOLUTELY NO WARRANTY, to the extent permitted by law.
Usage: dasm sourcefile [options]
-f# output format 1-3 (default 1)
-oname output file name (else a.out)
-lname list file name (else none generated)
-Lname list file, containing all passes
-sname symbol dump file name (else none generated)
-v# verboseness 0-4 (default 0)
-d debug mode (for developers)
-Dsymbol define symbol, set to 0
-Dsymbol=expression define symbol, set to expression
-Msymbol=expression define symbol using EQM (same as -D)
-Idir search directory for INCLUDE and INCBIN
-p# maximum number of passes
-P# maximum number of passes, with fewer checks
-T# symbol table sorting (default 0 = alphabetical, 1 = address/value)
-E# error format (default 0 = MS, 1 = Dillon, 2 = GNU)
-S strict syntax checking
Report bugs on https://github.com/dasm-assembler/dasm please!
OK, yes "SETSTR" was added on April 18, and the release was made on February 20
So, it's a new thing in 2.20.14
I'll try and hurry a release along - it's been nearly 8 months and a lot has been added/fixed/changed
You can, of course, just grab the source code and build your own "latest" version at any time...
OK, I just wanted to trigger some assembly warnings/errors with a macro using labels. As I don't have the needed framework (I guess), I'll comment out that line in the meanwhile and use only the values in the ECHO.
Thanks!
Btw, you can grab the dasm binaries from a recent master snapshot-build here: https://github.com/dasm-assembler/dasm/actions/runs/248623133 (click 'dasm snapshot builds')
OK, I tried it successfully. Thanks!
But as a workaround, I added a second parameter with a string (repeating the first parameter but in quotes). Then I found another problem: mismatch in the number of parameters for a MACRO. Is there a way to bypass that validation and default the missing {#} as an empty string, zero, or something else?
That leads to a missing feature: the ability to check for the number of macro parameters in order to simulate overloads, something like "{n}" or "{N}" (just like "{0}" represents the whole list).
Where could I request for such a feature? Submitting another issue or joining the club in AA?
Create a separate issue would be the best place.