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-09-14 17:44
chatGPZ

Registered: Dec 2001
Posts: 11154
he, i'm disappointed. this can be done perfectly fine in ca65 =P
2006-09-14 17:59
Slammer

Registered: Feb 2004
Posts: 416
ok, that must mean that they have found a good notation. I will check it out.. Anything special I should look for? Or better, could you write a little example of how you would do in ca65?
2006-09-14 18:26
Slammer

Registered: Feb 2004
Posts: 416
I just chekked out the manual for ca65 and I dont think they have the solution to our problems. In the example they give (ldax) they determine the mode using a stringcompare telling if the fist char is a '#' - So the user have to do the detecting by himself.

Secondly they limit themselves to one argument, so they havnt solved the notation issue. How should add16 abs, absy look like? :add a,b,y (<- is y now an argument or telling that its adressmode abs,y?). In the example they only consider immediate and absolute.

Finally, they don't eliminate the use of an if sentence for each supported adressing mode.

If I have missed something then please show me.

2006-09-14 19:48
Monte Carlos

Registered: Jun 2004
Posts: 351
Talk to Ullrich (Author: cc65), as you both did very good assemblers. He appreciates feedback.
Perhaps both of you can get some ideas from the other.
That's what i would do ...

Monte
2006-09-14 19:56
Oswald

Registered: Apr 2002
Posts: 5032
I dont know anything about assembler coding, but when you resolve adresses you have to decide wether its absolute, indexed, immediate, etc. couldnt you add a simple new function like adressmode(argument) ?

if adressmode(arg1) = "absolute" then goto 16bit
if adressmode(arg1) = "immediate" then goto fastie

etc...
2006-09-14 21:32
Slammer

Registered: Feb 2004
Posts: 416
I guess I didn't formulate the problem clear :-)
Comma is used in some adressing modes (like ($32),y) so we cant use this to seperate arguments. What should be used instead? Well, I just tried some different possibilities and the best I can come up with is semicolon:

:add16 point ; #2
:add16 point ; point2
:add16 point1,y ; ($32),y

Looks a bit odd, but it will do the trick..

Oswald: The addressmode function is definetely possibility to mode-detection.
2006-09-15 00:55
Monte Carlos

Registered: Jun 2004
Posts: 351
Perhaps seperated lda16 sta16 will do.
This would be something intermediate.
2006-09-15 08:35
chatGPZ

Registered: Dec 2001
Posts: 11154
@slammer: ca65 philosophy is to not implement a certain feature if the problem can be solved with existing features. (because more features means more bugs) so there seem to be few features at first sight, but on a second look they are usually very powerful. (the argument parsing stuff is one of them)

that said, long ago i've implemented the full huc6280 instruction set in macros (and even longer ago gbz80), so parsing whatever you need is definetly possible (can't paste any examples though since i have lost these files :/)
2006-09-15 09:46
Oswald

Registered: Apr 2002
Posts: 5032
thats not always the best policy, check brainfuck for a nice example.
2006-09-15 09:57
chatGPZ

Registered: Dec 2001
Posts: 11154
well i prefer having a few features that work 100% as expected than thousends of seemingly nice but halfassed and bugging ones :) just tried too many crossassemblers before i guess, and most of them go into the second cathegory.
Previous - 1 | ... | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | ... | 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
Didi/Laxity
MagerValp/G★P
Nordischsound/Hokuto..
zscs
Hobbit/Laser Inc.
MWR/Visdom
void256
X-Raffi/X-Rated
katon/Lepsi De
Guests online: 73
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 Uncensored  (9.6)
7 Comaland 100%  (9.6)
8 No Bounds  (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 Offence  (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.052 sec.