| |
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.... |
| |
Agemixer
Registered: Dec 2002 Posts: 38 |
Thanks Slammer |
| |
Murphy
Registered: Jul 2006 Posts: 10 |
Slammer: Thanks for this awesome assembler!
Support of |= (and &=) operators are planned? |
| |
Murphy
Registered: Jul 2006 Posts: 10 |
I found a strange issue with the asserts.
.assert "Key is valid=", tab.containsKey(key), true
.var actList= List().addAll(tab.get(key))
The tab is a Hashtable which contains lists.
When the value of the key is invalid, i get an error:
cml.kickass.values.NullValue cannot be cast to cml.kickass.values.ListValue
It looks, the assert interpreted later than the addAll. |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
Hi Murphy
|= and &= can easily be implemented so it goes on the todo list (Feel free to enter the Facebook group and add them yourself).
In some cases KickAssembler can skip parts of evaluation if it doesnt have enough information to do the evaluations. Assert is not asserting before both values are valid and invalid values can occur if you base you calculations on labels that is not yet resolved.
However I would like to see your code, Could you shortend it to a small example and send it to me? You where not supposed to get a cast execption but a "Invalid argument. It has to be a list."-message in case of null. |
| |
Murphy
Registered: Jul 2006 Posts: 10 |
Thanks Slammer! The source was sent in PM. |
| |
Murphy
Registered: Jul 2006 Posts: 10 |
I know this is a complex request...
but string concatenating for label names can be very usefull in macros. Of course, only when the label can be 'exported' out of the scope of the macro.
Example code: register saver macros for irq.
.macro SaveRegsImm(reg_cache) {
sta reg_cache#_a
stx reg_cache#_x
sty reg_cache#_y
}
.macro LoadRegsImm(reg_cache) {
.label reg_cache#_a = *+1
lda #0
.label reg_cache#_x = *+1
ldx #0
.label reg_cache#_y = *+1
ldy #0
.public reg_cache#_a
.public reg_cache#_x
.public reg_cache#_y
} |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
I just released v3.40, where you will get a normal errormessage instead of a class cast exception when you suply a non-list-value to the addAll method.
I don't see anything that could be tricky with the assert, and it asserts fine here. Are you sure the given parameter is in the table?
About concatenating label names. I think it will a bit too complex. Basically, I have to be able to scan for labels and know their names. |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
Murphy: Btw. are you aware that you can access variables of executed macros by adding a label on the line that executes the macro:
.macro SetColor() {
color: lda #00
sta $d020
}
...
lda #1
sta x.color+1 // Set color in first execution of macro
lda #2
sta y.color+1 // Set color in second execution of macro
x: :SetColor()
y: :SetColor()
Perhaps this will solve your concatenation problem. |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
Btw. One thing about the assert commands. They don't stop execution if they fails. Instead they remember the error and print them out at the end of execution (If no 'hard' errors occurs.) They are primary made so I could have a testsuite to run before each release (currently 615 asserts)
I guess this explains your original problem :-)
http://theweb.dk/KickAssembler/webhelp/content/cpt_Testing.html |
| |
Murphy
Registered: Jul 2006 Posts: 10 |
Thanks Slammer!
Your solution is much more elegant than mine!
It's a shame that I haven't noticed this in the documentation. :) |
Previous - 1 | ... | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | ... | 61 - Next |