mirror of
https://github.com/irmen/prog8.git
synced 2024-11-22 15:33:02 +00:00
implemented asm for lsr array values
This commit is contained in:
parent
2c59cbdece
commit
15e8e0bf6d
@ -1810,19 +1810,81 @@ lsl_array_w .proc
|
||||
.pend
|
||||
|
||||
lsr_array_ub .proc
|
||||
.warn "lsr_array_ub" ; TODO
|
||||
; -- lsr a ubyte in an array (index and array address on stack)
|
||||
inx
|
||||
ldy c64.ESTACK_LO,x
|
||||
inx
|
||||
lda c64.ESTACK_LO,x
|
||||
sta c64.SCRATCH_ZPWORD1
|
||||
lda c64.ESTACK_HI,x
|
||||
sta c64.SCRATCH_ZPWORD1+1
|
||||
lda (c64.SCRATCH_ZPWORD1),y
|
||||
lsr a
|
||||
sta (c64.SCRATCH_ZPWORD1),y
|
||||
rts
|
||||
.pend
|
||||
|
||||
lsr_array_b .proc
|
||||
.warn "lsr_array_b" ; TODO
|
||||
; -- lsr a byte in an array (index and array address on stack)
|
||||
inx
|
||||
ldy c64.ESTACK_LO,x
|
||||
inx
|
||||
lda c64.ESTACK_LO,x
|
||||
sta c64.SCRATCH_ZPWORD1
|
||||
lda c64.ESTACK_HI,x
|
||||
sta c64.SCRATCH_ZPWORD1+1
|
||||
lda (c64.SCRATCH_ZPWORD1),y
|
||||
asl a
|
||||
lda (c64.SCRATCH_ZPWORD1),y
|
||||
ror a
|
||||
sta (c64.SCRATCH_ZPWORD1),y
|
||||
rts
|
||||
.pend
|
||||
|
||||
lsr_array_uw .proc
|
||||
.warn "lsr_array_uw" ; TODO
|
||||
; -- lsr a uword in an array (index and array address on stack)
|
||||
inx
|
||||
lda c64.ESTACK_LO,x
|
||||
asl a
|
||||
tay
|
||||
inx
|
||||
lda c64.ESTACK_LO,x
|
||||
sta c64.SCRATCH_ZPWORD1
|
||||
lda c64.ESTACK_HI,x
|
||||
sta c64.SCRATCH_ZPWORD1+1
|
||||
iny
|
||||
lda (c64.SCRATCH_ZPWORD1),y
|
||||
lsr a
|
||||
sta (c64.SCRATCH_ZPWORD1),y
|
||||
dey
|
||||
lda (c64.SCRATCH_ZPWORD1),y
|
||||
ror a
|
||||
sta (c64.SCRATCH_ZPWORD1),y
|
||||
rts
|
||||
.pend
|
||||
|
||||
lsr_array_w .proc
|
||||
.warn "lsr_array_w" ; TODO
|
||||
; -- lsr a uword in an array (index and array address on stack)
|
||||
inx
|
||||
lda c64.ESTACK_LO,x
|
||||
asl a
|
||||
tay
|
||||
inx
|
||||
lda c64.ESTACK_LO,x
|
||||
sta c64.SCRATCH_ZPWORD1
|
||||
lda c64.ESTACK_HI,x
|
||||
sta c64.SCRATCH_ZPWORD1+1
|
||||
iny
|
||||
lda (c64.SCRATCH_ZPWORD1),y
|
||||
asl a
|
||||
lda (c64.SCRATCH_ZPWORD1),y
|
||||
ror a
|
||||
sta (c64.SCRATCH_ZPWORD1),y
|
||||
dey
|
||||
lda (c64.SCRATCH_ZPWORD1),y
|
||||
ror a
|
||||
sta (c64.SCRATCH_ZPWORD1),y
|
||||
rts
|
||||
.pend
|
||||
|
||||
rol_array_ub .proc
|
||||
|
@ -9,35 +9,118 @@ main {
|
||||
uword uw
|
||||
&ubyte membyte=9999
|
||||
&uword memword=9999
|
||||
ubyte[] ubarray = [8,8,8]
|
||||
uword[] uwarray = [8200, 8200, 8200]
|
||||
byte[] bbarray = [8,8,8]
|
||||
word[] wwarray = [8200, 8200, 8200]
|
||||
ubyte[] ubarray = [8,%10011100,8]
|
||||
uword[] uwarray = [8200, %1001110011110001, 8200]
|
||||
byte[] bbarray = [8,-%01011100,8]
|
||||
word[] wwarray = [8200, -%0101110011110001, 8200]
|
||||
|
||||
sub unimplemented() {
|
||||
; TODO implement these asm routines
|
||||
c64scr.print_ubbin(ubarray[1], false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(ubarray[1])
|
||||
lsl(ubarray[1])
|
||||
ror(ubarray[1])
|
||||
rol(ubarray[1])
|
||||
ror2(ubarray[1])
|
||||
rol2(ubarray[1])
|
||||
lsr(bbarray[1])
|
||||
lsl(bbarray[1])
|
||||
c64scr.print_ubbin(ubarray[1], false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(ubarray[1])
|
||||
c64scr.print_ubbin(ubarray[1], false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(ubarray[1])
|
||||
c64scr.print_ubbin(ubarray[1], false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(ubarray[1])
|
||||
c64scr.print_ubbin(ubarray[1], false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(ubarray[1])
|
||||
c64scr.print_ubbin(ubarray[1], false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(ubarray[1])
|
||||
c64scr.print_ubbin(ubarray[1], false)
|
||||
c64.CHROUT('\n')
|
||||
c64.CHROUT('\n')
|
||||
|
||||
c64scr.print_ubbin(bbarray[1] as ubyte, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(bbarray[1])
|
||||
c64scr.print_ubbin(bbarray[1] as ubyte, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(bbarray[1])
|
||||
c64scr.print_ubbin(bbarray[1] as ubyte, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(bbarray[1])
|
||||
c64scr.print_ubbin(bbarray[1] as ubyte, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(bbarray[1])
|
||||
c64scr.print_ubbin(bbarray[1] as ubyte, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(bbarray[1])
|
||||
c64scr.print_ubbin(bbarray[1] as ubyte, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(bbarray[1])
|
||||
c64scr.print_ubbin(bbarray[1] as ubyte, false)
|
||||
c64.CHROUT('\n')
|
||||
c64.CHROUT('\n')
|
||||
|
||||
c64scr.print_uwbin(uwarray[1] as uword, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(uwarray[1])
|
||||
lsl(uwarray[1])
|
||||
ror(uwarray[1])
|
||||
rol(uwarray[1])
|
||||
ror2(uwarray[1])
|
||||
rol2(uwarray[1])
|
||||
c64scr.print_uwbin(uwarray[1] as uword, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(uwarray[1])
|
||||
c64scr.print_uwbin(uwarray[1] as uword, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(uwarray[1])
|
||||
c64scr.print_uwbin(uwarray[1] as uword, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(uwarray[1])
|
||||
c64scr.print_uwbin(uwarray[1] as uword, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(uwarray[1])
|
||||
c64scr.print_uwbin(uwarray[1] as uword, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(uwarray[1])
|
||||
c64scr.print_uwbin(uwarray[1] as uword, false)
|
||||
c64.CHROUT('\n')
|
||||
c64.CHROUT('\n')
|
||||
|
||||
c64scr.print_uwbin(wwarray[1] as uword, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(wwarray[1])
|
||||
lsl(wwarray[1])
|
||||
c64scr.print_uwbin(wwarray[1] as uword, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(wwarray[1])
|
||||
c64scr.print_uwbin(wwarray[1] as uword, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(wwarray[1])
|
||||
c64scr.print_uwbin(wwarray[1] as uword, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(wwarray[1])
|
||||
c64scr.print_uwbin(wwarray[1] as uword, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(wwarray[1])
|
||||
c64scr.print_uwbin(wwarray[1] as uword, false)
|
||||
c64.CHROUT('\n')
|
||||
lsr(wwarray[1])
|
||||
c64scr.print_uwbin(wwarray[1] as uword, false)
|
||||
c64.CHROUT('\n')
|
||||
c64.CHROUT('\n')
|
||||
|
||||
; lsl(ubarray[1])
|
||||
; ror(ubarray[1])
|
||||
; rol(ubarray[1])
|
||||
; ror2(ubarray[1])
|
||||
; rol2(ubarray[1])
|
||||
; lsl(bbarray[1])
|
||||
;
|
||||
; lsl(uwarray[1])
|
||||
; ror(uwarray[1])
|
||||
; rol(uwarray[1])
|
||||
; ror2(uwarray[1])
|
||||
; rol2(uwarray[1])
|
||||
; lsr(wwarray[1])
|
||||
; lsl(wwarray[1])
|
||||
}
|
||||
|
||||
sub start() {
|
||||
; TODO call this once implemented:
|
||||
; unimplemented()
|
||||
unimplemented()
|
||||
|
||||
lsr(A)
|
||||
lsl(A)
|
||||
|
Loading…
Reference in New Issue
Block a user