Skip to content
Permalink
Browse files

Addes asm

  • Loading branch information...
Jonas Olsson
Jonas Olsson committed Jan 15, 2019
1 parent 299b529 commit 90f24a005b015b914b6208665cc311111eef3ad6
Showing with 73 additions and 72 deletions.
  1. +1 −0 .gitignore
  2. +11 −11 Asm/absolute_value.s
  3. +5 −5 Asm/copper_macro.s
  4. +56 −56 Asm/jump_table.s
@@ -0,0 +1 @@
.DS_Store
@@ -1,12 +1,12 @@
; returns the absolute value of input
;
; input: d0.l = in value
; output: d0.l = absolute value of in value
;
; neg.l = 6 cycles
; branch = 10 cycles
; no branch = 8 cycles

.is_minus
neg.l d0
; returns the absolute value of input
;
; input: d0.l = in value
; output: d0.l = absolute value of in value
;
; neg.l = 6 cycles
; branch = 10 cycles
; no branch = 8 cycles

.is_minus
neg.l d0
bmi .is_minus
@@ -1,6 +1,6 @@
wait set $2c07
rept 256
dc.w wait, $fffe
dc.w $01fe, $0000
wait set (wait+$100)&$ffff
wait set $2c07
rept 256
dc.w wait, $fffe
dc.w $01fe, $0000
wait set (wait+$100)&$ffff
endr
@@ -1,57 +1,57 @@
draw_to_screen:
move.l #0, d0
lea.l jumptable, a0
lea.l screen, a5

move.l (a0,d0.l), a1
jsr (a1)

add.l #40*2, a5
add.l #4, d0

move.l (a0,d0.l), a1
jsr (a1)

add.l #40*2, a5
add.l #4, d0

move.l (a0,d0.l), a1
jsr (a1)

rts

init_jumptable:
lea.l jumptable, a0

lea.l draw_one, a1
move.l a1, (a0)

lea.l draw_two, a1
move.l a1, 4(a0)

lea.l draw_three, a1
move.l a1, 8(a0)

rts

draw_one:
move.w #$ffff, (a5)
move.w #$ffff, 2(a5)
rts

draw_two:
move.w #$ff00, (a5)
move.w #$00ff, 2(a5)
rts

draw_three:
move.w #$8000, (a5)
move.w #$0001, 2(a5)
rts

jumptable:
dc.l $00000000
dc.l $00000000
dc.l $00000000
dc.l $00000000
draw_to_screen:
move.l #0, d0
lea.l jumptable, a0
lea.l screen, a5

move.l (a0,d0.l), a1
jsr (a1)

add.l #40*2, a5
add.l #4, d0

move.l (a0,d0.l), a1
jsr (a1)

add.l #40*2, a5
add.l #4, d0

move.l (a0,d0.l), a1
jsr (a1)

rts

init_jumptable:
lea.l jumptable, a0

lea.l draw_one, a1
move.l a1, (a0)

lea.l draw_two, a1
move.l a1, 4(a0)

lea.l draw_three, a1
move.l a1, 8(a0)

rts

draw_one:
move.w #$ffff, (a5)
move.w #$ffff, 2(a5)
rts

draw_two:
move.w #$ff00, (a5)
move.w #$00ff, 2(a5)
rts

draw_three:
move.w #$8000, (a5)
move.w #$0001, 2(a5)
rts

jumptable:
dc.l $00000000
dc.l $00000000
dc.l $00000000
dc.l $00000000
dc.l $00000000

0 comments on commit 90f24a0

Please sign in to comment.
You can’t perform that action at this time.