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-28 21:57
Slammer

Registered: Feb 2004
Posts: 416


1. BasicUpstart is just a macro which is autoincluded when you load kick assembler. It looks like this:
.macro BasicUpstart(address) {
	.byte <upstartEnd, >upstartEnd,10,0,$9e
	.text ""+address
	.byte 0,0,0		 
upstartEnd: 
}


Since we do not yet have a toDecimalString function I just use the normal toString function to write the string of the adress. It will probably be included in the next version since tlr needs it.
NB. I just reverse engineered the basic code. If somebody have better knowlegde of the basic format then tell me.


2. Perhaps it will, but it will not be the first project i will do.

3. Sounds interesting, I'll check it out..


Btw. If any of you need the toDecString now you can just define it in the scriptlanguage like this:

// The function 
.function toDecString(value) {
	.var strValue = ""+value
	.for (var i=0;i<strValue.size(); i++) 
		.if (strValue.charAt(i)==".")	.return strValue.substring(0,i)
	.return strValue
}


// Some examples
.print "decString1="+toDecString(15.12324)
.print "decString1="+toDecString(11)
.print "decString1="+toDecString(-3.9)


// Basic upstart macro with decString
.macro BasicUpstart2(address) {
	.byte <upstartEnd, >upstartEnd,10,0,$9e
	.text ""+toDecString(address)
	.byte 0,0,0		 
upstartEnd: 
}

2007-08-29 08:25
tlr

Registered: Sep 2003
Posts: 1790
Quote:
1. BasicUpstart is just a macro which is autoincluded when you load kick assembler. It looks like this:

.macro BasicUpstart(address) {
.byte <upstartEnd, >upstartEnd,10,0,$9e
.text ""+address
.byte 0,0,0
upstartEnd:
}

Your end pointer is wrong!

Do this:
.macro BasicUpstart(address) {
	.word upstartEnd  // link address
        .word 10   // line num
        .byte $9e  // sys
	.text ""+address
	.byte 0
upstartEnd:
        .word 0  // empty link signals the end of the program
}

In reality only the MSB of the last link address has to be $00, so upstartEnd can be the start of the program if certain instructions are used. e.g LDA #$00 ($A9 $00), etc...
2007-08-29 09:23
Barbarossa

Registered: May 2007
Posts: 31
Slammer,

If you need some example output from C64Asm from my source, let me know. It will give you an idea to work with.

How I normally debug on my 2-monitor system (yes I am that spoiled :) ) is to run the C64 emulator in single step trace mode on the left screen, and have the output text file on the right screen.

Then during debugging I would have al the variables, all the comments and everyting from the source available including of course real address info.
2007-08-29 13:46
Slammer

Registered: Feb 2004
Posts: 416
Tlr: Thanks

Barbarossa: That would be nice, I'll pm you an email address to send it to.
2007-09-07 23:02
Jammer

Registered: Nov 2002
Posts: 1336
help! i got something like this:

;--------------------------------------------------
;--------------------------------------------------
; Kick Assembler v2.15 - (C)2006 Mads Nielsen
;--------------------------------------------------
;--------------------------------------------------
parsing
pass 0
pass 1
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.HashMap.<init>(Unknown Source)
at cml.kickass.state.StdScope.<init>(StdScope.java:20)
at cml.kickass.state.ForScope.addIteration(ForScope.java:34)
at cml.kickass.directives.ForDirective.doLooping(ForDirective.java:83)
at cml.kickass.directives.ForDirective.parse1(ForDirective.java:36)
at cml.kickass.AssemblerToolbox.runParse1(AssemblerToolbox.java:54)
at cml.kickass.directives.BlockDirective.parse1(BlockDirective.java:30)
at cml.kickass.directives.ForDirective.doLooping(ForDirective.java:90)
at cml.kickass.directives.ForDirective.parse1(ForDirective.java:36)
at cml.kickass.AssemblerToolbox.runParse1(AssemblerToolbox.java:54)
at cml.kickass.directives.BlockDirective.parse1(BlockDirective.java:30)
at cml.kickass.directives.ForDirective.doLooping(ForDirective.java:90)
at cml.kickass.directives.ForDirective.parse1(ForDirective.java:36)
at cml.kickass.AssemblerToolbox.runParse1(AssemblerToolbox.java:54)
at cml.kickass.KickAssembler.main(KickAssembler.java:124)

what could have made it happen and how to solve it? my source is barely 6700 bytes long so i have no clue :/


edit: consider it solved ;) it was just typo in on of the loops filling memory with bytes (x=0; x<blahblah; but here incorrect z++)
2007-09-08 11:59
Slammer

Registered: Feb 2004
Posts: 416
Good to hear you solved it (Endless loops - a classic)

It is possible to make programs that are so large that the default java heapspace is too small. You can raise it with the argument Xms (initial heapspace) and Xmx (maximum heapsize). Eg:

java -Xms800m -Xmx1000m -jar KickAss.jar sourcefile.asm

It don't happend very often.

2007-09-23 20:57
Slammer

Registered: Feb 2004
Posts: 416
A small update(v2.25) is now on the website with a couple of the things discussed here.
2007-09-24 07:47
tlr

Registered: Sep 2003
Posts: 1790
Thanks! Will try.
2007-10-31 20:43
The Shadow

Registered: Oct 2007
Posts: 304
Slammer,

thank you for the info to the Kick Assembler.
2007-10-31 22:54
Slammer

Registered: Feb 2004
Posts: 416
No problem. I'm happy to help
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
iAN CooG/HVSC
Youth
MCM/ONSLAUGHT
TheRyk/MYD!
Laddh
Holy Moses/Role
Smasher/F4CG
Acidchild/Padua
zscs
Mike
rambo/Therapy/ Resou..
LKP/CFN
𝘁𝗡𝗚/FairLight
grasstust/Hoaxers
Steve/Laser, Zenith,..
Guests online: 128
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.047 sec.