| |
Slammer
Registered: Feb 2004 Posts: 416 |
Kick Assembler Thread 2
The previous thread took a little long to load, so this is a new fresh one.. |
|
... 590 posts hidden. Click here to view all posts.... |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
I once considered making a set preprocessing commands so you could do things like this, but I guess it will be really confusing to have two if commands, two var commands, etc. And I guess the .importonce directive covers 99% of the needs.
Dependent on how complex you includes are, there might be a hack. Since normal directives aren't evaluated during the preprossing pass, you can't create normal .var's or .const's to use in the '.import source' directive.. However, you can give variables to the assembler by the command line and use these as the include filename. Create an empty file to include, if you don't want to include anything..
Eg:
--- Commandline ---
java -jar KickAss.jar mySource.asm :loader="irqloader.asm"
--- mySource.asm ----
.import source cmdLineVars.get("loader")
NB. Its only the .import source directive that is effects by this issue. Other imports can be placed inside if's |
| |
Norrland
Registered: Aug 2011 Posts: 14 |
I'm trying to convert from 64tass-religion to KickAss-religion. When using 64tass, I've been using command line option -L alot. From 64tass docs:
Quote:
-L <file> List into <file>
Dumps source code and compiled code into file. Useful for debugging code, it's much easier to identify the code in memory within the source files.
Example
64tass -L list.txt a.asm
*=$1000
ldx #0
loop dex
bne loop
rts
result (list.txt):
;6502/65C02/65816/CPU64/DTV Turbo Assembler V1.4x listing file of "a.asm"
;done on Fri Dec 9 19:08:55 2005
.1000 a2 00 ldx #$00 ldx #0
.1002 ca dex loop dex
.1003 d0 fd bne $1002 bne loop
.1005 60 rts rts
;****** end of code
I can't seem to find a similar command line option in Kick Assembler docs. Does that exists? |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
@H Macaroni: Seems like a cool feature, but no, you can't do that in KickAss. What I usually do is simply to print out the address of the point I wanna inspect in the monitor like this:
.print "here: " + toHexString(*)
|
| |
Slammer
Registered: Feb 2004 Posts: 416 |
If i where you, I would export a vice symbol file (option -vicesymbols) and see your code in the vice monitor (including your labels).
There actually is a secret option a bit like the one you want, but with a much higher detail level so I won't recommend it for debugging programs in general (I use it for debugging the assembler). However, It might be interesting for people who wants a sneak peak of whats going on while assembling. The option is -parsetree which shows the state between each pass. The output looks like this: rasterbar.asm 45:4 : #NAsmCmd(ldy, EAsmArg(EVarRef(rasterColor)))
rasterbar.asm 46:4 : #NAsmCmd(cpy, EAsmArg(EConst(!255.0)))
rasterbar.asm 47:4 : #NAsmCmd(beq, EAsmArg(EVarRef(o1)))
rasterbar.asm 48:4 : #NAsmCmd(lda, EAsmArg(EConst(!53266.0)))
rasterbar.asm 49:4 : #NAsmCmd(cmp, EAsmArg(EConst(!53266.0)))
rasterbar.asm 50:4 : #NAsmCmd(beq, EAsmArg(EObjFuncCall(-,EPcRef(),EConst(!3.0))))
rasterbar.asm 51:4 : #NAsmCmd(sty, EAsmArg(EConst(!53280.0)))
rasterbar.asm 52:4 : #NAsmCmd(inx, EAsmArg())
rasterbar.asm 53:4 : #NAsmCmd(jmp, EAsmArg(EVarRef(l1)))
Beware, It easily gets complicated and is not supported in any way (Originally only intended for me to read). However, if you are really interested whats going on in line 50, you might be able to tell.
|
| |
Norrland
Registered: Aug 2011 Posts: 14 |
Thanks for the answers, I'll try them. |
| |
Mace
Registered: May 2002 Posts: 1799 |
Why do I get an error (Uknown function) on the - in [max-min] in de code below?
Using KickAss v3.25.
.pseudocommand sinData min;max;freq {
.var amp = 0
.eval amp = [max-min]/2
.fill 256, amp + amp * sin(toRadians(i*[360*freq]/256))
}
.pc = $1000
:sinData 0;255;1
|
| |
Killsquad Account closed
Registered: Jun 2005 Posts: 17 |
To get the numeric value of the params use max.getValue(), min.getValue() and freq.getValue().
|
| |
Killsquad Account closed
Registered: Jun 2005 Posts: 17 |
Would it be possible for enums to continue from the next number after an explicit value?
Example:
.enum { var1 = $10, var2, var3 }
should give var2=$11, var3=$12
As it is now var1=$10, var2=$00 and var3=$01
Thanks for the massive effort by the way. Excellent assembler! |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
Mace: Seems more like a job for a macro. Then you don't have to use getValue() |
| |
Mace
Registered: May 2002 Posts: 1799 |
Thanks Killsquad.
@Cruzer: yeah, probably... was just foolin' around 'n stuff ;-) |
Previous - 1 | ... | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | ... | 60 - Next |