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
2006-06-07 21:34
Slammer

Registered: Feb 2004
Posts: 416
Kick Assembler


I recently did a new 6510 assembler and I hereby make it open to the public so you can use it too.

Kick Assembler is the combination of an assembler for doing 6510 machine code and a high level script language. With the assembler functionalities, you can write your assembler programs, and with the script language, you can write programs that generate data to use in the assembler programs. This could be data such as sine waves, coordinates for a vector object, or graphic converters. In addition, you can combine assembler commands and scripting commands which is a powerful combination. A little example: Where other assemblers can do simple unrolling of loops, Kick Assembler can base the unrolling of a loop on a list generated by the script language and select the content of the loop body based on the content of the list. This makes it more flexible when generating speed code.

The script language can handle values such as Numbers, Booleans, Strings, Lists, Vectors, Hashtables, Matrixes and you can define your own structures if the build in doesn’t meet your needs. The assembler contains a replica of the java math library + a special 3d library for doing vector math (Rotation, move and projection matrixes). You can also define your own functions.

Finally, I want to mention that the assembler contains some special objects that makes it easy to import graphics (and convert it into you own spooky format which fits into the part you are working on) and music. Since finding the correct play address for a tune has recently been an issue in the “*stupid* ASM Sid Player Example”- thread I will here show how it’s done in kick Assembler. You simply load you PSID file into a variable in the script language and then read the things you need to know from the variable.

// Load the music into an object in the script language
.var music = LoadSid("C:/C64Music/Tel_Jeroen/Closing_In.sid")


// init the music 
lda #music.startSong-1
jsr music.init

// play the music 
jsr music.play 


(The full example is listed in the manual)

Feel free to check out the assembler at http://www.theweb.dk/KickAssembler.htm
 
... 251 posts hidden. Click here to view all posts....
 
2006-10-29 04:31
Style

Registered: Jun 2004
Posts: 498
Slammer - why am I suddenly getting syntax errors after upgrading?

eg

 :Do_irq (controlirq,$0090,true)
                     ^

Error: Syntax error



Doesnt it like hex anymore? :)


EDIT: Found it, you mustve changed the parser's handling of whitespace, because it no longer accepts a space between a macro call and its parameters.
2006-10-29 10:22
Slammer

Registered: Feb 2004
Posts: 416
Style: You are right, it no longer accepts whitespace.When implementing pseudo commands I had to make this assumptions in order to tell the difference between executing a macro and a pseudo command with an argument that starts with a parantesis (like ($30),y). I understand your confusion - hope it didn't cause too much trouble.

2006-10-29 11:49
Style

Registered: Jun 2004
Posts: 498
nope, its fine - took me 5 mins to figure it out. Wish Id spent the 5 mins before posting, really :)
2006-10-29 13:25
Slammer

Registered: Feb 2004
Posts: 416
Now release 2.17 is on the site, including error codes. You can download at http://www.theweb.dk/KickAssembler.htm
2006-11-05 21:29
Frantic

Registered: Mar 2003
Posts: 1648
...and I can confirm that my makefiles work as expected now. Thanks for the fix!

//FTC
2006-11-29 14:58
Frantic

Registered: Mar 2003
Posts: 1648
Another feature that would be nice in association with this error code return stuff is to have another kind of print statement (called something like .error) that would not only print strings in the same way as .print, but also make sure Kick Assembler returns a fail errorcode. I guess this would be quite easy to implement?

In effect, this would make it possible to issue user defined errors when some kind of restriction is violated in a function, macro, memoryusage or whatever, and actually halt the assembly process and not just print it on the screen and then go on with loading VICE or sending the code to your C64 via RR-Net or similar.

The .assert statement is there of course, but does not return an error code when failing.

(A similar feature exists in ca65 and DreamAss and...).

Just an idea... ;)

//FTC
2006-11-29 19:40
Slammer

Registered: Feb 2004
Posts: 416
You are right, that would be nice so I just implemented it. The new version 2.18 can be found on http://www.theweb.dk/KickAssembler.htm

2006-11-29 19:48
Frantic

Registered: Mar 2003
Posts: 1648
Ah! hehe.. You rule dude!

Thanks a lot for this! (..and for the bugfix I requested too.) Fast service indeed! ;)

2006-11-30 07:56
Frantic

Registered: Mar 2003
Posts: 1648
Hmm.. Dunno if it's just me that misunderstands something, or if there is something fishy going on.

.print IEEEremainder(7,4)
.print IEEEremainder(8,3)

Prints -1 and -2 respectively, where I would have expected them to produce 1 and 2.

But it seems not to be the case that it always just produces negative versions of the results, becuase:

.print IEEEremainder(10,3)

Prints 1 nicely on the screen.

Uh.. huhu.. ? :)

Just to be clear: I expect this operation to work like modulo. Perhaps that is wrong?

Of course I can do "modulo" with binary-nice values like 8 and so on, but in this case I want to "divide" by 3...
2006-11-30 08:57
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: Hmm.. Dunno if it's just me that misunderstands something, or if there is something fishy going on.

.print IEEEremainder(7,4)
.print IEEEremainder(8,3)

Prints -1 and -2 respectively, where I would have expected them to produce 1 and 2.

But it seems not to be the case that it always just produces negative versions of the results, becuase:

.print IEEEremainder(10,3)

Prints 1 nicely on the screen.

Uh.. huhu.. ? :)

Just to be clear: I expect this operation to work like modulo. Perhaps that is wrong?

Of course I can do "modulo" with binary-nice values like 8 and so on, but in this case I want to "divide" by 3...


Kickass uses java.Math.IEEERemainder for this operation, see http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Math.html#IEE.. for more indepth explanation. I guess is has to do with working with doubles, where you assume integers.

Slammer: May I suggest you add mod or % operator, aswell, which uses java's % operator directly (assuming integers ofcourse). Like:
In cml.kickass.libraries.MathLibrary:

if(name.equals("mod"))
{
   nrOfArgs(2, args, a);
   return new NumberValue((double)(((int)a[0]) % ((int)a[1])));
}


Or whatever... :D

/Andreas
Previous - 1 | ... | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ... | 26 | 27 - 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
MaD ][/Starship
Andy/AEG
Unlock/Padua/Albion
Malmix/Fatzone
Worluk
kbs/Pht/Lxt
XmikeX
Guests online: 112
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 X-Mas Demo 2024  (9.5)
7 Dawnfall V1.1  (9.5)
8 Rainbow Connection  (9.5)
9 Onscreen 5k  (9.5)
10 Morph  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Graphicians
1 Mirage  (9.8)
2 Archmage  (9.7)
3 Pal  (9.6)
4 Carrion  (9.6)
5 Sulevi  (9.6)

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