| |
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 doesnt 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 its 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.... |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
Yes you can. (just like you can have functions of the same name).
But lets end the discussion cos there are other problems involved too. |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
Hi, I have been a bit busy lately, but I finally manages to write som dokumentation. So the new beta-release with .pseudocommands are now posted on http://www.theweb.dk/KickAssembler.htm
The manual shows how to define inc16, mov16 and add16 in just a few lines (shorter than the above posted example), so the rest of a 16 bit instructionset should be straight forward to implement. (Check out page 25-26 at http://www.theweb.dk/KickAssembler_Manual.pdf)
I must admit that when the subject of adressmode detection was brought up I thought it was only a matter of cosmetics to the already existing macros. But now that the pseudocommands are implemented I thinks it's a really cool feature with alot of possibilities which I am gonna use alot :-) |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
"use alot" - as in coding demo parts? :D |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
pseudo commands will be really useful, any coder must know that there are a lot of 3-6 line code segments (16 bit stuff, loops, pointer increment,etc) we use over and over and over again, its way much better to write just one statement instead. |
| |
Jammer
Registered: Nov 2002 Posts: 1336 |
a little problem of a person who cannot code nonetheless sticks his fingers into ass (obviously it's me):
.pc=$0801 "Basic"
:BasicUpstart($1000)
.pc=$1000 "Main"
lda #$00
sta $d020
sta $d021
lupek: jmp lupek
why can't i compile such trivial piece of code? i get 'null' in logfile :| don't laugh at me :P |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
Quote: a little problem of a person who cannot code nonetheless sticks his fingers into ass (obviously it's me):
.pc=$0801 "Basic"
:BasicUpstart($1000)
.pc=$1000 "Main"
lda #$00
sta $d020
sta $d021
lupek: jmp lupek
why can't i compile such trivial piece of code? i get 'null' in logfile :| don't laugh at me :P
Sounds really strange. I tried to copy paste your program into a file and assemble it and it works fine.
You mention something about getting null in a logfile, so I guess you are using Relaunch64? (Otherwise you don't need to use the logfile option). Remember to use the latest Relaunch version, where you can set up KickAss like shown below.
If you don't use Relauch then check the command line you are using for running KickAss. The error is probably to be found there.
|
| |
Jammer
Registered: Nov 2002 Posts: 1336 |
Quote: Sounds really strange. I tried to copy paste your program into a file and assemble it and it works fine.
You mention something about getting null in a logfile, so I guess you are using Relaunch64? (Otherwise you don't need to use the logfile option). Remember to use the latest Relaunch version, where you can set up KickAss like shown below.
If you don't use Relauch then check the command line you are using for running KickAss. The error is probably to be found there.
err, i only copy kickass.jar to program's dir and use
java -jar kickass.jar programtitle.asm -log log.txt
it works fine with all the examples included in the package. unfortunately it doesn't compile this one from me :| |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
There is nothing wrong with your code, and your command line look ok too.
What editor are you using? Perhaps it saves the sourcefile in a format that isn't supported by the lexical analyzer. You can test if that is the case in the following way.
Open one of my sourcefiles in your editer, make a small change (fx, insert a space) and save it againg. Then try to assemble it. If it won't assemble, then your editor have saved it in an unsuppored format.
To fix this you should look for a format option in your save file dialog. If you have saved it in a perfectly normal format and still can't get it to compile then send me the sourcefile and I'll look into it (The email address is in the introduction). Btw. both unix and windows textfiles works fine, and unicode chars like æøå is also ok.
|
| |
Jammer
Registered: Nov 2002 Posts: 1336 |
i use plain notepad then save as filename.asm, maybe that's the reason. however, i was modyfying examples in the notepad too and it worked. |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
I don't see why notepad shouldn't work. Try mailing me the sourcefile an I'll look at it. |
Previous - 1 | ... | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ... | 26 | 27 - Next |