| |
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.... |
| |
chatGPZ
Registered: Dec 2001 Posts: 11114 |
Quote:the problem with your debug code is kickass, it shouldnt define the conditinal code sections as scopes automagically.
noooooooo /o\ |
| |
Agemixer
Registered: Dec 2002 Posts: 38 |
I have a suggestion to kickass developers.
I think there is atleast 3 possible ways to deal with scopes (if you want to take my note on future versions of kickass)
The first one is a dirty addition:
{ // This is a scope
}
#{ // This one is unscoped
}
It could be also "-{" or "{{" instead of "#{" or such, you got the idea. Will be treated as same level as parent scope or main.
The another method could be a Global assignment to a label/var/constant definition:
.global label yesbox=$1234
...and "yesbox" could be then accessible from anywhere the whole source file, visible to all scopes. That's not standard assembly, but is kickassembler syntax any standard assembly anymore at all? :)
Then the third idea:
.scopeless (or .disable_scoping)
...and all scopes below this line would be treated as non-scopes, until .enable_scoping is reached to enable
Shouldn't be hard to implement in future version kickass and neither would break the current codings made with kickass i guess? |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
Soci: Thanks, Its corrected in the new version 3.39 just released.
Agemixer: Thanks. If you join the facebook group (https://www.facebook.com/groups/RetroAssembler/) you will get access to the official Kick Assembler Wish List, where you can enter your ideas. It's also a good place for discussing ideas.
I don't know if you have noticed, but you can enter normal scopes like this:
Function1: {
col: lda #01
sta $d020
rts
}
Function2: {
inc Function1.col+1
rts
}
This will ofcause not solve the if-problem. |
| |
Agemixer
Registered: Dec 2002 Posts: 38 |
Because i haven't found any examples how to produce C64 ascii with kickassembler, here is mine:
.function pet2asc(p) { .eval p = [ p>$40? p+=$80 : p ] .return [ p<$20? p^$40 : p ] }
.macro asctxt(str) { .fill str.size(), pet2asc(str.charAt(i)) }
.macro asctxtCR(str) { :asctxt(str) .byte $0d }
ldx #$00
loop: lda text,x
beq end
jsr $ffd2
inx
bne loop
end: rts
text: // C64 ascii
.byte 5 // color = white
.byte 147 // clr+home
.byte 9,14,8 // case change: enable C= + shift, set locase, disable
:asctxt("Hello World!")
:asctxtCR(" 1,2,3,4...")
:asctxtCR("")
:asctxt("The quick brown fox ")
:asctxtCR("jumps over the lazy dog")
.byte 0 |
| |
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
} |
Previous - 1 | ... | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | ... | 61 - Next |