2014/9/1 20:30 sidtest.txt
END=83C0
;;;MYCPU80 SID TEST
; 14/8/31 9/1
;
ORG $8004
;
ADISP=$1015
CRLF=$101B
SPCDP=$1039
HXDP2=$104B
HXDP4=$104E
LDIR=$10B1
ERRDP=$200F
;
ACLR=$3DC8
TAZR=$3DCB
XAB=$3DCE
HLRB=$3DD1
;FADD=$3DD4
FSUB=$3DE0
FSUB2=$3DE3
;FMUL=$3DE6
;FMUL2=$3DE9
FDIV=$3DEC
FCMP=$3DF2
APUT=$3DF8
APSH=$3DFE
APOP=$3E01
;
FB0=$F0D0
;
AWK=$F10A
RB3=$F10C
RB5=$F10E
RB6=$F10F
RB7=$F110
FAS=$F1F6
FA1=$F1F8
FA2=$F1F9
FA3=$F1FA
FA4=$F1FB
FA5=$F1FC
FA6=$F1FD
FA7=$F1FE
FA8=$F1FF
;
8004 CD1B10 CALL CRLF
8007 219183 LXI H,PI6
800A 11FAF1 LXI D,FA3
800D 010600 LXI B,$0006
8010 CDB110 CALL LDIR
8013 3AFFF1 FSIN2:LDA FA8
8016 B7 ORA A
8017 F5 PUSH PSW
8018 F21F80 JP FSI2
801B AF XRA A
801C 32FFF1 STA FA8
801F 3AFEF1 FSI2:LDA FA7
8022 FEF6 CPI F6
8024 FAC480 JM FSIE
8027 21A183 FS22:LXI H,F2PI
802A CDF23D CALL FCMP
802D FA3C80 JM FSI3
8030 21A183 LXI H,F2PI
8033 CDE03D CALL FSUB
8036 CD1D83 CALL FADSP
8039 C32780 JMP FS22
803C 219C83 FSI3:LXI H,FPAI
803F CDF23D CALL FCMP
8042 FA5280 JM FSI4
8045 F1 POP PSW
8046 EE80 XRI 80
8048 F5 PUSH PSW
8049 219C83 LXI H,FPAI
804C CDE03D CALL FSUB
804F CD1D83 CALL FADSP
8052 219783 FSI4:LXI H,FPI2
8055 CDF23D CALL FCMP
8058 FA6A80 JM FSI5
805B 219C83 LXI H,FPAI
805E CDD13D CALL HLRB
8061 CDCE3D CALL XAB
8064 CDE33D CALL FSUB2
8067 CD1D83 CALL FADSP
806A 219783 FSI5:LXI H,FPI2
806D CDEC3D CALL FDIV
8070 CD1D83 CALL FADSP
8073 CDFE3D CALL APSH
8076 21FBF1 LXI H,FA4
8079 CDD13D CALL HLRB
807C CDE980 CALL FMUL2
807F CD1D83 CALL FADSP
8082 21D0F0 LXI H,FB0
8085 CDF83D CALL APUT
8088 21A683 LXI H,SIT1
808B CDE680 CALL FMUL
808E CD1D83 CALL FADSP
8091 21AB83 LXI H,SIT2
8094 CDDD80 CALL ADML
8097 CD1D83 CALL FADSP
809A 21B083 LXI H,SIT3
809D CDDD80 CALL ADML
80A0 CD1D83 CALL FADSP
80A3 21B583 LXI H,SIT4
80A6 CDDD80 CALL ADML
80A9 CD1D83 CALL FADSP
80AC 219783 LXI H,FPI2
80AF CDB181 CALL FADD
80B2 CD1D83 CALL FADSP
80B5 21FBF1 LXI H,FA4
80B8 CDD13D CALL HLRB
80BB CD013E CALL APOP
80BE CDE980 CALL FMUL2
80C1 CD1D83 CALL FADSP
80C4 21BA83 FSIE:LXI H,FLMT
80C7 CDF23D CALL FCMP
80CA F2D280 JP FSIE2
80CD CDC83D CALL ACLR
80D0 F1 POP PSW
80D1 C9 RET
80D2 F1 FSIE2:POP PSW
80D3 F0 RP
80D4 3AFFF1 LDA FA8
80D7 EE80 XRI 80
80D9 32FFF1 STA FA8
80DC C9 RET
;
;;;
80DD CDB181 ADML:CALL FADD
80E0 CD1D83 CALL FADSP
80E3 21D0F0 LXI H,FB0
80E6 CDD13D FMUL:CALL HLRB
80E9 CDCB3D FMUL2:CALL TAZR
80EC C8 RZ
80ED 2A0CF1 LHLD RB3
80F0 EB XCHG
80F1 2A0EF1 LHLD RB5
80F4 7C MOV A,H
80F5 B5 ORA L
80F6 B2 ORA D
80F7 B3 ORA E
80F8 CAC83D JZ ACLR
;;; FAH TO FAL & CLEAR FAH
80FB 21FAF1 LXI H,FA3
80FE 11F6F1 LXI D,FAS
8101 0604 MVI B,04
8103 7E FMUL3:MOV A,M
8104 17 RAL
8105 12 STAX D
8106 23 INX H
8107 13 INX D
8108 05 DCR B
8109 C20381 JNZ FMUL3
810C 210000 LXI H,$0000
810F 22FAF1 SHLD FA3
8112 22FCF1 SHLD FA5
;
;MVI A,17
8115 0E17 MVI C,17;***** instead of A
8117 21F9F1 FMUL4:LXI H,FA2
811A 0603 MVI B,03
811C 7E FML41:MOV A,M
811D 1F RAR
811E 77 MOV M,A
811F 2B DCX H
8120 05 DCR B
8121 C21C81 JNZ FML41
8124 D22D81 JNC FML42
8127 CD8981 CALL ADD
812A CD1D83 CALL FADSP
812D CD0D83 FML42:CALL SRAH
8130 CD1D83 CALL FADSP
8133 0D DCR C
8134 C21781 JNZ FMUL4
8137 3AFEF1 LDA FA7
813A 2A10F1 LHLD RB7
813D F5 PUSH PSW
813E AD XRA L
813F FA4D81 JM FML432;not need check overflow
8142 F1 POP PSW
8143 85 ADD L
8144 F5 PUSH PSW
8145 AD XRA L
8146 FA7E81 JM ER08JP;overflow
8149 F1 POP PSW
814A C34F81 JMP FML433
814D F1 FML432:POP PSW
814E 85 ADD L
814F FE80 FML433:CPI 80
8151 CA7F81 JZ ER08;overflow
8154 3D DCR A
8155 4F MOV C,A;save A
8156 CD8981 FML44:CALL ADD
8159 CD1D83 CALL FADSP
815C F26C81 JP FMUL6
815F CD0D83 CALL SRAH
8162 CD1D83 CALL FADSP
8165 79 MOV A,C
8166 FE7F CPI 7F
8168 CA7F81 JZ ER08;overflow
816B 0C INR C
816C 79 FMUL6:MOV A,C
816D 32FEF1 STA FA7
8170 2A10F1 LHLD RB7
8173 3AFFF1 FDIV6:LDA FA8
8176 AC XRA H
8177 32FFF1 STA FA8
817A CD1D83 CALL FADSP
817D C9 RET
817E F1 ER08JP:POP PSW
817F 3E08 ER08:MVI A,08;overflow
8181 C30F20 JMP ERRDP
8184 3E0B ER0B:MVI A,0B
8186 C30F20 JMP ERRDP
;
;;;ADD A & B
ADD:;LHLD FA3
8189 21FAF1 LXI H,FA3
818C 110CF1 LXI D,RB3
818F 0604 MVI B,04
8191 B7 ORA A;reset cf
8192 1A ADD2:LDAX D
8193 8E ADC M
8194 77 MOV M,A
8195 23 INX H
8196 13 INX D
8197 05 DCR B
8198 C29281 JNZ ADD2
819B B7 ORA A;check sign flag
819C C9 RET
;
;;;SUB B FROM A
819D 210CF1 SUB:LXI H,RB3
81A0 11FAF1 LXI D,FA3
81A3 0604 MVI B,04
81A5 B7 ORA A;reset cf
81A6 1A SUB2:LDAX D
81A7 9E SBB M
81A8 12 STAX D
81A9 23 INX H
81AA 13 INX D
81AB 05 DCR B
81AC C2A681 JNZ SUB2
81AF B7 ORA A;check sign flag
81B0 C9 RET
;
;;;FADD
81B1 CDD13D FADD:CALL HLRB
81B4 CD1D83 CALL FADSP
81B7 CDCB3D FADD2:CALL TAZR
81BA CD1D83 CALL FADSP
81BD C2D481 JNZ RBFA2
;;;RB TO FA
RBFA:;XCHG;? LD (FA3),DE
81C0 21FAF1 LXI H,FA3
81C3 110CF1 LXI D,RB3
81C6 0606 MVI B,06
81C8 1A RBFA1:LDAX D
81C9 77 MOV M,A
81CA 23 INX H
81CB 13 INX D
81CC 05 DCR B
81CD C2C881 JNZ RBFA1
81D0 CD1D83 CALL FADSP
81D3 C9 RET
;test RB zero
81D4 2A0CF1 RBFA2:LHLD RB3
81D7 EB XCHG
81D8 2A0EF1 LHLD RB5
81DB 7C MOV A,H
81DC B5 ORA L
81DD B2 ORA D
81DE B3 ORA E
81DF CD1D83 CALL FADSP
81E2 C8 RZ
;
81E3 3AFEF1 LDA FA7
81E6 2A10F1 LHLD RB7
81E9 95 SUB L
81EA CD1D83 CALL FADSP
81ED CA2882 JZ RBFA5
81F0 F20082 JP RBFA3
81F3 F5 PUSH PSW
81F4 CDCE3D CALL XAB
81F7 CD1D83 CALL FADSP
81FA C1 POP B
81FB AF XRA A
81FC 90 SUB B
81FD CD1D83 CALL FADSP
8200 FE1F RBFA3:CPI 1F
8202 CD1D83 CALL FADSP
8205 F0 RP
;shift right RB & RBE++;till A=0
8206 47 RBFA4:MOV B,A
8207 3A10F1 LDA RB7
820A 57 MOV D,A
820B CD1D83 CALL FADSP
820E 210FF1 RBFA42:LXI H,RB6
8211 0E04 MVI C,04
8213 AF XRA A;reset cf
8214 7E RBFA43:MOV A,M
8215 1F RAR
8216 77 MOV M,A
8217 2B DCX H
8218 0D DCR C
8219 C21482 JNZ RBFA43
821C 14 INR D
821D 05 DCR B
821E C20E82 JNZ RBFA42
8221 CD1D83 CALL FADSP
8224 7A MOV A,D
8225 3210F1 STA RB7
8228 3AFFF1 RBFA5:LDA FA8
822B 2A10F1 LHLD RB7
822E AC XRA H
822F CD1D83 CALL FADSP
8232 C24582 JNZ RBFA6
8235 CD1D83 CALL FADSP
8238 CD8981 CALL ADD
823B CD1D83 CALL FADSP
823E FC0083 CM SRAI
8241 CD1D83 CALL FADSP
8244 C9 RET
8245 E5 RBFA6:PUSH H
8246 CD9D81 CALL SUB
8249 CD1D83 CALL FADSP
824C E1 POP H
824D F26982 JP FNORZ
8250 CD1D83 CALL FADSP
;;; NEGATIVE FA
8253 7C MOV A,H
8254 32FFF1 STA FA8
8257 21FAF1 LXI H,FA3
825A 0604 MVI B,04
825C AF XRA A;reset cf
825D 3E00 NEGFA:MVI A,00
825F 9E SBB M
8260 77 MOV M,A
8261 23 INX H
8262 05 DCR B
8263 C25D82 JNZ NEGFA
8266 CD1D83 CALL FADSP
;;;NORMALIZE
;test FA zero
8269 2AFAF1 FNORZ:LHLD FA3
826C EB XCHG
826D 2AFCF1 LHLD FA5
8270 7C MOV A,H
8271 B5 ORA L
8272 B2 ORA D
8273 B3 ORA E
8274 44 MOV B,H
8275 4D MOV C,L
8276 2AFEF1 LHLD FA7
8279 C28282 JNZ FNOR0
;FNZ11:? LD (FA7),BC
827C 67 MOV H,A
827D 6F MOV L,A
827E 22FEF1 SHLD FA7
8281 C9 RET
8282 AF FNOR0:XRA A
FNOR1:;?EX AF,AF'
8283 320AF1 STA AWK
8286 78 MOV A,B
8287 B7 ORA A
8288 C29782 JNZ FNOR2
828B 41 MOV B,C
828C 4A MOV C,D
828D 53 MOV D,E
828E 5F MOV E,A
;? EX AF,AF'
828F 3A0AF1 LDA AWK
8292 D608 SUI 08
8294 C38382 JMP FNOR1
8297 F2B182 FNOR2:JP FNO22
829A AF XRA A;reset cf
829B 78 MOV A,B
829C 1F RAR
829D 47 MOV B,A
829E 79 MOV A,C
829F 1F RAR
82A0 4F MOV C,A
82A1 7A MOV A,D
82A2 1F RAR
82A3 57 MOV D,A
82A4 7B MOV A,E
82A5 1F RAR
82A6 5F MOV E,A
;? EX AF,AF'
82A7 3A0AF1 LDA AWK
82AA 3C INR A
82AB 320AF1 STA AWK
82AE C3DC82 JMP FNOR4
FNO22:;?EX AF,AF'
82B1 3A0AF1 FNOR3:LDA AWK
82B4 3D DCR A
82B5 320AF1 STA AWK
82B8 AF XRA A;reset cf
82B9 7B MOV A,E
82BA 17 RAL
82BB 5F MOV E,A
82BC 7A MOV A,D
82BD 17 RAL
82BE 57 MOV D,A
82BF 79 MOV A,C
82C0 17 RAL
82C1 4F MOV C,A
82C2 78 MOV A,B
82C3 17 RAL
82C4 47 MOV B,A
82C5 B7 ORA A
82C6 F2B182 JP FNOR3
82C9 3A0AF1 LDA AWK
82CC 3C INR A
82CD 320AF1 STA AWK
82D0 78 MOV A,B
82D1 1F RAR
82D2 47 MOV B,A
82D3 79 MOV A,C
82D4 1F RAR
82D5 4F MOV C,A
82D6 7A MOV A,D
82D7 1F RAR
82D8 57 MOV D,A
82D9 7B MOV A,E
82DA 1F RAR
82DB 5F MOV E,A
FNOR4:;ADD L
;JPE ER08
82DC 3A0AF1 LDA AWK
82DF F5 PUSH PSW
82E0 AD XRA L
82E1 FAEF82 JM FNOR422;not need check overflow
82E4 F1 POP PSW
82E5 85 ADD L
82E6 F5 PUSH PSW
82E7 AD XRA L
82E8 FA7E81 JM ER08JP;overflow
82EB F1 POP PSW
82EC C3F182 JMP FNOR43
82EF F1 FNOR422:POP PSW
82F0 85 ADD L
82F1 6F FNOR43:MOV L,A
82F2 22FEF1 SHLD FA7
82F5 EB XCHG;? LD (FA3),DE
82F6 22FAF1 SHLD FA3
82F9 EB XCHG
;? LD (FA5),BC
82FA 60 MOV H,B
82FB 69 MOV L,C
82FC 22FCF1 SHLD FA5
82FF C9 RET
;
;;;SHIFT RIGHT AR & INC AE
SRAI:;LXI H,FA7
;INR M
;JPE ER0B
8300 4F MOV C,A;save A
8301 3AFEF1 LDA FA7
8304 FE7F CPI 7F
8306 CA8481 JZ ER0B;overflow
8309 3C INR A
830A 32FEF1 STA FA7
830D 0604 SRAH:MVI B,04
830F 21FDF1 SRAH1:LXI H,FA6
8312 AF XRA A;reset cf
8313 7E SRAH2:MOV A,M
8314 1F RAR
8315 77 MOV M,A
8316 2B DCX H
8317 05 DCR B
8318 C21383 JNZ SRAH2
831B 79 MOV A,C
831C C9 RET
;;;
;
831D 22BF83 FADSP:SHLD HLWK
8320 E1 POP H
8321 E5 PUSH H
8322 F5 PUSH PSW
8323 2B DCX H
8324 2B DCX H
8325 2B DCX H
8326 CD4E10 CALL HXDP4
8329 CD3910 CALL SPCDP
832C 2AFEF1 LHLD FA7
832F CD4E10 CALL HXDP4
8332 2AFCF1 LHLD FA5
8335 CD4E10 CALL HXDP4
8338 2AFAF1 LHLD FA3
833B CD4E10 CALL HXDP4
833E 2AF8F1 LHLD FA1
8341 CD4E10 CALL HXDP4
8344 2AF6F1 LHLD FAS
8347 CD4E10 CALL HXDP4
834A CD3910 CALL SPCDP
;
834D 2A10F1 LHLD RB7
8350 CD4E10 CALL HXDP4
8353 2A0EF1 LHLD RB5
8356 CD4E10 CALL HXDP4
8359 2A0CF1 LHLD RB3
835C CD4E10 CALL HXDP4
835F CD3910 CALL SPCDP
;
8362 E1 POP H
8363 E5 PUSH H
8364 CD4E10 CALL HXDP4;A+F
8367 CD3910 CALL SPCDP
836A 60 MOV H,B
836B 69 MOV L,C
836C CD4E10 CALL HXDP4;BC
836F CD3910 CALL SPCDP
8372 62 MOV H,D
8373 6B MOV L,E
8374 CD4E10 CALL HXDP4;DE
8377 CD3910 CALL SPCDP
837A 2ABF83 LHLD HLWK
837D CD4E10 CALL HXDP4;HL
8380 CD1B10 CALL CRLF
8383 210020 LXI H,$2000
8386 2B WAIT:DCX H
8387 7C MOV A,H
8388 B5 ORA L
8389 C28683 JNZ WAIT
838C F1 POP PSW
838D 2ABF83 LHLD HLWK
8390 C9 RET
;
8391 60 PI6:DB 60;PI/6=30(degree)
8392 48 DB 48
8393 05 DB 05
8394 43 DB 43
8395 00 DB 00
8396 00 DB 00
;;;FPI2
8397 ED FPI2:DB ED
8398 87 DB 87
8399 64 DB 64
839A 01 DB 01
839B 00 DB 00
;;;FPAI
839C ED FPAI:DB ED
839D 87 DB 87
839E 64 DB 64
839F 02 DB 02
83A0 00 DB 00
;;;F2PI
83A1 ED F2PI:DB ED
83A2 87 DB 87
83A3 64 DB 64
83A4 03 DB 03
83A5 00 DB 00
;;;SIT1
83A6 DD SIT1:DB DD
83A7 6B DB 6B
83A8 4F DB 4F
83A9 F4 DB F4
83AA 00 DB 00
;;;SIT2
83AB 32 SIT2:DB 32
83AC 93 DB 93
83AD 4C DB 4C
83AE F9 DB F9
83AF 80 DB 80
;;;SIT3
83B0 2C SIT3:DB 2C
83B1 9A DB 9A
83B2 51 DB 51
83B3 FD DB FD
83B4 00 DB 00
;;;SIT4
83B5 F0 SIT4:DB F0
83B6 AE DB AE
83B7 52 DB 52
83B8 00 DB 00
83B9 80 DB 80
;;;0.2E-5
83BA DE FLMT:DB DE
83BB 1B DB 1B
83BC 43 DB 43
83BD EE DB EE
83BE 00 DB 00
;
83BF 00 HLWK:NOP
83C0 00 NOP
;ACLR =3DC8 ADD =8189 ADD2 =8192
ADISP =1015 ADML =80DD APOP =3E01
APSH =3DFE APUT =3DF8 AWK =F10A
CRLF =101B ER08 =817F ER08JP =817E
ER0B =8184 ERRDP =200F F2PI =83A1
FA1 =F1F8 FA2 =F1F9 FA3 =F1FA
FA4 =F1FB FA5 =F1FC FA6 =F1FD
FA7 =F1FE FA8 =F1FF FADD =81B1
FADD2 =81B7 FADSP =831D FAS =F1F6
FB0 =F0D0 FCMP =3DF2 FDIV =3DEC
FDIV6 =8173 FLMT =83BA FML41 =811C
FML42 =812D FML432 =814D FML433 =814F
FML44 =8156 FMUL =80E6 FMUL2 =80E9
FMUL3 =8103 FMUL4 =8117 FMUL6 =816C
FNO22 =82B1 FNOR0 =8282 FNOR1 =8283
FNOR2 =8297 FNOR3 =82B1 FNOR4 =82DC
FNOR422 =82EF FNOR43 =82F1 FNORZ =8269
FPAI =839C FPI2 =8397 FS22 =8027
FSI2 =801F FSI3 =803C FSI4 =8052
FSI5 =806A FSIE =80C4 FSIE2 =80D2
FSIN2 =8013 FSUB =3DE0 FSUB2 =3DE3
HLRB =3DD1 HLWK =83BF HXDP2 =104B
HXDP4 =104E LDIR =10B1 NEGFA =825D
PI6 =8391 RB3 =F10C RB5 =F10E
RB6 =F10F RB7 =F110 RBFA =81C0
RBFA1 =81C8 RBFA2 =81D4 RBFA3 =8200
RBFA4 =8206 RBFA42 =820E RBFA43 =8214
RBFA5 =8228 RBFA6 =8245 SIT1 =83A6
SIT2 =83AB SIT3 =83B0 SIT4 =83B5
SPCDP =1039 SRAH =830D SRAH1 =830F
SRAH2 =8313 SRAI =8300 SUB =819D
SUB2 =81A6 TAZR =3DCB WAIT =8386
XAB =3DCE
|