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....
 
2013-05-12 09:51
JackAsser

Registered: Jun 2002
Posts: 1989
@slammer: interesting read on a good example! Cudos!
2013-05-12 19:27
TWW

Registered: Jul 2009
Posts: 541
Can't you do the same with 23 command line snippets and makefile? It will assemble AT LEAST 0,023 seconds faster...
/Irony off


Yeah I know, trolling isn't allowed but I couldn't resist. Sue me^^

Very good example illustrating the power and flexibility of using scripting.
2013-05-12 21:17
chatGPZ

Registered: Dec 2001
Posts: 11118
i cant conditionally include a sourcefile or define constants without pulling the ugliest stunts ever - but thank god i can do super specific stuff like this =) making life easier the java way =)
2013-05-12 21:46
Slammer

Registered: Feb 2004
Posts: 416
Hello Gropaez. Im sure you have already found another assembler. If not, I can only encourage you to do so.
2013-05-12 21:50
Cruzer

Registered: Dec 2001
Posts: 1048
Hehe @ TWW... Yeah, very good example by Slammer. Other uses:

Generating small chunks of speedcode and data, that are so small that it doesn't make sense to do a c64 generator for them, e.g.
lda spriteColor
.for (var i=0; i<8; i++) {
	sta $d027 + i
}
Generating bigger chunks of speedcode and data that are so complex that generating it on c64 would take longer than loading it from disk.

And my favorite, randomizing parameters and printing them out. Then you can just assemble the code over and over to see new variants of the effect, and whenever something looks good, copy/paste the params into the code.
2013-05-12 21:53
chatGPZ

Registered: Dec 2001
Posts: 11118
slammer: convince peacemaker to use another assembler, and i won't touch kickass ever again - promised =P
2013-05-13 06:22
Slammer

Registered: Feb 2004
Posts: 416
Gropaz: Lol. You do realise that your behaviour have put all of your requests to the backend of the queue, right? If you really are forced to use Kick Assembler, putting yourself in a position with no influence on future features, really seams like an excellent strategy. ;-)
2013-05-13 07:04
Oswald

Registered: Apr 2002
Posts: 5018
sorry, couldnt resist:

;                 x1    y1      etc
effect1: .byte Param1, Param2, Param3, Param4  ;circle1
effect2: .byte Param1, Param2, Param3, Param4  ;circle2

init

lda #<effect1
sta zp+0
lda #>effect1
sta zp+1
rts

setupeffect

ldy #$00
lda (zp),y
sta durationlo
iny
lda (zp),y
sta durationhi
iny
lda (zp),y
sta xadd1
iny
lda (zp),y
sta xadd2
iny
lda (zp),y
asl
asl
asl
asl
iny
ora (zp),y
sta xstart1&xstart2
iny
lda (zp),y
sta yadd1
iny
lda (zp),y
sta yadd2
iny
lda (zp),y
asl
asl
asl
asl
iny
ora (zp),y
sta ystart1&ystart2
iny
lda (zp),y
sta xeor
iny
lda (zp),y
sta xand
iny
lda (zp),y
sta yeor
iny
lda (zp),y
sta yand
iny
lda (zp),y
clc
adc #>scaletab
sta xscale1
iny
lda (zp),y
clc
adc #>scaletab
sta xscale2
iny
lda (zp),y
clc
adc #>scaletab
sta yscale1
iny
lda (zp),y
clc
adc #>scaletab
sta yscale2
iny
tya
clc
adc zp
sta zp
bcc *+4
inc zp+1
2013-05-13 07:30
JackAsser

Registered: Jun 2002
Posts: 1989
Quote: sorry, couldnt resist:

;                 x1    y1      etc
effect1: .byte Param1, Param2, Param3, Param4  ;circle1
effect2: .byte Param1, Param2, Param3, Param4  ;circle2

init

lda #<effect1
sta zp+0
lda #>effect1
sta zp+1
rts

setupeffect

ldy #$00
lda (zp),y
sta durationlo
iny
lda (zp),y
sta durationhi
iny
lda (zp),y
sta xadd1
iny
lda (zp),y
sta xadd2
iny
lda (zp),y
asl
asl
asl
asl
iny
ora (zp),y
sta xstart1&xstart2
iny
lda (zp),y
sta yadd1
iny
lda (zp),y
sta yadd2
iny
lda (zp),y
asl
asl
asl
asl
iny
ora (zp),y
sta ystart1&ystart2
iny
lda (zp),y
sta xeor
iny
lda (zp),y
sta xand
iny
lda (zp),y
sta yeor
iny
lda (zp),y
sta yand
iny
lda (zp),y
clc
adc #>scaletab
sta xscale1
iny
lda (zp),y
clc
adc #>scaletab
sta xscale2
iny
lda (zp),y
clc
adc #>scaletab
sta yscale1
iny
lda (zp),y
clc
adc #>scaletab
sta yscale2
iny
tya
clc
adc zp
sta zp
bcc *+4
inc zp+1


Yes and Slammer's point was that you get the same readability in the code (i.e. parameters kept together in chucks _AND_ directly in the source). However Slammer's example will produce more effective code on the C64-side. Instead of having to "parse" the params manually on the C64 each time you setup the effect this is done at compile time. This yields:

* Smaller code
* Faster code
* Same readability

win/win/win

And yes, the faster/smaller point will probably be insignificant anyway so... use whatever method you're comfy with.

:D
2013-05-13 08:40
Oswald

Registered: Apr 2002
Posts: 5018
agreed.

for me more of a selling point is the nice capability of importing gfx/textures, or calculating sines, but am simply yet too lazy to make the move.
Previous - 1 | ... | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | ... | 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
Krill/Plush
Didi/Laxity
MaD ][/Starship
Wiklund/Fairlight
Exile/Anubis
Harry/Alivers
CA$H/TRiAD
apprentix
rambo/Therapy/ Resou..
csio/monarchy c+4
iceout/Avatar/HF
Guests online: 125
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 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Webmasters
1 Slaygon  (9.7)
2 Perff  (9.6)
3 Morpheus  (9.5)
4 Sabbi  (9.5)
5 CreaMD  (9.1)

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