| |
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 |
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. |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
I just uploaded a new release including the mod command.
http://www.theweb.dk/KickAssembler.htm
At first I made the % operator, but found out that it collides with the notation for binary numbers.. |
| |
Mace
Registered: May 2002 Posts: 1799 |
Magnificent concept!
In fact, this idea once crossed my mind when I was coding PHP for a webpage. Since it is possible to combine JavaScript, HTML and PHP all in one page, the idea of combining 'languages' for the C64 came to mind.
The exact thought I had, was: "woah, wouldn't it be nice to be able to add script to assembly code for C64?!".
Never said it out loud and I'm not capable of programming an assembler either, so you can guess my interest :-)
I started reading the manual. When I'm done, you'll receive an email with all the glitches and errors I found.
Also, I was wondering how it would be possible to distinguish between ASCII and screencodes in .text. |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
Thanks, Always nice with some feedback.
I'm not sure I understand what you mean by screen codes. The .text directives put out the chars corrosponding to the letters that would come out with the lower/upper case standard charset (Shifted mode). If you work in unshifted mode remember to write your text with small letters.
|
| |
tlr
Registered: Sep 2003 Posts: 1790 |
@slammer: Screencode = what you poke into the screen memory to get the corresponding char.
@ = 0, A = 1, B = 2, etc... |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
Ok, then I guess my previos post answered the question: The .text directive always outputs shifted-mode screen codes. Is there a need for a ascii or unshifted-mode option? |
| |
Mace
Registered: May 2002 Posts: 1799 |
(former post deleted)
Ok, so writing in small chars would give 'a' as a $01 in the memory?
Then that's sorted, then :) |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
Hi guys,
My internetprovider's mailserver is highly unreliable these days, so if you want to be sure that your Kick Assembler feedback, bugreports etc. reach me then use private messaging here on CSDB..
|
| |
LordNikon
Registered: Dec 2001 Posts: 42 |
Is there a way to override warnings? ...
I try to import a huge binary and i only want to change some bytes in it with the following source code. When i compile that stuff the assembler gives me a warning and doesn't produce a prg. |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
Hi, can't see your source code so I dont know precisely what you are doing.
However, I guess you get a warning because you have reached an address higher than $10000. If you only want to use some of the binary file, then use the LoadBinary command to load it into a variable and the .fill command to dump the selected part to memory:
// Use the first $2000 bytes of a file
.var file = LoadBinary("myFile")
.fill $2000, file.get(i)
Edit: On second thought, perhaps thats not what you are trying to do. Is it that you want to have overlapping memory segments?
|
Previous - 1 | ... | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ... | 26 | 27 - Next |