| |
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.... |
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
@tlr: Hehe.. nice to see someone request all those things I found KickAssembler to be lacking when I tried it it a year ago or so. ;)
The assembler has some great potential. The biggest reason for me not to use it was the fact that it was not as good as other assemblers in figuring out expressions involving the *, since the script stuff seemed to be resolved long before the value of * is resolved.
Right? |
| |
Iapetus/Algarbi/Wood
Registered: Dec 2004 Posts: 71 |
Is there problems with files names bigger than 8.3?
I had a big file name and when I tried to run it in vice it would display an error "JAM at $200A", I didn't know how to sort this and asked to some friends about this and couldn't find why it was happening.... today... I renamed my file to just 5 characters plus extension and it worked , no need to recompile just change the file name, now I don't know if this is a problem of Kickassembler, Pucrunch or Vice... 80 |
| |
Mace
Registered: May 2002 Posts: 1799 |
Quote:- Splitted codememoryblocks with jmp instructions to tie them together: This is an interesting idea. Not quite trivial. I guess it requires branch commands (bne, beq, bcc .. ) that can jump to a random address, since your normal branch commands easily could get out of range. It can be done, but I think it will take some time.
Thank you for picking up the idea and thanks JackAsser for the support ;)
The CodeWeave() should have the option to be used OVER existing code/binary/whatever and IN BETWEEN code. What I mean is that it should either weave over a binary (graphics) given a certain mask byte and snap (will get to that later) or it should weave between code blocks that are generated out of the source code.
For binary weaving, like I am doing with graphics, I need to have a recognition byte, over which the code can be inserted. But not on EVERY location where this byte is, I want code. Only if, say, the piece of weaved code is long enough AND if it stays between the margins of a cluster of 8 bytes (for char colour purposes).
So you should be able to set a lower limit of code length and a snap value.
But with code generated from the source, you can't set the byte, so there should be something to tell the compiler that it should put the code in 'virtual empty' memory, if you catch my drift...
Hope this helps :-) |
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
I haven't followed the discussion in detail, but wouldn't a CodeWeave()-function be optimally useful it it could be used both to fill spaces in terms of bytes, but also in terms of cycles.
I mean, if you open the sideborder on every line and want to weave code in the free time in between, rather than filling up a specified number of bytes, then it would be Kick Ass(embler) handy-pandy crazy bikini-nice to be able to weave it in there.. :)
//FTC |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
tlr: I thought abount making constants (const) be visible like labels in the whole scope. I guess that will solve your label definintion problem. toDecString - why not. I thought nobody needed it since you can just write .print "x="+x and get the floating point representation. Resolving a parameters name inside a macro might get a little hard, since variables are dereferenced when parsed as parameters.
Frantic: I don't know your exact problem, but I can tell that I have a new evaluation mechanism on the sketchboard that don't bind a tasks to a specific parse. Insted as much as possible is done in the current parse and if something is missing then another parse is executed. This will eliminate problems occuring because you have defined one memoryblock before another etc. About weaving with cycles. I don't think it will work since the sideborder code will trash the register and statusflags.
Algarbi: I dont think the filename length have anything to do with Kick Assembler. It works on javas String class which has no limitations as far as I am aware of.
Mace: You lost me a bit there. I dont think it's good to make directives so specialized. Its better to keep the simple and flexible. So an approach could be to use a simple loop from the scriptlanguage to search through the graphicsdata to find empty spaces and put them in a list which you can give to the weave directive. |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
Quote:tlr: I thought abount making constants (const) be visible like labels in the whole scope. I guess that will solve your label definintion problem. toDecString - why not. I thought nobody needed it since you can just write .print "x="+x and get the floating point representation. Resolving a parameters name inside a macro might get a little hard, since variables are dereferenced when parsed as parameters.
consts visible as labels is perfect for me. Doesn't break the paradigm either as consts cannot be redefined.
About dec, I just though it looked strange when doing prints like this: "(300.0 bytes, 2.0 blocks)" :)
I thought the parameter stuff might get hard. I'll think up some more cool use cases first and maybe you'll get interested. ;)
|
| |
Mace
Registered: May 2002 Posts: 1799 |
Quote:Its better to keep the simple and flexible. So an approach could be to use a simple loop from the scriptlanguage to search through the graphicsdata to find empty spaces and put them in a list which you can give to the weave directive.
Define 'empty'. In bitmaps it should at least stick to a snap of 8 bytes and it should set to a minimum of space in which code will be weaved, otherwise you end up having a lot of small parts...
But hey, I just gave an idea, you work it out ;) |
| |
Sasq
Registered: Apr 2004 Posts: 156 |
I was just wondering if you plan to support other targets than C64 ? I'm considering using KickAssembler for Atari 2600 programming... (allthough I guess it's pretty easy to just ORG it to the right place and strip the first 2 bytes from the file)
|
| |
Slammer
Registered: Feb 2004 Posts: 416 |
I have never owned an atari, so I don't know which chages are required.
But if all that have to be done is to add a target switch, which outputs to a file without the adressbytes and makes the memory block start at a predefined adress, then sure. But I will have to have someone who can test that it works (and tell me what the predefined adress is). |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
I'm definitely against a cycle based code weaving function, since I just finished coding one in machine code, so I don't want my work to be wasted. :)
|
Previous - 1 | ... | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 - Next |