| |
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 doesnt 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 its 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.... |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
the edit-test cycle will be faster. |
| |
MagerValp
Registered: Dec 2001 Posts: 1078 |
Codenet is even faster.
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
Quote:the edit-test cycle will be faster.
i pretty much doubt that, if anything it will be just as fast, but still be more hazzle. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
well 1600% speed compiling must be on par with cross assemblers, right ? secondly vice doesnt needs to be started, no kernal memory check, etc. and I can have my fave cartridge instead of sticking to the built in vice one.
codenet = you have to switch between 2 monitors and keyboards |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
vice has a cartridge built in? wtf! o_O |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
can u add a cartridge on the commandline ? |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
-ramcart
+ramcart
-ramcartimage <name>
-ramcartsize <size in KB>
-cartreset
+cartreset
-cartcrt <name>
-cart8 <name>
-cart16 <name>
-cartar <name>
-cartrr <name>
-cartide <name>
-cartap <name>
-cartepyx <name>
-cartss4 <name>
-cartss5 <name>
-cartieee488 <name>
-cartwestermann <name>
-cartstb <name>
-cartexpert
that enough options for you ? :o) |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
ok u win & lets stop spamming this topic :) |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
Hi Guys, I just implemented a pseudocommands which basically are macros that takes Command arguments (#20, ($10),y, ($1000), etc.) as arguments. You can use getType() and getValue() on the command arguments and create new ones with the CmdArgument function. Here a quick example of an add16 command:
.pseudocommand add16 arg1;arg2;arg3 {
// Use first argument as target if none is given
.if (arg3.getType()==AT_NONE)
.eval arg3=arg1
// Arg1
.var arg1a = CmdArgument(arg1.getType(), arg1.getValue())
.var arg1b = CmdArgument(arg1.getType(), arg1.getValue()+1)
// Arg2
.if (arg2.getType()==AT_IMMEDIATE) {
.var arg2a = CmdArgument(arg2.getType(), <arg2.getValue())
.var arg2b = CmdArgument(arg2.getType(), >arg2.getValue())
} else {
.var arg2a = CmdArgument(arg2.getType(), arg2.getValue())
.var arg2b = CmdArgument(arg2.getType(), arg2.getValue()+1)
}
// Arg3 (Destination)
.var arg3a = CmdArgument(arg3.getType(), arg3.getValue())
.var arg3b = CmdArgument(arg3.getType(), arg3.getValue()+1)
clc
lda arg1a
adc arg2a
sta arg3a
lda arg1b
adc arg2b
sta arg3b
}
And you use it like this:
:add16 point1 ; #$1234 // p1=p1+$1234
nop
:add16 point1 ; point2 // p1=p1+p2
nop
:add16 point1 ; point2 ; point3 // p3=p1+p2
nop
:add16 pointTable,x ; pointTable,y ; point3 // p3 = pointTable[x] + pointTable[y]
Which will generate code like this:
.C:1000 18 CLC
.C:1001 AD 00 30 LDA $3000
.C:1004 69 34 ADC #$34
.C:1006 8D 00 30 STA $3000
.C:1009 AD 01 30 LDA $3001
.C:100c 69 12 ADC #$12
.C:100e 8D 01 30 STA $3001
.C:1011 EA NOP
.C:1012 18 CLC
.C:1013 AD 00 30 LDA $3000
.C:1016 6D 02 30 ADC $3002
.C:1019 8D 00 30 STA $3000
.C:101c AD 01 30 LDA $3001
.C:101f 6D 03 30 ADC $3003
.C:1022 8D 01 30 STA $3001
.C:1025 EA NOP
.C:1026 18 CLC
.C:1027 AD 00 30 LDA $3000
.C:102a 6D 02 30 ADC $3002
.C:102d 8D 04 30 STA $3004
.C:1030 AD 01 30 LDA $3001
.C:1033 6D 03 30 ADC $3003
.C:1036 8D 05 30 STA $3005
.C:1039 EA NOP
.C:103a 18 CLC
.C:103b BD 00 20 LDA $2000,X
.C:103e 79 00 20 ADC $2000,Y
.C:1041 8D 04 30 STA $3004
.C:1044 BD 01 20 LDA $2001,X
.C:1047 79 01 20 ADC $2001,Y
.C:104a 8D 05 30 STA $3005
Any comments / suggestions to this? Please comment now because its less likely to change when it has been released (People expect syntax etc. to be backward compatible)
Otherwise I'll make a new beta release as soon as I have tested it a bit more and written some dokumentation.
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
i would prefer if macros wouldnt have to start with a colon... (then again, i havent checked kickass at all yet =P) |
Previous - 1 | ... | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | ... | 26 | 27 - Next |