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-18 08:15
tlr

Registered: Sep 2003
Posts: 1790
Maybe it's not obvious for everyone that you can program basically the normal way if you like, hence the critisism?

e.g this is still a valid program in kick assembler, no need for any frills if you don't need it.
    .pc = $1000
    sei
loop:
    inc $d020
    jmp loop

I think kick assembler is a very fresh and flexible way of doing coding.
Just pick and choose the features you like! :)

Slammer, you did a very good job on this!
2007-08-18 14:13
Iapetus/Algarbi/Wood

Registered: Dec 2004
Posts: 71
Keep up the good job Slammer!
2007-08-19 15:18
Slammer

Registered: Feb 2004
Posts: 416
Thanks guys.

I have just uploaded the new version so now you can user virtual memory blocks.
2007-08-19 17:21
tlr

Registered: Sep 2003
Posts: 1790
Quote: Thanks guys.

I have just uploaded the new version so now you can user virtual memory blocks.


Super, works like a charm! :)

I have another question:
Is it possible to reference the pc/define labels that is not equal to the current pc (like in Tasm/dasm or others)

e.g:
    lda #$00
hi_addr = * + 2
    sta $1000

or
sintab:
    .fill 256, blahblah...
costab = sintab + 64

I tried with .var or .const, but that won't allow forward references which is a bit awkward.
Maybe I missed something in the docs?

EDIT: well, I missed the pc stuff in the docs, it's actually precisely '*'. :)
2007-08-20 10:31
Mace

Registered: May 2002
Posts: 1799
Just got a weird idea the other day, that might not be usefull in a lot of occasions, but it would be nice if it existed... something to code on a rainy Sunday, so to speak ;)

In a program I'm working on, I want to use as little a memory footprint as possible. So I put code in the bitmap, where there are no visible graphics and make sure the colour codes are black.
However, weaving the monolithic code through the available space is a rather awkward job.

Wouldn't it be nice to have some way to 'reserve' certain spaces of the memory and drop data/code in the gaps between it, automatically splitting it and perhaps add JMPs to link the parts?

Just a thought... and I found it very much in the idea of Kick Assembler :)
2007-08-20 10:48
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: Just got a weird idea the other day, that might not be usefull in a lot of occasions, but it would be nice if it existed... something to code on a rainy Sunday, so to speak ;)

In a program I'm working on, I want to use as little a memory footprint as possible. So I put code in the bitmap, where there are no visible graphics and make sure the colour codes are black.
However, weaving the monolithic code through the available space is a rather awkward job.

Wouldn't it be nice to have some way to 'reserve' certain spaces of the memory and drop data/code in the gaps between it, automatically splitting it and perhaps add JMPs to link the parts?

Just a thought... and I found it very much in the idea of Kick Assembler :)


I want this feature as well in ca65. Although the cases where it's useful are rather limited. But for example interleave speed code that changes the graphics in an FPP-based effect would be a school book case. =)
2007-08-20 10:57
Frantic

Registered: Mar 2003
Posts: 1648
In ca65 it would be useful in the following case too:

You want a segment with code from 0800 or so to somewhere like $8000, however, you also want a segment "inserted" from $1000 to $xxxx containing a tune. It would be nice if the linker would be able to figure out by itself where to split the contents of the codesegment WITHOUT explicitly having to supply the absolute size of the tune and divide the code segment in two and move code from codesegment_part1 to codesegment_part2 in case the first one overflows or so.
2007-08-21 19:30
Slammer

Registered: Feb 2004
Posts: 416
I finally got at litte time to check up on the latest ideas.

- Symbol exports for vice : Can't take long to implement so I guess it will be in the next release. Scoped variables might collide, but I guess we can find a solution.

- Segments / namespaces : The more I think about it, the more I think it's a great idea. Its quite simple, but It will solve alot of problems. Do you prefer brackets {}?. There are both pros and cons and I havn't really made up my mind on heavily indented assembler code. however I don't fancy notations like .namespace_start, .namespace_end.

- Export of symbols (for multi part demos): That is allready on my todolist. Are there any preferences? Should we export all symbols or only ones given by export commands? (If it's combined with a namespace the symbols won't collide)

- 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.
2007-08-21 20:55
tlr

Registered: Sep 2003
Posts: 1790
Quote:
- Segments / namespaces : The more I think about it, the more I think it's a great idea. Its quite simple, but It will solve alot of problems. Do you prefer brackets {}?. There are both pros and cons and I havn't really made up my mind on heavily indented assembler code. however I don't fancy notations like .namespace_start, .namespace_end.

The indentation is a concern I haven't resolved either, but I think I still prefer brackets.

Quote:
- Export of symbols (for multi part demos): That is allready on my todolist. Are there any preferences? Should we export all symbols or only ones given by export commands? (If it's combined with a namespace the symbols won't collide)

Doesn't matter to much because unless it produces something that can be directly used when assembling another file it still has to be parsed and processed.
All symbols to a file will help me achieve that, others may have higher demands. :)

The process could be streamlined with .print to a custom file + macros though.
A structured export would help if you decide to implement some object-format (as in .o) later.

I'd like all of the above, but if I had to pick one it would be just a symbol table dump.


A couple of others:
- how about defining labels from an expression like in my post above? (i.e allowing forward references to a calculated address)

- toDecString() (so you can print integers)

- some way to resolve a passed parameters "name" when inside a macro/function. I guess it will be kind of a hack as I assume you do call by value. It would be quite useful though.
2007-08-21 21:24
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?
Previous - 1 | ... | 16 | 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
Mike
𝘁𝗡𝗚/FairLight
Steve/Laser, Zenith,..
TheRyk/MYD!
LKP/CFN
Paulko64
zscs
Deev/Onslaught
kbs/Pht/Lxt
Aomeba/Artline Desig..
Lazycow
t0m3000/hf^boom!^ibx
Case/Padua
Guests online: 102
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 Logo Graphicians
1 t0m3000  (10)
2 Sander  (9.8)
3 Mermaid  (9.5)
4 Facet  (9.4)
5 Shine  (9.4)

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