| |
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.... |
| |
Jammer
Registered: Nov 2002 Posts: 1289 |
I've tried to define that portion of code both as macro and function. Macro resulted in error due to non-assembly instructions. Function compiled without error but most probably as regular assembly that's not really a subroutine. Ok, I see that it has to be totally reorganized ;) |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
If you are reporting error please post complete examples. When you post cutout pieces of code I have no chance of verifying if its an error or not.
I dont think I understand what you are writing. Are you sure its not when you put it in a function you get an error for using asm directives? ( = directives that produce bytes to the output) |
| |
Jammer
Registered: Nov 2002 Posts: 1289 |
Sorry about that :) Macro seems to work fine - it was just enclosed within .if directive that I didn't catch somehow. No error report whatsoever and thank you for the tip ;) |
| |
Hoogo
Registered: Jun 2002 Posts: 102 |
I guess there are situations where automatic long branches are difficult:
---> Dest 1
| ...
| -<Branch 2
| | ...
--+<Branch 1
| ...
-->Dest 2 Branch2 cannot be decided until Branch 1 was decided, and the other way around the same.
But such a situation can already be created with an .if (futureLabelFormual)FillSomeBytesFormula. How do you treat that? Forbid .if with unknown labels? Or some check if passes get out of sync? |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
You guessed it , using if's on yet unknown values gives an error since the memlocation of labels have to be resolved in first pass. |
| |
TWW
Registered: Jul 2009 Posts: 541 |
I saw I asked this thing like 4 years ago and surely found some work-around back then but that is several HD crashes ago and perhaps there are updates I didn't catch.
Strings:
I am making a string for a cartridge header but it contains some RVRS ON characters and stuff. The question is how do I avoid doing this hack:
.const CartridgeName = "C64GS C" // Maximum 32 bytes.
.text CartridgeName
.byte $61,$72,$74,$72,$69,$64,$67,$65
Basically what I would like to do is to append the constant with the bytes as added data to the string. This again to allow me to fill in the surplus available characters without having to cheat:
.fill 32-CartridgeName.size()-8,0
So what I would like to do is:
.const CartridgeName = "C64GS C"+hexBytes($61,$72,$74,$72,$69,$64,$67,$65) |
| |
TWW
Registered: Jul 2009 Posts: 541 |
Hmm another thing I saw now was that I get an error when compiling my code after updating Kickass (was using old version):
.var ZP = $02
.const FetchDataVector = ZP .eval ZP+=2
Have to move the ".eval ZP+=2" to a new line but it used to assemble just fine. Will make my ZP variable declarations a lot more messy ^^ |
| |
Scan
Registered: Dec 2015 Posts: 110 |
You don't need to move it to a new line, you can also use ; to separate the statements:
.var ZP = $02
.const FetchDataVector = ZP ; .eval ZP+=2
|
| |
Digger
Registered: Mar 2005 Posts: 421 |
Tru dat. But you can do this and it works without eval, since it evaluates post expression.
.var zp = $c0
.const screen = zp++
.const vOffset = zp+=2
.const vScrollText = zp+=2
|
| |
TWW
Registered: Jul 2009 Posts: 541 |
You guys are so clever 8-D
I seriously should drag my ass to a (c0py)party so I can start handing out those beers...
Now only question remains is the string issue above. |
Previous - 1 | ... | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 - Next |