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....
 
2007-08-21 22:07
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
2007-08-22 05:38
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 :-)
2007-08-22 07:06
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
2007-08-22 17:53
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.
2007-08-22 18:22
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. ;)
2007-08-22 18:35
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 ;)
2007-08-23 12:11
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)
2007-08-23 13:42
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).
2007-08-24 08:55
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. :)
2007-08-28 21:17
Barbarossa

Registered: May 2007
Posts: 31
Hi all,

A year ago today I picked up 6510 coding again after 14 years of absence. I discovered the wonders of crossassembling and started out to work again on a large project I abandoned back then. I found C64Asm and started to work with that. This was before I discoverd more assemblers and before I discovered forums like this one.

C64Asm was perfectly suited for my needs. It did everything I wanted except for the inability to use variables for zeropage locations (which are converted to absolute as you all probably know). I therefore used the absolute numbers in my sources. But managing the sources (especially in a large project when zeropage locations change frequently) was a pain in the ass.

I then decided after a year (I waited this long, since I saw no other limitations of C64asm and was reluctant to change) to switch to another assembler. After studying CA65 I decided to go with KickAssembler (I read some good reviews here).

I started translated a 1500 line source (which was a lot of work due to the very different syntax) and I finally got it to work.

Some questions remain:

1. When I use :BasicUpstart($7700) it compiles as 10 SYS 30464.0
I don't really need this function and it works like this, but I was wondering why is there a float and not an integer?

2. With C64Asm I could dissamble my old binaries .prg files so I didn't have to start from scratch again. Any chance this will become a feature in KickAssembler? Or should I dissamble with C64Asm and then translate the source to KickAssembler (sigh)?

3. What I really miss in KickAssembler is dissambly output. In C64Asm you could generate a reportfile, with the dissambly and the source in one file. This is, in my opinion, crucial for debugging. Is there a way to do this?

Thanks in advance for your answers and kudos to your great forum.

John
Previous - 1 | ... | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 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
Freeze/Blazon
Monte Carlos/Cascade
Holy Moses/Role
𝘁𝗡𝗚/FairLight
Guests online: 103
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 Tim  (9.7)

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