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....
 
2006-09-03 08:25
Slammer

Registered: Feb 2004
Posts: 416
Matthias: Hey Matthias :-) Nice to hear from you! Please tell me if you release anything made with Kick Assembler :-)
2006-09-03 09:44
Slammer

Registered: Feb 2004
Posts: 416
I just uploaded a new bete release that supports DTV commands to the homepage.
2006-09-03 11:08
Style

Registered: Jun 2004
Posts: 498
when I have the energy to learn new assembler syntax kickass will be my weapon of choice. The scripting rules.
2006-09-11 06:31
Style

Registered: Jun 2004
Posts: 498
OK, Im using kickass now - but I have a problem.

Sometimes it refuses to resolve symbols!

I cant quite get the logic of when and how.....

Ill post some simplified code soon
2006-09-11 07:46
Style

Registered: Jun 2004
Posts: 498
OK, I managed to work around it

Basically if you have a macro with parameters and pass nulls, and in some way operate on those parameters, it throws this error.

How are nulls handled?
2006-09-11 18:09
Slammer

Registered: Feb 2004
Posts: 416
I haven’t seen your code yet, but as written on the Kick Assembler page, I guess you use an .if or some other statements which requires to run in pass 2 together with labels, which are resolved at pass 2 and available after they are resolved + in pass 3.

The cause of this is quite an interesting problem and I guess that no macro assembler can solve it 100% smooth. Why? Well check the following example:
.pc = $1000
.if (trickyLabel<$2000) {
.fill $2000,0	
}
trickyLabel: 

The program makes no sense because you cannot decide whether the fill command is going to be executed or not. If it is executed then trickyLabel=$3000 so it should not have been executed. If it wasn’t executed then trickyLabel=$1000 so then it should have been executed.

Therefore, conditional commands (like .if) needs their arguments to be resolved before executing in pass 2. However, others do not. Kick Assemblers approach to this is to try to assemble as far as possible, and if a problem arises then throw and exception where the problem first arose. So unresolved labels (= what you call null values) generates a special value type called UnresolvedValue which you won’t notice in most contexts. For example the following will work:
.var x = labelResolveLater		// Assignments works fine	
.var y = min(x + 400, pow(x,3))  	// Functions etc. work fine
 sta $1000+y			// Asm commands works fine 
labelResolvedLater:

However this will not work:
.var x = labelResolveLater		// Assignments works fine	
.var y = min(x + 400, pow(x,3))  	// Functions etc. work fine
 .if (y<100) sta $1000+y		// .ifs won’t work
labelResolvedLater:

In you example, Kick Assembler has executed your macro and come to a statement that needed its arguments to be resolved, and then thrown an exception where you used it the first time (=the macro call). So why doesn’t Kick Assembler give an error at the ‘.if’ statement? Actually, it did until v2.10, but that was quite confusing in other situations. I guess I’ll try to make a better error message so it’s easier to understand this.
2006-09-11 19:54
Danzig

Registered: Jun 2002
Posts: 430
I encountered a problem with local variables in macros. so i checked it with the precalculated vector-example!
and it gave me the same error!

scenario:
In the example there is ONE object and the macro is called ONCE => works!

If I copy the Object and create a second one (changing the coords :) ) and call the macro a second time KickAssembler gives an error (Array index out of bounds:8 ) <= No Smiley ;)

It seems the local variable is not set properly!?

Copying the Macro and renaming it (like: .macro PrecalcObject2(object, animLength, nrOfXrot, nrOfYrot, nrOfZrot) fixes the problem and works...

But copying the Macro dozens of times for dozens of objects makes no sense at all :D

@Mads: Any suggestions?
2006-09-11 19:57
Slammer

Registered: Feb 2004
Posts: 416
Danzig: Thats a bug. I actuallly found it this weekend and released a correction for this yesterday, so my suggestion is to download the newest version :-)
2006-09-12 05:51
Style

Registered: Jun 2004
Posts: 498
Thanks slammer, indeed I was passing a label that hadnt been resolved yet to a macro with conditional assembly that would affect the value of the unresolved label :)

Anyway, Ive changed my libraries so I no longer rely on that sort of thing.

Thanks again for kickass - it rules.
2006-09-12 08:55
Oswald

Registered: Apr 2002
Posts: 5034
can stand not to poke you guys, although using scripting and macros makes things incredibly easy, if you code a demo you will have to code a speedcode generator at the end of the day, otherwise you will face the problem of loading the huge speedcode...
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | ... | 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
grasstust/Hoaxers
Guests online: 63
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Aliens in Wonderland  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Dawnfall V1.1  (9.5)
8 Birth of a Flower  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Offence  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.7)
2 Veto  (9.6)
3 Facet  (9.6)
4 The Sarge  (9.6)
5 Carrion  (9.5)

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