Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Coinoperator ! (Registered 2024-06-17) 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 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: 1634
...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: 1634
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: 1634
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: 1634
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: 1995
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
2006-11-30 18:19
Slammer

Registered: Feb 2004
Posts: 416
Damn I got Hacked :-)

Well you are right, Kick Assembler uses the java math library and IEEERemainer works correct but a bit odd. You can however easily define your own modulo function like this:

.function mod(a,b) .return a-floor(a/b)*b

and used it like this:

.var x = mod(8,3)


I guess I will include a % operator in the next release since it's used rather often.

Btw. If you wanna hack the assembler further, it is possible to insert a the above function in the 'standard library'. In the kickass.jar, find the file called autoinclude.asm and insert '.function mod(a,b) .return a-floor(a/b)*b', then you can use the mod function everywhere in you programs.. .. Or you can just wait for the next release.
Previous - 1 | ... | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ... | 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
Sabbi/Hokuto Force
Didi/Laxity
Smasher/F4CG
t0m3000/HF^BOOM!^IBX
xAD/nIGHTFALL
Digger/Elysium
Hoogo/Padua
Andy/AEG
Krill/Plush
Guests online: 125
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.7)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Comaland 100%  (9.6)
9 Wonderland XIV  (9.6)
10 Aliens in Wonderland  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Dawnfall V1.1  (9.5)
8 Daah, Those Acid Pil..  (9.5)
9 Birth of a Flower  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 SHAPE  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Stinsen  (9.7)
3 Jeroen Tel  (9.6)
4 Linus  (9.6)
5 psych858o  (9.6)

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