| |
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.. |
|
... 592 posts hidden. Click here to view all posts.... |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
Update to Kick Assembler v3.15. If you are already running on v3.15 then you have found a bug. Send me a piece of failing code and I will se what I can do about it.
|
| |
TWW
Registered: Jul 2009 Posts: 542 |
There you go! Ask Slammer and it's good to go. Should have checked latest version myself before posting (smacks forehead). Somehow I imagined I 'had' the latest version... Time to cut down on the jack&cokes^^
Edit: I saw Pantaloon requested a ".ifdefined" function for determining if a variable have been defined earlier. I could not find anything regarding this in you updates page (or the manual(I admit though I only browsed it lightly^^)) so I guess what I'm asking is: Is it still on your to_do list? 8-D |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
It's not forgotten, but dont expect it soon. These days im a bit busy with other projects (like work).. |
| |
Digger
Registered: Mar 2005 Posts: 422 |
Guys, I am trying to split my source into logical parts using import source "file.asm"
How to define global variables in the main.asm (so that other imported files have access to them) other way than having a globals.asm file that gets imported into every linked .asm file?
Can I use namespaces for that?
Cheers big ears.
|
| |
Slammer
Registered: Feb 2004 Posts: 416 |
My guess is that you do like this:
-----------main.asm---------------
.import source "file1.asm"
.import source "file2.asm"
.var myNumber=42
-----------file1.asm---------------
lda #myNumber
This will not work since the variable is declared after file1.asm is included, so the variable is used before it is declared.
There are two solutions:
1. Define your vars before the import statements
2. Define your vars as labels (this will cost you an extra pass when assembling since the value first will be ready in pass two, but you probably don't care about this)
The following should work:-----------main.asm---------------
.import source "file1.asm"
.import source "file2.asm"
.label myNumber=42
-----------file1.asm---------------
lda #myNumber |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
Or import globals.asm as the first file in main.asm, that way it doesn't need to be imported into all the other files. |
| |
Mace
Registered: May 2002 Posts: 1799 |
There is no way to incorporate binary data as ASCII in the source with KickAss, is there?
Something like BASE64? |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
You can write a decode macro that does it. Something like:
.var base64Str = "sfkjfsjdfisjhfijsifjsdkjfskdjf";
:Base64Decode(base64Str)
.marcro Base64Decode(str) {
// for all chars in str look up value in decode table and make a .byte directive to output the data
} I'm curious, how is this useful? |
| |
Mace
Registered: May 2002 Posts: 1799 |
So I could post on forums a source that includes binary data, without having to type all bytes with .byte. :-)
It's not that I really NEED it, but I was just wondering. |
| |
Conjuror
Registered: Aug 2004 Posts: 168 |
I have a question about scoping. Is there anyway to access variables within a scope block, such as:
lda #$03
sta scroller.rowCount + 1
scroller: {
rowCount:
ldx #$03
...
rts
}
note: example only
Otherwise I'd have to expose the entire 'function' and its labels/variables to the rest of the program. Yes I am a JAVA programmer :D
Steve |
Previous - 1 | ... | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ... | 61 - Next |