Adding SVD.

This commit is contained in:
Russell-S-Harper 2018-09-11 19:26:08 -04:00
parent 13c375b242
commit 2d076b503c
2 changed files with 29 additions and 2 deletions

View File

@ -145,7 +145,31 @@ _1 RTS ; done
.) .)
_SVD .( ; SVD r xxyy 3r yy xx (xxyy) <- Rr - save register directly to address _SVD .( ; SVD r xxyy 3r yy xx (xxyy) <- Rr - save register directly to address
RTS LDY #0 ; set up address in I0
LDA (_PC),Y
STA _I0
INY
LDA (_PC),Y
STA _I0+1
DEY ; transfer four bytes over
LDA _R0,X
STA (_I0),Y
INY
LDA _R0+1,X
STA (_I0),Y
INY
LDA _R0+2,X
STA (_I0),Y
INY
LDA _R0+3,X
STA (_I0),Y
LDA #2 ; update program counter
CLC
ADC _PCL
STA _PCL
BCC _1
INC _PCH
_1 RTS ; done
.) .)
_PSH .( ; PSH r 4r RS <- Rr - push onto stack _PSH .( ; PSH r 4r RS <- Rr - push onto stack

View File

@ -8,7 +8,8 @@ HDR(DEMO)
CMN CMN
LDD(R0, PLS_1) LDD(R0, PLS_1)
LDD(R1, MNS_1) LDD(R1, MNS_1)
ADD(R2, R0, R1) SVD(R1, SVD_T)
LDD(R2, SVD_T)
ESC ESC
BRK BRK
@ -27,3 +28,5 @@ _2 EXT(S0)
END(FACTORIAL) END(FACTORIAL)
END(DEMO) END(DEMO)
SVD_T .BYTE 0, 0, 0, 0