| |
Slammer
Registered: Feb 2004 Posts: 416 |
Kick Assembler Thread 2
The previous thread took a little long to load, so this is a new fresh one.. |
|
... 592 posts hidden. Click here to view all posts.... |
| |
Oswald
Registered: Apr 2002 Posts: 5078 |
fancymansy way in graham ass (took 5 minutes):
*= $1000
x = $f0
y = $f1
speedcode = $4000
labelslo = $c000
labelshi = $c028
sei
jsr makespeed
ldx column
lda labelslo,x
sta self+1
lda labelshi,x
sta self+2
self jsr speedcode
jmp *
makespeed
lda #0
sta x
sta y
lda #<speedcode
sta $fc
lda #>speedcode
sta $fd
loop2
ldx x
lda $fc
sta labelslo,x
lda $fd
sta labelshi,x
loop1
lda y
asl
tay
lda mul40,y
clc
adc x
sta $fa
lda mul40+1,y
adc #>$d800
sta $fb
ldy #$00 ;lda $d801
lda c0
sta ($fc),y
iny
lda $fa
clc
adc #$01
sta ($fc),y
iny
lda $fb
adc #$00
sta ($fc),y
iny
lda c1 ;sta $d800
sta ($fc),y
iny
lda $fa
sta ($fc),y
iny
lda $fb
sta ($fc),y
iny
tya
clc
adc $fc
sta $fc
bcc *+4
inc $fd
inc y
lda y
cmp #25
bne loop1
ldy #$00
lda #$60
sta ($fc),y ; rts
inc $fc
bne *+4
inc $fd
lda #0
sta y
inc x
lda x
cmp #40
bne loop2
rts
c0 lda $d800
c1 sta $d800
mul40 .word 0,40,80,120,160,200,240,280,320,360,400,440,480,520,560,600,640,680,720,760,800, 840,880,920,960 |
| |
Pantaloon
Registered: Aug 2003 Posts: 124 |
.pc = * "Collor Puller Routine" CollPull:
.var l = List()
.for (y=0;y<25;y++)
{
.eval l = l.add(*)
.for (x=0;x<39;x++)
{
lda $d801+x+[y*40]
sta $d800+x+[y*40]
}
rts
}
lotable:
.fill l.size(), <l.get(i)
hitable:
.fill l.size(), >l.get(i)
and use like this
// y contains the row
ldy #$00
lda lotable,y
sta jsra+1
lda hitable,y
sta jsra+2
jsra: jsr $0000
or from script
jsr l.get(0)
|
| |
Pantaloon
Registered: Aug 2003 Posts: 124 |
Slammer:
Would it be possible to add a new script command in kickasm, something like this:
.var data = .system "myprog.exe " + cmdlineString
so it's possible to call an external program while kickasm is doing the scriptjob ? |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
Yep, absolutely. One of the long term goals of creating v3 was making an architecture that made things like this possible. However, im a bit busy at the moment so don't expect it soon.
|
| |
TWW
Registered: Jul 2009 Posts: 543 |
Oswald/Pantalon:
I was thinking more in the lines of modifications of labels inside scopes / loops. Not Self Modifying speedcode or lookup-tables.
So to rephrase;
can I do something like:
.for (y=0;y<5;y++) {
.label mylabel+toIntString(y)
//Do something
}
and get the assembler to generate 5 labels (mylabel1 to mylabel 5) for my 5 Do something routines? |
| |
Pantaloon
Registered: Aug 2003 Posts: 124 |
well, thats now how kickassembler works, just store the programCounter in a list and use it that way, its the same as working with labels just a different syntax really. instead of doing something mylabel you do something mylabels(labelindex). |
| |
TWW
Registered: Jul 2009 Posts: 543 |
Alright I see now.
Thanx.
-TWW |
| |
Pantaloon
Registered: Aug 2003 Posts: 124 |
Slammer:
can you add something like .ifdefined(myvar) , it would be very useful to check if a variable has been declared when using alot of small source files.
and i found a bug, if you use the .import directive inside an if statement it doesnt compile.
ie.
.if (LINK == true)
{
.import source "MySourceFile.s"
}
-P |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
Some kind of ifdefined is already on the todo-list - I'll prioritize it a bit higher.
Right now the development is on a hold i'm afraid. I have to replace my old development computer.
|
| |
Pantaloon
Registered: Aug 2003 Posts: 124 |
nice!, hope you get a new computer soon :) |
Previous - 1 | ... | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | ... | 61 - Next |