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-16 11:21
Cruzer

Registered: Dec 2001
Posts: 1048
Oh, hi Slammer, hadn't seen your answer. Looking forward to the new version :)
2007-08-16 11:24
Iapetus/Algarbi/Wood

Registered: Dec 2004
Posts: 71
Slammer don't forget about the label export... =-)
2007-08-16 11:29
tlr

Registered: Sep 2003
Posts: 1790
Basically, yes! :)

I'd very much like the pop in and out of segments concept too though.
You might consider this a named scope of some kind.
For every named scope there should be a different state (pc, and so on). You should be able to end the scope, and then continue on it later by adding an identical scope statement.
Think: namespace in c++ with a twist.

Something like this:
.segment zp {
  .pc = $a0 virtual
  ptr_zp: .word 0
  flag_zp: .byte 0
}
.segment code {
  .pc = $1000
  sei
  ... code here ...
}
.segment bss {
  .pc = $4000 virtual // or even .pc = segment(code).end or similar
  flag: .byte 0
  .align 256
  tab: .fill 256 // should default to .fill 256,0 if it doesn't already
}

.segment zp {
  ptr2_zp: .word 0
}
.segment code {
  ... more code ...
}
.segment bss {
  ... more bss ...
}


maybe even:
.segment code {
  scope: {
    .segment zp {
      ptr_zp: .word 0
    }
  }
}

to allow ptr_zp to be available only in a local scope.

What do you think?
2007-08-16 11:48
tlr

Registered: Sep 2003
Posts: 1790
A cool thing about segments appart from organizing large code is if the possibility to save segments separately is added in some form.
If overlapping segments are allowed (by segment flag), overloading code (and data) parts of a demo can be conveniently represented.
2007-08-16 19:16
Slammer

Registered: Feb 2004
Posts: 416
I'll consider it for future version. However, the features for next version is already done.
2007-08-16 20:21
tlr

Registered: Sep 2003
Posts: 1790
Sounds great!

I'll be happy with "virtual" for now. :)

The usefulness of segments really shows when you start splitting your program into many files (which I often do).
With segments you can add stuff to bss and zp locally within each file. No need to keep that in a special place.
2007-08-17 10:54
tlr

Registered: Sep 2003
Posts: 1790
Quote: No, not at the moment. If you need this feature now, then I suggest you use the print command to print out the labels you need and then copy them from the console into a label-file. Something like:

.print "al C:"+toHexString(myLabel1) + " .myLabel1"
.print "al C:"+toHexString(myLabel2) + " .myLabel2"
etc.


I agree that an export of the labels would be nice, so it might be included in one of the future versions


Not entierly required but is there a way to do something like this?
(i.e can I get the passed symbol name and or type from within a macro (or other construct))
.macro export(sym) {
    .print ".var " + sym.name + "= $" + toHexString(sym)
}

label:
        jmp label
    :export(label)

Currently I'm just passing the name as a string as well.

BTW, redirecting print output to different files would be cool.
'>>' syntax perhaps, or .open and .print <file> <string>?
2007-08-17 13:23
Oswald

Registered: Apr 2002
Posts: 5094
tlr, you are getting over the moon with all that stuff imho. so far I have never needed anything more complex than the good ole tasm. when I will switch over finally to crossing that will be solely for the better editing capabilities, and some sutff like +/-, but definitly not for virtual or real segments, label exporting, and 3d matrices in objects...
2007-08-17 13:49
Scout

Registered: Dec 2002
Posts: 1570
Quote: tlr, you are getting over the moon with all that stuff imho. so far I have never needed anything more complex than the good ole tasm. when I will switch over finally to crossing that will be solely for the better editing capabilities, and some sutff like +/-, but definitly not for virtual or real segments, label exporting, and 3d matrices in objects...

I was thinking the same thing.
Isn't the code going to be bloated with structs, macro's, functions now which make it unreadable?

?too many options error

I think i'll skip using this assembler...
2007-08-17 17:02
tlr

Registered: Sep 2003
Posts: 1790
Oswald, Scout: Sure, but I already use things like the segment feature of dasm extensively in my code and I intend to port much of that to kick assembler.

Besides, Kick Assembler is already about "many options"...
Sure it can be done with pen and paper, but with a small kid at home I need all the timesaving I can get. :)

The main thing I like about kick assembler is to be able to generate stuff like sine tables parametrized directly in the source. No need to generate that externally just to fix some rounding error or thing like that.

That said, I have just started doing one part in it and so far it works out fine and I'll probably be happy with just the forthcoming "virtual".

The other stuff is just suggestions of functionality from other assemblers which I thought might fit.
All of which should ofcourse be optional!
Previous - 1 | ... | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | ... | 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
tlr
Dr.Science/Atlantis
DeMOSic/MS^LSD^ONS
MCM/ONSLAUGHT
Jammer
Guests online: 116
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 X-Mas Demo 2024  (9.5)
7 Dawnfall V1.1  (9.5)
8 Rainbow Connection  (9.5)
9 Onscreen 5k  (9.5)
10 Morph  (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.046 sec.