Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Kick Assembler Thread 2
2009-07-21 17:20
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....
 
2015-05-01 12:48
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
}
2015-05-03 16:31
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.
2015-05-03 16:43
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.
2015-05-03 16:59
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
2015-05-03 21:28
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. :)
2015-05-23 15:24
TWW

Registered: Jul 2009
Posts: 541
From my -PNGtoKOALA routine I get the following error:

 .for (var Pixel = 0 ; Pixel < 4 ; Pixel++) {
                        .eval PixelColor = Graphics.getPixel([[8*BlockNumber]+[[Pixel<<1]&7]]-[320*[floor(BlockNumber/40)]] , [8*floor(BlockNumber/40)]+Byte)
                        .eval BMPPattern = ColorIndex.get(PixelColor)
                        .eval BMPByte = BMPByte|[BMPPattern << [6 - Pixel*2]]
                                                            ^

Error: Unknown function : <<


I've used it before and it worked fine so what the heck am I missing?

EDIT: Found out. Had some "ghost pixels" with different RGB codes in the GFX I was converting... Funtion works as intended. SOLVED.
2015-05-23 16:30
Slammer

Registered: Feb 2004
Posts: 416
BMPPattern contains a value for which the << operator is not defined. Could it be null?
2015-05-24 13:50
TWW

Registered: Jul 2009
Posts: 541
Yepp. That was precisely it.
2015-07-09 21:19
Killsquad
Account closed

Registered: Jun 2005
Posts: 17
Any update on .ifdef/.ifndef directives? Would be very handy.
2015-07-10 07:07
Slammer

Registered: Feb 2004
Posts: 416
The basic directives are implemented as know from C# (#define, #if, #else, #elif, #endif, #undef). Currently missing is setting definitions from the commmand line and boolean operatiors. But they will be there, don't worry.

Other nice things which are already implemented are:

- The * is back, *=$1000. (You can still use .pc)
- You can now use normal ( ) aswell as [ ]
- You can add an optional ; in the end of commands, eg: .eval x=27;
+ Some other goodies

The reason it takes time is that they are part of a bigger modification, where the entire parsing routine is reimplemented. Instead og using a parsergenerator, most of it is now done by handwritten code which gives more flexability. This will be in the next major version (4.0). I guess it will take at least a couple of months finish.
Previous - 1 | ... | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | ... | 61 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Sentinel/Excess/TREX
Style/Chrome
Apollyon/ALD
MAT64
icon/The Silents, Sp..
Guests online: 137
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.8)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.052 sec.