implemented asm for ror array values

This commit is contained in:
Irmen de Jong 2020-04-03 00:03:42 +02:00
parent f01173d8db
commit f2e5d987a9
2 changed files with 148 additions and 57 deletions

View File

@ -1887,6 +1887,45 @@ lsr_array_w .proc
rts rts
.pend .pend
ror_array_ub .proc
; -- ror 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
ror a
sta (c64.SCRATCH_ZPWORD1),y
rts
.pend
ror_array_uw .proc
; -- ror a uword in an array (index and array address on stack)
php
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
plp
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 rol_array_ub .proc
.warn "rol_array_ub" ; TODO .warn "rol_array_ub" ; TODO
.pend .pend
@ -1903,14 +1942,6 @@ rol2_array_uw .proc
.warn "rol2_array_uw" ; TODO .warn "rol2_array_uw" ; TODO
.pend .pend
ror_array_ub .proc
.warn "ror_array_ub" ; TODO
.pend
ror_array_uw .proc
.warn "ror_array_uw" ; TODO
.pend
ror2_array_ub .proc ror2_array_ub .proc
.warn "ror2_array_ub" ; TODO .warn "ror2_array_ub" ; TODO
.pend .pend

View File

@ -15,107 +15,167 @@ main {
word[] wwarray = [8200, -%0101110011110001, 8200] word[] wwarray = [8200, -%0101110011110001, 8200]
sub unimplemented() { sub unimplemented() {
ubyte xx
uword xxx
ror(xx)
ror(xxx)
clear_carry()
c64scr.print_ubbin(ubarray[1], false) c64scr.print_ubbin(ubarray[1], false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(ubarray[1]) ror(ubarray[1])
c64scr.print_ubbin(ubarray[1], false) c64scr.print_ubbin(ubarray[1], false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(ubarray[1]) ror(ubarray[1])
c64scr.print_ubbin(ubarray[1], false) c64scr.print_ubbin(ubarray[1], false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(ubarray[1]) ror(ubarray[1])
c64scr.print_ubbin(ubarray[1], false) c64scr.print_ubbin(ubarray[1], false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(ubarray[1]) ror(ubarray[1])
c64scr.print_ubbin(ubarray[1], false) c64scr.print_ubbin(ubarray[1], false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(ubarray[1]) ror(ubarray[1])
c64scr.print_ubbin(ubarray[1], false) c64scr.print_ubbin(ubarray[1], false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(ubarray[1]) ror(ubarray[1])
c64scr.print_ubbin(ubarray[1], false) c64scr.print_ubbin(ubarray[1], false)
c64.CHROUT('\n') c64.CHROUT('\n')
c64.CHROUT('\n') c64.CHROUT('\n')
c64scr.print_ubbin(bbarray[1] as ubyte, false) c64scr.print_ubbin(ubarray[1], false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(bbarray[1]) set_carry()
c64scr.print_ubbin(bbarray[1] as ubyte, false) ror(ubarray[1])
c64scr.print_ubbin(ubarray[1], false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(bbarray[1]) set_carry()
c64scr.print_ubbin(bbarray[1] as ubyte, false) ror(ubarray[1])
c64scr.print_ubbin(ubarray[1], false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(bbarray[1]) set_carry()
c64scr.print_ubbin(bbarray[1] as ubyte, false) ror(ubarray[1])
c64scr.print_ubbin(ubarray[1], false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(bbarray[1]) set_carry()
c64scr.print_ubbin(bbarray[1] as ubyte, false) ror(ubarray[1])
c64scr.print_ubbin(ubarray[1], false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(bbarray[1]) set_carry()
c64scr.print_ubbin(bbarray[1] as ubyte, false) ror(ubarray[1])
c64scr.print_ubbin(ubarray[1], false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(bbarray[1]) set_carry()
c64scr.print_ubbin(bbarray[1] as ubyte, false) ror(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')
; ror(bbarray[1])
; c64scr.print_ubbin(bbarray[1] as ubyte, false)
; c64.CHROUT('\n')
; ror(bbarray[1])
; c64scr.print_ubbin(bbarray[1] as ubyte, false)
; c64.CHROUT('\n')
; ror(bbarray[1])
; c64scr.print_ubbin(bbarray[1] as ubyte, false)
; c64.CHROUT('\n')
; ror(bbarray[1])
; c64scr.print_ubbin(bbarray[1] as ubyte, false)
; c64.CHROUT('\n')
; ror(bbarray[1])
; c64scr.print_ubbin(bbarray[1] as ubyte, false)
; c64.CHROUT('\n')
; ror(bbarray[1])
; c64scr.print_ubbin(bbarray[1] as ubyte, false)
; c64.CHROUT('\n')
; c64.CHROUT('\n')
clear_carry()
c64scr.print_uwbin(uwarray[1] as uword, false)
c64.CHROUT('\n')
ror(uwarray[1])
c64scr.print_uwbin(uwarray[1] as uword, false)
c64.CHROUT('\n')
ror(uwarray[1])
c64scr.print_uwbin(uwarray[1] as uword, false)
c64.CHROUT('\n')
ror(uwarray[1])
c64scr.print_uwbin(uwarray[1] as uword, false)
c64.CHROUT('\n')
ror(uwarray[1])
c64scr.print_uwbin(uwarray[1] as uword, false)
c64.CHROUT('\n')
ror(uwarray[1])
c64scr.print_uwbin(uwarray[1] as uword, false)
c64.CHROUT('\n')
ror(uwarray[1])
c64scr.print_uwbin(uwarray[1] as uword, false)
c64.CHROUT('\n') c64.CHROUT('\n')
c64.CHROUT('\n') c64.CHROUT('\n')
c64scr.print_uwbin(uwarray[1] as uword, false) c64scr.print_uwbin(uwarray[1] as uword, false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(uwarray[1]) set_carry()
ror(uwarray[1])
c64scr.print_uwbin(uwarray[1] as uword, false) c64scr.print_uwbin(uwarray[1] as uword, false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(uwarray[1]) set_carry()
ror(uwarray[1])
c64scr.print_uwbin(uwarray[1] as uword, false) c64scr.print_uwbin(uwarray[1] as uword, false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(uwarray[1]) set_carry()
ror(uwarray[1])
c64scr.print_uwbin(uwarray[1] as uword, false) c64scr.print_uwbin(uwarray[1] as uword, false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(uwarray[1]) set_carry()
ror(uwarray[1])
c64scr.print_uwbin(uwarray[1] as uword, false) c64scr.print_uwbin(uwarray[1] as uword, false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(uwarray[1]) set_carry()
ror(uwarray[1])
c64scr.print_uwbin(uwarray[1] as uword, false) c64scr.print_uwbin(uwarray[1] as uword, false)
c64.CHROUT('\n') c64.CHROUT('\n')
lsr(uwarray[1]) set_carry()
ror(uwarray[1])
c64scr.print_uwbin(uwarray[1] as uword, false) c64scr.print_uwbin(uwarray[1] as uword, false)
c64.CHROUT('\n') c64.CHROUT('\n')
c64.CHROUT('\n') c64.CHROUT('\n')
c64scr.print_uwbin(wwarray[1] as uword, false) ; c64scr.print_uwbin(wwarray[1] as uword, false)
c64.CHROUT('\n') ; c64.CHROUT('\n')
lsr(wwarray[1]) ; ror(wwarray[1])
c64scr.print_uwbin(wwarray[1] as uword, false) ; c64scr.print_uwbin(wwarray[1] as uword, false)
c64.CHROUT('\n') ; c64.CHROUT('\n')
lsr(wwarray[1]) ; ror(wwarray[1])
c64scr.print_uwbin(wwarray[1] as uword, false) ; c64scr.print_uwbin(wwarray[1] as uword, false)
c64.CHROUT('\n') ; c64.CHROUT('\n')
lsr(wwarray[1]) ; ror(wwarray[1])
c64scr.print_uwbin(wwarray[1] as uword, false) ; c64scr.print_uwbin(wwarray[1] as uword, false)
c64.CHROUT('\n') ; c64.CHROUT('\n')
lsr(wwarray[1]) ; ror(wwarray[1])
c64scr.print_uwbin(wwarray[1] as uword, false) ; c64scr.print_uwbin(wwarray[1] as uword, false)
c64.CHROUT('\n') ; c64.CHROUT('\n')
lsr(wwarray[1]) ; ror(wwarray[1])
c64scr.print_uwbin(wwarray[1] as uword, false) ; c64scr.print_uwbin(wwarray[1] as uword, false)
c64.CHROUT('\n') ; c64.CHROUT('\n')
lsr(wwarray[1]) ; ror(wwarray[1])
c64scr.print_uwbin(wwarray[1] as uword, false) ; c64scr.print_uwbin(wwarray[1] as uword, false)
c64.CHROUT('\n') ; c64.CHROUT('\n')
c64.CHROUT('\n') ; c64.CHROUT('\n')
; lsl(ubarray[1]) ; lsl(ubarray[1])
; ror(ubarray[1])
; rol(ubarray[1]) ; rol(ubarray[1])
; ror2(ubarray[1]) ; ror2(ubarray[1])
; rol2(ubarray[1]) ; rol2(ubarray[1])
; lsl(bbarray[1]) ; lsl(bbarray[1])
; ;
; lsl(uwarray[1]) ; lsl(uwarray[1])
; ror(uwarray[1])
; rol(uwarray[1]) ; rol(uwarray[1])
; ror2(uwarray[1]) ; ror2(uwarray[1])
; rol2(uwarray[1]) ; rol2(uwarray[1])
; lsr(wwarray[1])
; lsl(wwarray[1]) ; lsl(wwarray[1])
} }