test abstraction

This commit is contained in:
Jorj Bauer 2018-06-15 23:13:06 -04:00
parent ba0593bb70
commit fbb9c85468
46 changed files with 52461 additions and 28 deletions

View File

@ -27,12 +27,13 @@ linuxfb: roms $(COMMONOBJS) $(FBOBJS)
g++ $(LDFLAGS) $(FBLIBS) -o aiie-fb $(COMMONOBJS) $(FBOBJS)
clean:
rm -f *.o *~ */*.o */*~ testharness.basic testharness.verbose testharness.extended apple/diskii-rom.h apple/applemmu-rom.h apple/parallel-rom.h aiie-sdl
rm -f *.o *~ */*.o */*~ testharness.basic testharness.verbose testharness.extended testharness apple/diskii-rom.h apple/applemmu-rom.h apple/parallel-rom.h aiie-sdl
test: $(TSRC)
g++ $(CXXFLAGS) -DEXIT_ON_ILLEGAL -DVERBOSE_CPU_ERRORS -DTESTHARNESS -DBASICTEST $(TSRC) -o testharness.basic
g++ $(CXXFLAGS) -DEXIT_ON_ILLEGAL -DVERBOSE_CPU_ERRORS -DTESTHARNESS -DVERBOSETEST $(TSRC) -o testharness.verbose
g++ $(CXXFLAGS) -DEXIT_ON_ILLEGAL -DVERBOSE_CPU_ERRORS -DTESTHARNESS -DEXTENDEDTEST $(TSRC) -o testharness.extended
g++ $(CXXFLAGS) -DEXIT_ON_ILLEGAL -DVERBOSE_CPU_ERRORS -DTESTHARNESS $(TSRC) -o testharness
./testharness -f tests/6502_functional_test_verbose.bin -s 0x400 && \
./testharness -f tests/65C02_extended_opcodes_test.bin -s 0x400 && \
./testharness -f tests/65c02-all.bin -s 0x200
roms: apple2e.rom disk.rom parallel.rom HDDRVR.BIN
./util/genrom.pl apple2e.rom disk.rom parallel.rom HDDRVR.BIN

355
tests/6502_decimal_test.a65 Normal file
View File

@ -0,0 +1,355 @@
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
vld_bcd = 0 ; 0 = allow invalid bcd, 1 = valid bcd only
chk_a = 1 ; check accumulator
chk_n = 0 ; check sign (negative) flag
chk_v = 0 ; check overflow flag
chk_z = 0 ; check zero flag
chk_c = 0 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
org 0
; operands - register Y = carry in
N1 ds 1
N2 ds 1
; binary result
HA ds 1
HNVZC ds 1
;04
; decimal result
DA ds 1
DNVZC ds 1
; predicted results
AR ds 1
NF ds 1
;08
VF ds 1
ZF ds 1
CF ds 1
ERROR ds 1
;0C
; workspace
N1L ds 1
N1H ds 1
N2L ds 1
N2H ds 2
code
org $200
TEST ldy #1 ; initialize Y (used to loop through carry flag values)
sty ERROR ; store 1 in ERROR until the test passes
lda #0 ; initialize N1 and N2
sta N1
sta N2
LOOP1 lda N2 ; N2L = N2 & $0F
and #$0F ; [1] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT2
endif
sta N2L
lda N2 ; N2H = N2 & $F0
and #$F0 ; [2] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT2
endif
sta N2H
ora #$0F ; N2H+1 = (N2 & $F0) + $0F
sta N2H+1
LOOP2 lda N1 ; N1L = N1 & $0F
and #$0F ; [3] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT1
endif
sta N1L
lda N1 ; N1H = N1 & $F0
and #$F0 ; [4] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT1
endif
sta N1H
jsr ADD
jsr A6502
jsr COMPARE
bne DONE
jsr SUB
jsr S6502
jsr COMPARE
bne DONE
NEXT1 inc N1 ; [5] see text
bne LOOP2 ; loop through all 256 values of N1
NEXT2 inc N2 ; [6] see text
bne LOOP1 ; loop through all 256 values of N2
dey
bpl LOOP1 ; loop through both values of the carry flag
lda #0 ; test passed, so store 0 in ERROR
sta ERROR
DONE
end_of_test
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
ADD sed ; decimal mode
cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1
adc N2
sta DA ; actual accumulator result in decimal mode
php
pla
sta DNVZC ; actual flags result in decimal mode
cld ; binary mode
cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1
adc N2
sta HA ; accumulator result of N1+N2 using binary arithmetic
php
pla
sta HNVZC ; flags result of N1+N2 using binary arithmetic
cpy #1
lda N1L
adc N2L
cmp #$0A
ldx #0
bcc A1
inx
adc #5 ; add 6 (carry is set)
and #$0F
sec
A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
adc N2H,x
php
bcs A2
cmp #$A0
bcc A3
A2 adc #$5F ; add $60 (carry is set)
sec
A3 sta AR ; predicted accumulator result
php
pla
sta CF ; predicted carry result
pla
;
; note that all 8 bits of the P register are stored in VF
;
sta VF ; predicted V flags
rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
SUB sed ; decimal mode
cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1
sbc N2
sta DA ; actual accumulator result in decimal mode
php
pla
sta DNVZC ; actual flags result in decimal mode
cld ; binary mode
cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1
sbc N2
sta HA ; accumulator result of N1-N2 using binary arithmetic
php
pla
sta HNVZC ; flags result of N1-N2 using binary arithmetic
rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S21
inx
and #$0F
clc
S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S22
sbc #$5F ; subtract $60 (carry is clear)
S22 cpx #0
beq S23
sbc #6
S23 sta AR ; predicted accumulator result
rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
COMPARE
if chk_a = 1
lda DA
cmp AR
bne C1
endif
if chk_n = 1
lda DNVZC ; [7] see text
eor NF
and #$80 ; mask off N flag
bne C1
endif
if chk_v = 1
lda DNVZC ; [8] see text
eor VF
and #$40 ; mask off V flag
bne C1 ; [9] see text
endif
if chk_z = 1
lda DNVZC
eor ZF ; mask off Z flag
and #2
bne C1 ; [10] see text
endif
if chk_c = 1
lda DNVZC
eor CF
and #1 ; mask off C flag
endif
C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
A6502 lda AR ; 65C02
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB2
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
end TEST

Binary file not shown.

View File

@ -0,0 +1,427 @@
:16000A00000000000000000000C38241007F001F71800FFF7F80BE
:20002000FF0F8F8F1702180219021A021B021F0103020402050206020B014E024F025002D4
:1A004000510252025302540255024A024B024C024D020302040204010501B1
:200200000000000000000000290060490060090060690060E90060C38241007F808000022A
:20022000860482008705830161412000E1C1A0808101800281018000010001028180818012
:200240007F80FF00010080800200001F71800FFF7F80FF0F8F8F00F11F00F0FFFFFFFFF068
:0A026000F00F00FF7F800280008095
:20040000D8A2FF9AA9008D0002A2054C3304A005D0084C120488888888888888888888F048
:20042000174C2104CACACACACACACACACACAF0DE4C3004D0F44C3504AD0002C900D0FEA9CA
:20044000018D0002A0FE8898AA1008186902EAEAEAEAEAEAEAEAEAEA497F8DE604A9004CB1
:20046000E504CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACAE7
:20048000CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA1C
:2004A000CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACAFC
:2004C000CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACADC
:2004E000CACACACACAF03ECACACACACACACACACACACACACACACACACACACACACACACACACA22
:20050000CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA9B
:20052000CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA7B
:20054000CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA5B
:20056000CACACACACACAEAEAEAEAEAF0084C6D05EAEAEAEAEAEAEAEAEAEAC000F0034C460E
:2005800004AD0002C901D0FEA9028D0002C001D0034C9105A900C900D0FE90FE30FEC9019A
:2005A000F0FEB0FE10FEAAE000D0FE90FE30FEE001F0FEB0FE10FEA8C000D0FE90FE30FE00
:2005C000C001F0FEB0FE10FEAD0002C902D0FEA9038D0002A2FF9AA95548A9AA48CDFE0145
:2005E000D0FEBA8AC9FDD0FE68C9AAD0FE68C955D0FECDFF01D0FEBAE0FFD0FEAD0002C9DE
:2006000003D0FEA9048D0002A9FF4828101A501B901CD01D30034C160670034C1B06B00359
:200620004C2006F00F4C25064C28064C2B064C2E064C310608BAE0FED0FE68C9FFD0FEBAB2
:20064000E0FFD0FEA9004828301A701BB01CF01D10034C520650034C570690034C5C06D062
:200660000F4C61064C64064C67064C6A064C6D060868C930D0FEA9024828D002F0034C7EED
:2006800006B00290034C8506300210034C8C06700250034C9306A9014828F002D0034C9EA2
:2006A000069002B0034CA506300210034CAC06700250034CB306A9804828F002D0034CBE83
:2006C00006B00290034CC506100230034CCC06700250034CD306A9404828F002D0034CDE23
:2006E00006B00290034CE506300210034CEC06500270034CF306A9FD4828F002D0034CFEC6
:20070000069002B0034C0507100230034C0C07500270034C1307A9FE4828D002F0034C1E21
:2007200007B00290034C2507100230034C2C07500270034C3307A97F4828D002F0034C3EFF
:20074000079002B0034C4507300210034C4C07500270034C5307A9BF4828D002F0034C5E1F
:20076000079002B0034C6507100230034C6C07700250034C7307AD0002C904D0FEA9058D61
:200780000002A255A0AAA9FF48A901284808C901D0FE6848C9FFD0FE28A90048A9002848F4
:2007A00008C900D0FE6848C930D0FE28A9FF48A9FF284808C9FFD0FE6848C9FFD0FE28A93E
:2007C0000048A901284808C901D0FE6848C930D0FE28A9FF48A900284808C900D0FE684820
:2007E000C9FFD0FE28A90048A9FF284808C9FFD0FE6848C930D0FE28A9FF48A900286808C4
:20080000C9FFD0FE6848C9FDD0FE28A90048A9FF286808C900D0FE6848C932D0FE28A9FFC5
:2008200048A9FE286808C901D0FE6848C97DD0FE28A90048A900286808C9FFD0FE6848C96C
:20084000B0D0FE28A9FF48A9FF286808C900D0FE6848C97FD0FE28A90048A9FE286808C944
:2008600001D0FE6848C930D0FE28E055D0FEC0AAD0FEAD0002C905D0FEA9068D0002A9009D
:2008800048A93C2849C308C9FFD0FE6848C9B0D0FE28A90048A9C32849C308C900D0FE68A2
:2008A00048C932D0FE28AD0002C906D0FEA9078D0002A224A042A90048A91828EA08C9181F
:2008C000D0FE6848C930D0FE28E024D0FEC042D0FEA2DBA0BDA9FF48A9E728EA08C9E7D015
:2008E000FE6848C9FFD0FE28E0DBD0FEC0BDD0FEAD0002C907D0FEA9088D0002A900482812
:20090000A946A241A0524CEF36EAEAD0FEE8E8F0FE10FE90FE50FEC9ECD0FEE042D0FEC025
:200920004FD0FECAC8C8C849AA4C3209EAEAD0FEE8E8F0FE30FE90FE50FEC946D0FEE04196
:20094000D0FEC052D0FEAD0002C908D0FEA9098D0002A9004828A949A24EA0446C1E37EAD0
:20096000D0FE88880888888828F0FE10FE90FE50FEC9E3D0FEE04FD0FEC03ED0FEBAE0FF1D
:20098000D0FEAD0002C909D0FEA90A8D0002A9004828A94AA253A052205D37088888882889
:2009A000F0FE10FE90FE50FEC9E0D0FEE054D0FEC04CD0FEBAE0FFD0FEAD0002C90AD0FE55
:2009C000A90B8D0002A90048A942A252A04B28008808888888C9E8D0FEE053D0FEC045D074
:2009E000FE68C930D0FEBAE0FFD0FEA9FF48A9BDA2ADA0B428008808888888C917D0FEE08C
:200A0000AED0FEC0AED0FE68C9FFD0FEBAE0FFD0FEAD0002C90BD0FEA90C8D0002A9FF4834
:200A20002818086848C9FED0FE2838086848C9FFD0FE2858086848C9FBD0FE287808684859
:200A4000C9FFD0FE28D8086848C9F7D0FE28F8086848C9FFD0FE28B8086848C9BFD0FE2836
:200A6000A9004828086848C930D0FE2838086848C931D0FE2818086848C930D0FE28780897
:200A80006848C934D0FE2858086848C930D0FE28F8086848C938D0FE28D8086848C930D0B4
:200AA000FE28A9404828086848C970D0FE28B8086848C930D0FE28AD0002C90CD0FEA90D69
:200AC0008D0002A2FEA9FF4828E808E0FFD0FE6848C9FDD0FE28E808E000D0FE6848C97F30
:200AE000D0FE28E808E001D0FE6848C97DD0FE28CA08E000D0FE6848C97FD0FE28CA08E055
:200B0000FFD0FE6848C9FDD0FE28CAA9004828E808E0FFD0FE6848C9B0D0FE28E808E0002D
:200B2000D0FE6848C932D0FE28E808E001D0FE6848C930D0FE28CA08E000D0FE6848C932DD
:200B4000D0FE28CA08E0FFD0FE6848C9B0D0FE28A0FEA9FF4828C808C0FFD0FE6848C9FD78
:200B6000D0FE28C808C000D0FE6848C97FD0FE28C808C001D0FE6848C97DD0FE288808C098
:200B800000D0FE6848C97FD0FE288808C0FFD0FE6848C9FDD0FE2888A9004828C808C0FFE0
:200BA000D0FE6848C9B0D0FE28C808C000D0FE6848C932D0FE28C808C001D0FE6848C93041
:200BC000D0FE288808C000D0FE6848C932D0FE288808C0FFD0FE6848C9B0D0FE28A2FFA9DA
:200BE000FF48288A08C9FFD0FE6848C9FDD0FE2808E8288A08C900D0FE6848C97FD0FE28C3
:200C000008E8288A08C901D0FE6848C97DD0FE28A90048288A08C901D0FE6848C930D0FEEC
:200C20002808CA288A08C900D0FE6848C932D0FE2808CA288A08C9FFD0FE6848C9B0D0FEAF
:200C400028A0FFA9FF48289808C9FFD0FE6848C9FDD0FE2808C8289808C900D0FE6848C96B
:200C60007FD0FE2808C8289808C901D0FE6848C97DD0FE28A90048289808C901D0FE6848E2
:200C8000C930D0FE280888289808C900D0FE6848C932D0FE280888289808C9FFD0FE684837
:200CA000C9B0D0FE28A9FF48A2FF8A28A808C0FFD0FE6848C9FDD0FE2808E88A28A808C0C7
:200CC00000D0FE6848C97FD0FE2808E88A28A808C001D0FE6848C97DD0FE28A90048A900F1
:200CE0008A28A808C001D0FE6848C930D0FE2808CA8A28A808C000D0FE6848C932D0FE2801
:200D000008CA8A28A808C0FFD0FE6848C9B0D0FE28A9FF48A0FF9828AA08E0FFD0FE684895
:200D2000C9FDD0FE2808C89828AA08E000D0FE6848C97FD0FE2808C89828AA08E001D0FE28
:200D40006848C97DD0FE28A90048A9009828AA08E001D0FE6848C930D0FE2808889828AA53
:200D600008E000D0FE6848C932D0FE2808889828AA08E0FFD0FE6848C9B0D0FE28AD00029F
:200D8000C90DD0FEA90E8D0002A201A9FF48289A08AD0101C9FFD0FEA90048289A08AD015E
:200DA00001C930D0FECAA9FF48289A08AD0001C9FFD0FEA90048289A08AD0001C930D0FE73
:200DC000CAA9FF48289A08ADFF01C9FFD0FEA90048289A08ADFF01C930A2019AA9FF482896
:200DE000BA08E001D0FEAD0101C97DD0FEA9FF4828BA08E000D0FEAD0001C97FD0FEA9FFCB
:200E00004828BA08E0FFD0FEADFF01C9FDD0FEA2019AA9004828BA08E001D0FEAD0101C973
:200E200030D0FEA9004828BA08E000D0FEAD0001C932D0FEA9004828BA08E0FFD0FEADFF80
:200E400001C9B0D0FE68AD0002C90ED0FEA90F8D0002A003A9004828B613088A49C3289963
:200E600003020849C3D91702D0FE684930D91C02D0FE8810DFA003A9FF4828B613088A491D
:200E8000C3289903020849C3D91702D0FE68497DD91C02D0FE8810DFA003A9004828BE17FA
:200EA00002088A49C3AA28960C0849C3D91300D0FE684930D91C02D0FE8810DEA003A9FFE9
:200EC0004828BE1702088A49C3AA28960C0849C3D91300D0FE68497DD91C02D0FE8810DE82
:200EE000A003A200B90C0049C3D91300D0FE960CB9030249C3D91702D0FE8A990302881036
:200F0000E3AD0002C90FD0FEA9108D0002A0FDB6198A99090188C0FAB0F5A0FDBE1D0196C2
:200F20001288C0FAB0F6A003A200B90C00D91300D0FE960CB90302D91702D0FE8A990302AB
:200F40008810E7AD0002C910D0FEA9118D0002A203A9004828B413089849C3289D03020870
:200F600049C3DD1702D0FE684930DD1C02D0FECA10DFA203A9FF4828B413089849C3289D49
:200F800003020849C3DD1702D0FE68497DDD1C02D0FECA10DFA203A9004828BC1702089891
:200FA00049C3A828940C0849C3D513D0FE684930DD1C02D0FECA10DFA203A9FF4828BC17F8
:200FC00002089849C3A828940C0849C3D513D0FE68497DDD1C02D0FECA10DFA203A000B57F
:200FE0000C49C3D513D0FE940CBD030249C3DD1702D0FE8A9D0302CA10E5AD0002C911D0AD
:20100000FEA9128D0002A2FDB419989D0901CAE0FAB0F5A2FDBC1D019412CAE0FAB0F6A289
:2010200003A000B50CD513D0FE940CBD0302DD1702D0FE8A9D0302CA10E9AD0002C912D027
:20104000FEA9138D0002A9004828A613088A49C3AA288E03020849C3AAE0C3D0FE68493062
:20106000CD1C02D0FEA9004828A614088A49C3AA288E04020849C3AAE082D0FE684930CD44
:201080001D02D0FEA9004828A615088A49C3AA288E05020849C3AAE041D0FE684930CD1E11
:2010A00002D0FEA9004828A616088A49C3AA288E06020849C3AAE000D0FE684930CD1F024A
:2010C000D0FEA9FF4828A613088A49C3AA288E03020849C3AAE0C3D0FE68497DCD1C02D056
:2010E000FEA9FF4828A614088A49C3AA288E04020849C3AAE082D0FE68497DCD1D02D0FE46
:20110000A9FF4828A615088A49C3AA288E05020849C3AAE041D0FE68497DCD1E02D0FEA9B8
:20112000FF4828A616088A49C3AA288E06020849C3AAE000D0FE68497DCD1F02D0FEA9007F
:201140004828AE1702088A49C3AA28860C0849C3C513D0FE684930CD1C02D0FEA9004828E9
:20116000AE1802088A49C3AA28860D0849C3C514D0FE684930CD1D02D0FEA9004828AE196E
:2011800002088A49C3AA28860E0849C3C515D0FE684930CD1E02D0FEA9004828AE1A020806
:2011A0008A49C3AA28860F0849C3C516D0FE684930CD1F02D0FEA9FF4828AE1702088A491E
:2011C000C3AA28860C0849C3AAE413D0FE68497DCD1C02D0FEA9FF4828AE1802088A49C300
:2011E000AA28860D0849C3AAE414D0FE68497DCD1D02D0FEA9FF4828AE1902088A49C3AAF5
:2012000028860E0849C3AAE415D0FE68497DCD1E02D0FEA9FF4828AE1A02088A49C3AA2852
:20122000860F0849C3AAE416D0FE68497DCD1F02D0FEA9004828A2C308EC1702D0FE68499F
:2012400030CD1C02D0FEA9004828A28208EC1802D0FE684930CD1D02D0FEA9004828A241F5
:2012600008EC1902D0FE684930CD1E02D0FEA9004828A20008EC1A02D0FE684930CD1F028D
:20128000D0FEA9FF4828A2C308EC1702D0FE68497DCD1C02D0FEA9FF4828A28208EC1802F7
:2012A000D0FE68497DCD1D02D0FEA9FF4828A24108EC1902D0FE68497DCD1E02D0FEA9FF0F
:2012C0004828A20008EC1A02D0FE68497DCD1F02D0FEA200A50C49C3C513D0FE860CAD03ED
:2012E0000249C3CD1702D0FE8E0302A50D49C3C514D0FE860DAD040249C3CD1802D0FE8E9F
:201300000402A50E49C3C515D0FE860EAD050249C3CD1902D0FE8E0502A50F49C3C516D056
:20132000FE860FAD060249C3CD1A02D0FE8E0602AD0002C913D0FEA9148D0002A90048284E
:20134000A413089849C3A8288C03020849C3A8C0C3D0FE684930CD1C02D0FEA9004828A465
:2013600014089849C3A8288C04020849C3A8C082D0FE684930CD1D02D0FEA9004828A41512
:20138000089849C3A8288C05020849C3A8C041D0FE684930CD1E02D0FEA9004828A416083C
:2013A0009849C3A8288C06020849C3A8C000D0FE684930CD1F02D0FEA9FF4828A4130898CF
:2013C00049C3A8288C03020849C3A8C0C3D0FE68497DCD1C02D0FEA9FF4828A414089849F3
:2013E000C3A8288C04020849C3A8C082D0FE68497DCD1D02D0FEA9FF4828A415089849C397
:20140000A8288C05020849C3A8C041D0FE68497DCD1E02D0FEA9FF4828A416089849C3A8CF
:20142000288C06020849C3A8C000D0FE68497DCD1F02D0FEA9004828AC1702089849C3A88A
:2014400028840C0849C3A8C413D0FE684930CD1C02D0FEA9004828AC1802089849C3A8287E
:20146000840D0849C3A8C414D0FE684930CD1D02D0FEA9004828AC1902089849C3A82884FE
:201480000E0849C3A8C415D0FE684930CD1E02D0FEA9004828AC1A02089849C3A828840F4F
:2014A0000849C3A8C416D0FE684930CD1F02D0FEA9FF4828AC1702089849C3A828840C083A
:2014C00049C3A8C513D0FE68497DCD1C02D0FEA9FF4828AC1802089849C3A828840D08498F
:2014E000C3A8C514D0FE68497DCD1D02D0FEA9FF4828AC1902089849C3A828840E0849C3F1
:20150000A8C515D0FE68497DCD1E02D0FEA9FF4828AC1A02089849C3A828840F0849C3A8E7
:20152000C516D0FE68497DCD1F02D0FEA9004828A0C308CC1702D0FE684930CD1C02D0FE47
:20154000A9004828A08208CC1802D0FE684930CD1D02D0FEA9004828A04108CC1902D0FE42
:20156000684930CD1E02D0FEA9004828A00008CC1A02D0FE684930CD1F02D0FEA9FF4828A3
:20158000A0C308CC1702D0FE68497DCD1C02D0FEA9FF4828A08208CC1802D0FE68497DCD55
:2015A0001D02D0FEA9FF4828A04108CC1902D0FE68497DCD1E02D0FEA9FF4828A00008CC13
:2015C0001A02D0FE68497DCD1F02D0FEA000A50C49C3C513D0FE840CAD030249C3CD170200
:2015E000D0FE8C0302A50D49C3C514D0FE840DAD040249C3CD1802D0FE8C0402A50E49C3D1
:20160000C515D0FE840EAD050249C3CD1902D0FE8C0502A50F49C3C516D0FE840FAD0602D6
:2016200049C3CD1A02D0FE8C0602AD0002C914D0FEA9158D0002A203A9004828B5130849D5
:20164000C3289D03020849C3DD1702D0FE684930DD1C02D0FECA10E0A203A9FF4828B5133C
:201660000849C3289D03020849C3DD1702D0FE68497DDD1C02D0FECA10E0A203A900482845
:20168000BD17020849C328950C0849C3D513D0FE684930DD1C02D0FECA10E1A203A9FF48D3
:2016A00028BD17020849C328950C0849C3D513D0FE68497DDD1C02D0FECA10E1A203A0008E
:2016C000B50C49C3D513D0FE940CBD030249C3DD1702D0FE8A9D0302CA10E5AD0002C915DD
:2016E000D0FEA9168D0002A003A9004828B1240849C3289903020849C3D91702D0FE6849DE
:2017000030D91C02D0FE8810E0A003A9FF4828B1240849C3289903020849C3D91702D0FE1E
:2017200068497DD91C02D0FE8810E0A003A200B9030249C3D91702D0FE8A9903028810EFC0
:20174000A003A9004828B917020849C32891300849C3D124D0FE684930D91C02D0FE8810E9
:20176000E1A003A9FF4828B917020849C32891300849C3D124D0FE68497DD91C02D0FE88AC
:2017800010E1A003A200B9030249C3D91702D0FE8A9903028810EFA206A003A9004828A1D5
:2017A000240849C32881300849C3D91702D0FE684930D91C02D0FECACA8810DFA206A00348
:2017C000A9FF4828A1240849C32881300849C3D91702D0FE68497DD91C02D0FECACA88104C
:2017E000DFA003A200B9030249C3D91702D0FE8A9903028810EFAD0002C916D0FEA9178DE3
:201800000002A2FDB5199D0901CAE0FAB0F6A2FDBD1D019512CAE0FAB0F6A203A000B50CF7
:20182000D513D0FE940CBD0302DD1702D0FE8A9D0302CA10E9A0FBA2FEA12C990B01CACA9C
:2018400088C0F8B0F4A003A200B90302D91702D0FE8A9903028810F1A0FBB91F019138886B
:20186000C0F8B0F6A003A200B90302D91702D0FE8A9903028810F1A0FBA2FEB12E8138CAF9
:20188000CA88C0F8B0F5A003A200B90302D91702D0FE8A9903028810F1AD0002C917D0FEC8
:2018A000A9188D0002A9004828A5130849C3288D03020849C3C9C3D0FE684930CD1C02D02F
:2018C000FEA9004828A5140849C3288D04020849C3C982D0FE684930CD1D02D0FEA90048B0
:2018E00028A5150849C3288D05020849C3C941D0FE684930CD1E02D0FEA9004828A51608D2
:2019000049C3288D06020849C3C900D0FE684930CD1F02D0FEA9FF4828A5130849C3288D1D
:2019200003020849C3C9C3D0FE68497DCD1C02D0FEA9FF4828A5140849C3288D040208495C
:20194000C3C982D0FE68497DCD1D02D0FEA9FF4828A5150849C3288D05020849C3C941D033
:20196000FE68497DCD1E02D0FEA9FF4828A5160849C3288D06020849C3C900D0FE68497D03
:20198000CD1F02D0FEA9004828AD17020849C328850C0849C3C513D0FE684930CD1C02D089
:2019A000FEA9004828AD18020849C328850D0849C3C514D0FE684930CD1D02D0FEA9004834
:2019C00028AD19020849C328850E0849C3C515D0FE684930CD1E02D0FEA9004828AD1A020E
:2019E0000849C328850F0849C3C516D0FE684930CD1F02D0FEA9FF4828AD17020849C328A3
:201A0000850C0849C3C513D0FE68497DCD1C02D0FEA9FF4828AD18020849C328850D084996
:201A2000C3C514D0FE68497DCD1D02D0FEA9FF4828AD19020849C328850E0849C3C515D0E7
:201A4000FE68497DCD1E02D0FEA9FF4828AD1A020849C328850F0849C3C516D0FE68497D03
:201A6000CD1F02D0FEA9004828A9C308CD1702D0FE684930CD1C02D0FEA9004828A9820883
:201A8000CD1802D0FE684930CD1D02D0FEA9004828A94108CD1902D0FE684930CD1E02D097
:201AA000FEA9004828A90008CD1A02D0FE684930CD1F02D0FEA9FF4828A9C308CD1702D0C8
:201AC000FE68497DCD1C02D0FEA9FF4828A98208CD1802D0FE68497DCD1D02D0FEA9FF4849
:201AE00028A94108CD1902D0FE68497DCD1E02D0FEA9FF4828A90008CD1A02D0FE68497D7F
:201B0000CD1F02D0FEA200A50C49C3C513D0FE860CAD030249C3CD1702D0FE8E0302A50DBB
:201B200049C3C514D0FE860DAD040249C3CD1802D0FE8E0402A50E49C3C515D0FE860EADAF
:201B4000050249C3CD1902D0FE8E0502A50F49C3C516D0FE860FAD060249C3CD1A02D0FEB1
:201B60008E0602AD0002C918D0FEA9198D0002A90048A9FF28241608C9FFD0FE6848C932DC
:201B8000D0FE28A90048A90128241508C901D0FE6848C970D0FE28A90048A90128241408D1
:201BA000C901D0FE6848C9B2D0FE28A90048A90128241308C901D0FE6848C9F0D0FE28A9CA
:201BC000FF48A9FF28241608C9FFD0FE6848C93FD0FE28A9FF48A90128241508C901D0FECD
:201BE0006848C97DD0FE28A9FF48A90128241408C901D0FE6848C9BFD0FE28A9FF48A90197
:201C000028241308C901D0FE6848C9FDD0FE28A90048A9FF282C1A0208C9FFD0FE6848C939
:201C200032D0FE28A90048A901282C190208C901D0FE6848C970D0FE28A90048A901282C04
:201C4000180208C901D0FE6848C9B2D0FE28A90048A901282C170208C901D0FE6848C9F098
:201C6000D0FE28A9FF48A9FF282C1A0208C9FFD0FE6848C93FD0FE28A9FF48A901282C1913
:201C80000208C901D0FE6848C97DD0FE28A9FF48A901282C180208C901D0FE6848C9BFD006
:201CA000FE28A9FF48A901282C170208C901D0FE6848C9FDD0FE28AD0002C919D0FEA91AC9
:201CC0008D0002A90048A28028E417086848C931D0FE28CAE417086848C933D0FE28CAE47A
:201CE0001708E07ED0FE6848C9B0D0FE28A9FF48A28028E417086848C97DD0FE28CAE4178C
:201D0000086848C97FD0FE28CAE41708E07ED0FE6848C9FCD0FE28A90048A28028EC1B0225
:201D2000086848C931D0FE28CAEC1B02086848C933D0FE28CAEC1B0208E07ED0FE6848C9FE
:201D4000B0D0FE28A9FF48A28028EC1B02086848C97DD0FE28CAEC1B02086848C97FD0FE05
:201D600028CAEC1B0208E07ED0FE6848C9FCD0FE28A90048A28028E07F086848C931D0FEAF
:201D800028CAE07F086848C933D0FE28CAE07F08E07ED0FE6848C9B0D0FE28A9FF48A280BA
:201DA00028E07F086848C97DD0FE28CAE07F086848C97FD0FE28CAE07F08E07ED0FE68487C
:201DC000C9FCD0FE28AD0002C91AD0FEA91B8D0002A90048A08028C417086848C931D0FE01
:201DE0002888C417086848C933D0FE2888C41708C07ED0FE6848C9B0D0FE28A9FF48A08008
:201E000028C417086848C97DD0FE2888C417086848C97FD0FE2888C41708C07ED0FE68484B
:201E2000C9FCD0FE28A90048A08028CC1B02086848C931D0FE2888CC1B02086848C933D028
:201E4000FE2888CC1B0208C07ED0FE6848C9B0D0FE28A9FF48A08028CC1B02086848C97D99
:201E6000D0FE2888CC1B02086848C97FD0FE2888CC1B0208C07ED0FE6848C9FCD0FE28A96C
:201E80000048A08028C07F086848C931D0FE2888C07F086848C933D0FE2888C07F08C07E4D
:201EA000D0FE6848C9B0D0FE28A9FF48A08028C07F086848C97DD0FE2888C07F086848C982
:201EC0007FD0FE2888C07F08C07ED0FE6848C9FCD0FE28AD0002C91BD0FEA91C8D0002A9E9
:201EE0000048A98028C51708C980D0FE6848C931D0FE28A90048A97F28C51708C97FD0FE73
:201F00006848C933D0FE28A90048A97E28C51708C97ED0FE6848C9B0D0FE28A9FF48A980AE
:201F200028C51708C980D0FE6848C97DD0FE28A9FF48A97F28C51708C97FD0FE6848C97F60
:201F4000D0FE28A9FF48A97E28C51708C97ED0FE6848C9FCD0FE28A90048A98028CD1B02BC
:201F600008C980D0FE6848C931D0FE28A90048A97F28CD1B0208C97FD0FE6848C933D0FEDF
:201F800028A90048A97E28CD1B0208C97ED0FE6848C9B0D0FE28A9FF48A98028CD1B020880
:201FA000C980D0FE6848C97DD0FE28A9FF48A97F28CD1B0208C97FD0FE6848C97FD0FE28E8
:201FC000A9FF48A97E28CD1B0208C97ED0FE6848C9FCD0FE28A90048A98028C97F08C98075
:201FE000D0FE6848C931D0FE28A90048A97F28C97F08C97FD0FE6848C933D0FE28A9004839
:20200000A97E28C97F08C97ED0FE6848C9B0D0FE28A9FF48A98028C97F08C980D0FE684895
:20202000C97DD0FE28A9FF48A97F28C97F08C97FD0FE6848C97FD0FE28A9FF48A97E28C9C8
:202040007F08C97ED0FE6848C9FCD0FE28A204A90048A98028D51308C980D0FE6848C931E0
:20206000D0FE28A90048A97F28D51308C97FD0FE6848C933D0FE28A90048A97E28D5130851
:20208000C97ED0FE6848C9B0D0FE28A9FF48A98028D51308C980D0FE6848C97DD0FE28A92F
:2020A000FF48A97F28D51308C97FD0FE6848C97FD0FE28A9FF48A97E28D51308C97ED0FE51
:2020C0006848C9FCD0FE28A90048A98028DD170208C980D0FE6848C931D0FE28A90048A904
:2020E0007F28DD170208C97FD0FE6848C933D0FE28A90048A97E28DD170208C97ED0FE68C8
:2021000048C9B0D0FE28A9FF48A98028DD170208C980D0FE6848C97DD0FE28A9FF48A97FAE
:2021200028DD170208C97FD0FE6848C97FD0FE28A9FF48A97E28DD170208C97ED0FE684873
:20214000C9FCD0FE28A004A208A90048A98028D9170208C980D0FE6848C931D0FE28A900DA
:2021600048A97F28D9170208C97FD0FE6848C933D0FE28A90048A97E28D9170208C97ED0C4
:20218000FE6848C9B0D0FE28A9FF48A98028D9170208C980D0FE6848C97DD0FE28A9FF48F4
:2021A000A97F28D9170208C97FD0FE6848C97FD0FE28A9FF48A97E28D9170208C97ED0FE83
:2021C0006848C9FCD0FE28A90048A98028C12408C980D0FE6848C931D0FE28A90048A97F95
:2021E00028C12408C97FD0FE6848C933D0FE28A90048A97E28C12408C97ED0FE6848C9B0A7
:20220000D0FE28A9FF48A98028C12408C980D0FE6848C97DD0FE28A9FF48A97F28C124086A
:20222000C97FD0FE6848C97FD0FE28A9FF48A97E28C12408C97ED0FE6848C9FCD0FE28A945
:202240000048A98028D12408C980D0FE6848C931D0FE28A90048A97F28D12408C97FD0FEDD
:202260006848C933D0FE28A90048A97E28D12408C97ED0FE6848C9B0D0FE28A9FF48A98032
:2022800028D12408C980D0FE6848C97DD0FE28A9FF48A97F28D12408C97FD0FE6848C97FCB
:2022A000D0FE28A9FF48A97E28D12408C97ED0FE6848C9FCD0FE28AD0002C91CD0FEA91D44
:2022C0008D0002A203A90048B513280A08DD2002D0FE684930DD3002D0FECA10E8A203A93C
:2022E000FF48B513280A08DD2002D0FE68497CDD3002D0FECA10E8A203A90048B513284A2C
:2023000008DD2802D0FE684930DD3802D0FECA10E8A203A9FF48B513284A08DD2802D0FEAC
:2023200068497CDD3802D0FECA10E8A203A90048B513282A08DD2002D0FE684930DD300254
:20234000D0FECA10E8A203A9FE48B513282A08DD2002D0FE68497CDD3002D0FECA10E8A2FC
:2023600003A90148B513282A08DD2402D0FE684930DD3402D0FECA10E8A203A9FF48B51394
:20238000282A08DD2402D0FE68497CDD3402D0FECA10E8A203A90048B513286A08DD280243
:2023A000D0FE684930DD3802D0FECA10E8A203A9FE48B513286A08DD2802D0FE68497CDDF2
:2023C0003802D0FECA10E8A203A90148B513286A08DD2C02D0FE684930DD3C02D0FECA10BD
:2023E000E8A203A9FF48B513286A08DD2C02D0FE68497CDD3C02D0FECA10E8AD0002C91DB8
:20240000D0FEA91E8D0002A203A90048B513850C28060C08A50CDD2002D0FE684930DD30FB
:2024200002D0FECA10E3A203A9FF48B513850C28060C08A50CDD2002D0FE68497CDD300225
:20244000D0FECA10E3A203A90048B513850C28460C08A50CDD2802D0FE684930DD3802D032
:20246000FECA10E3A203A9FF48B513850C28460C08A50CDD2802D0FE68497CDD3802D0FE99
:20248000CA10E3A203A90048B513850C28260C08A50CDD2002D0FE684930DD3002D0FECA28
:2024A00010E3A203A9FE48B513850C28260C08A50CDD2002D0FE68497CDD3002D0FECA1078
:2024C000E3A203A90148B513850C28260C08A50CDD2402D0FE684930DD3402D0FECA10E3C6
:2024E000A203A9FF48B513850C28260C08A50CDD2402D0FE68497CDD3402D0FECA10E3A29D
:2025000003A90048B513850C28660C08A50CDD2802D0FE684930DD3802D0FECA10E3A2031E
:20252000A9FE48B513850C28660C08A50CDD2802D0FE68497CDD3802D0FECA10E3A203A90E
:202540000148B513850C28660C08A50CDD2C02D0FE684930DD3C02D0FECA10E3A203A9FFD9
:2025600048B513850C28660C08A50CDD2C02D0FE68497CDD3C02D0FECA10E3AD0002C91E25
:20258000D0FEA91F8D0002A203A90048B5138D0302280E030208AD0302DD2002D0FE6849B3
:2025A00030DD3002D0FECA10E0A203A9FF48B5138D0302280E030208AD0302DD2002D0FEA3
:2025C00068497CDD3002D0FECA10E0A203A90048B5138D0302284E030208AD0302DD28020B
:2025E000D0FE684930DD3802D0FECA10E0A203A9FF48B5138D0302284E030208AD0302DD8C
:202600002802D0FE68497CDD3802D0FECA10E0A203A90048B5138D0302282E030208AD03F3
:2026200002DD2002D0FE684930DD3002D0FECA10E0A203A9FE48B5138D0302282E03020802
:20264000AD0302DD2002D0FE68497CDD3002D0FECA10E0A203A90148B5138D0302282E03ED
:202660000208AD0302DD2402D0FE684930DD3402D0FECA10E0A203A9FF48B5138D0302283A
:202680002E030208AD0302DD2402D0FE68497CDD3402D0FECA10E0A203A90048B5138D03C6
:2026A00002286E030208AD0302DD2802D0FE684930DD3802D0FECA10E0A203A9FE48B51312
:2026C0008D0302286E030208AD0302DD2802D0FE68497CDD3802D0FECA10E0A203A90148DB
:2026E000B5138D0302286E030208AD0302DD2C02D0FE684930DD3C02D0FECA10E0A203A980
:20270000FF48B5138D0302286E030208AD0302DD2C02D0FE68497CDD3C02D0FECA10E0AD6D
:202720000002C91FD0FEA9208D0002A203A90048B513950C28160C08B50CDD2002D0FE6842
:202740004930DD3002D0FECA10E3A203A9FF48B513950C28160C08B50CDD2002D0FE6849D7
:202760007CDD3002D0FECA10E3A203A90048B513950C28560C08B50CDD2802D0FE6849303B
:20278000DD3802D0FECA10E3A203A9FF48B513950C28560C08B50CDD2802D0FE68497CDD67
:2027A0003802D0FECA10E3A203A90048B513950C28360C08B50CDD2002D0FE684930DD3067
:2027C00002D0FECA10E3A203A9FE48B513950C28360C08B50CDD2002D0FE68497CDD300233
:2027E000D0FECA10E3A203A90148B513950C28360C08B50CDD2402D0FE684930DD3402D086
:20280000FECA10E3A203A9FF48B513950C28360C08B50CDD2402D0FE68497CDD3402D0FEED
:20282000CA10E3A203A90048B513950C28760C08B50CDD2802D0FE684930DD3802D0FECA04
:2028400010E3A203A9FE48B513950C28760C08B50CDD2802D0FE68497CDD3802D0FECA1054
:20286000E3A203A90148B513950C28760C08B50CDD2C02D0FE684930DD3C02D0FECA10E3A2
:20288000A203A9FF48B513950C28760C08B50CDD2C02D0FE68497CDD3C02D0FECA10E3AD6E
:2028A0000002C920D0FEA9218D0002A203A90048B5139D0302281E030208BD0302DD2002F2
:2028C000D0FE684930DD3002D0FECA10E0A203A9FF48B5139D0302281E030208BD0302DDC1
:2028E0002002D0FE68497CDD3002D0FECA10E0A203A90048B5139D0302285E030208BD03D1
:2029000002DD2802D0FE684930DD3802D0FECA10E0A203A9FF48B5139D0302285E030208CE
:20292000BD0302DD2802D0FE68497CDD3802D0FECA10E0A203A90048B5139D0302283E03CB
:202940000208BD0302DD2002D0FE684930DD3002D0FECA10E0A203A9FE48B5139D03022840
:202960003E030208BD0302DD2002D0FE68497CDD3002D0FECA10E0A203A90148B5139D03BA
:2029800002283E030208BD0302DD2402D0FE684930DD3402D0FECA10E0A203A9FF48B51356
:2029A0009D0302283E030208BD0302DD2402D0FE68497CDD3402D0FECA10E0A203A9004811
:2029C000B5139D0302287E030208BD0302DD2802D0FE684930DD3802D0FECA10E0A203A975
:2029E000FE48B5139D0302287E030208BD0302DD2802D0FE68497CDD3802D0FECA10E0A26F
:202A000003A90148B5139D0302287E030208BD0302DD2C02D0FE684930DD3C02D0FECA1065
:202A2000E0A203A9FF48B5139D0302287E030208BD0302DD2C02D0FE68497CDD3C02D0FE53
:202A4000CA10E0AD0002C921D0FEA9228D0002A200A97E850CA9004828E60C08A50CDD40C0
:202A600002D0FE684930DD4502D0FEE8E002D004A9FE850CE005D0DDCAE60CA9004828C6B0
:202A80000C08A50CDD4002D0FE684930DD4502D0FECA300AE001D0E3A981850CD0DDA2000F
:202AA000A97E850CA9FF4828E60C08A50CDD4002D0FE68497DDD4502D0FEE8E002D004A947
:202AC000FE850CE005D0DDCAE60CA9FF4828C60C08A50CDD4002D0FE68497DDD4502D0FE69
:202AE000CA300AE001D0E3A981850CD0DDAD0002C922D0FEA9238D0002A200A97E8D0302B8
:202B0000A9004828EE030208AD0302DD4002D0FE684930DD4502D0FEE8E002D005A9FE8D5C
:202B20000302E005D0DACAEE0302A9004828CE030208AD0302DD4002D0FE684930DD4502AC
:202B4000D0FECA300BE001D0E1A9818D0302D0DAA200A97E8D0302A9FF4828EE030208AD8F
:202B60000302DD4002D0FE68497DDD4502D0FEE8E002D005A9FE8D0302E005D0DACAEE0321
:202B800002A9FF4828CE030208AD0302DD4002D0FE68497DDD4502D0FECA300BE001D0E1EA
:202BA000A9818D0302D0DAAD0002C923D0FEA9248D0002A200A97E950CA9004828F60C085D
:202BC000B50CDD4002D0FE684930DD4502D0FEB50CE8E002D002A9FEE005D0DBCAA90295D6
:202BE0000CA9004828D60C08B50CDD4002D0FE684930DD4502D0FEB50CCA3008E001D0DFF2
:202C0000A981D0DBA200A97E950CA9FF4828F60C08B50CDD4002D0FE68497DDD4502D0FE85
:202C2000B50CE8E002D002A9FEE005D0DBCAA902950CA9FF4828D60C08B50CDD4002D0FE3A
:202C400068497DDD4502D0FEB50CCA3008E001D0DFA981D0DBAD0002C924D0FEA9258D0067
:202C600002A200A97E9D0302A9004828FE030208BD0302DD4002D0FE684930DD4502D0FE41
:202C8000BD0302E8E002D002A9FEE005D0D7CAA9029D0302A9004828DE030208BD0302DDE9
:202CA0004002D0FE684930DD4502D0FEBD0302CA3008E001D0DBA981D0D7A200A97E9D03A7
:202CC00002A9FF4828FE030208BD0302DD4002D0FE68497DDD4502D0FEBD0302E8E002D0A4
:202CE00002A9FEE005D0D7CAA9029D0302A9FF4828DE030208BD0302DD4002D0FE68497DA8
:202D0000DD4502D0FEBD0302CA3008E001D0DBA981D0D7AD0002C925D0FEA9268D0002A235
:202D200003B51C8D0902A90048BD5A022820080208DD6202D0FE684930DD6602D0FECA10E6
:202D4000E0A203B51C8D0902A9FF48BD5A022820080208DD6202D0FE68497DDD6602D0FED2
:202D6000CA10E0A203B51C850CA90048BD5A0228250C08DD6202D0FE684930DD6602D0FE24
:202D8000CA10E2A203B51C850CA9FF48BD5A0228250C08DD6202D0FE68497DDD6602D0FEB6
:202DA000CA10E2A203B51C8D0302A90048BD5A02282D030208DD6202D0FE684930DD6602AE
:202DC000D0FECA10E0A203B51C8D0302A9FF48BD5A02282D030208DD6202D0FE68497DDDDE
:202DE0006602D0FECA1002A203A90048BD5A0228351C08DD6202D0FE684930DD6602D0FE8E
:202E0000CA10E6A203A9FF48BD5A0228351C08DD6202D0FE68497DDD6602D0FECA10E6A211
:202E200003A90048BD5A02283D4E0208DD6202D0FE684930DD6602D0FECA10E5A203A9FFB9
:202E400048BD5A02283D4E0208DD6202D0FE68497DDD6602D0FECA10E5A003A90048B95A9E
:202E60000228394E0208D96202D0FE684930D96602D0FE8810E5A003A9FF48B95A02283916
:202E80004E0208D96202D0FE68497DD96602D0FE8810E5A206A003A90048B95A0228213A41
:202EA00008D96202D0FE684930D96602D0FECACA8810E4A206A003A9FF48B95A0228213A2C
:202EC00008D96202D0FE68497DD96602D0FECACA8810E4A003A90048B95A0228313A08D975
:202EE0006202D0FE684930D96602D0FE8810E6A003A9FF48B95A0228313A08D96202D0FEE4
:202F000068497DD96602D0FE8810E6AD0002C926D0FEA9278D0002A203B5208D0C02A9006D
:202F200048BD5E0228200B0208DD6202D0FE684930DD6602D0FECA10E0A203B5208D0C02FD
:202F4000A9FF48BD5E0228200B0208DD6202D0FE68497DDD6602D0FECA10E0A203B52085FE
:202F60000CA90048BD5E0228450C08DD6202D0FE684930DD6602D0FECA10E2A203B52085F8
:202F80000CA9FF48BD5E0228450C08DD6202D0FE68497DDD6602D0FECA10E2A203B5208D84
:202FA0000302A90048BD5E02284D030208DD6202D0FE684930DD6602D0FECA10E0A203B565
:202FC000208D0302A9FF48BD5E02284D030208DD6202D0FE68497DDD6602D0FECA1002A2E2
:202FE00003A90048BD5E0228552008DD6202D0FE684930DD6602D0FECA10E6A203A9FF48C3
:20300000BD5E0228552008DD6202D0FE68497DDD6602D0FECA10E6A203A90048BD5E022803
:203020005D520208DD6202D0FE684930DD6602D0FECA10E5A203A9FF48BD5E02285D52028A
:2030400008DD6202D0FE68497DDD6602D0FECA10E5A003A90048B95E022859520208D96294
:2030600002D0FE684930D96602D0FE8810E5A003A9FF48B95E022859520208D96202D0FE7F
:2030800068497DD96602D0FE8810E5A206A003A90048B95E0228414208D96202D0FE6849B2
:2030A00030D96602D0FECACA8810E4A206A003A9FF48B95E0228414208D96202D0FE6849FE
:2030C0007DD96602D0FECACA8810E4A003A90048B95E0228514208D96202D0FE684930D91F
:2030E0006602D0FE8810E6A003A9FF48B95E0228514208D96202D0FE68497DD96602D0FE65
:203100008810E6AD0002C927D0FEA9288D0002A203B5188D0F02A90048BD560228200E02F6
:2031200008DD6202D0FE684930DD6602D0FECA10E0A203B5188D0F02A9FF48BD560228206D
:203140000E0208DD6202D0FE68497DDD6602D0FECA10E0A203B518850CA90048BD5602281C
:20316000050C08DD6202D0FE684930DD6602D0FECA10E2A203B518850CA9FF48BD56022847
:20318000050C08DD6202D0FE68497DDD6602D0FECA10E2A203B5188D0302A90048BD560200
:2031A000280D030208DD6202D0FE684930DD6602D0FECA10E0A203B5188D0302A9FF48BD5F
:2031C0005602280D030208DD6202D0FE68497DDD6602D0FECA1002A203A90048BD56022856
:2031E000151808DD6202D0FE684930DD6602D0FECA10E6A203A9FF48BD560228151808DDF3
:203200006202D0FE68497DDD6602D0FECA10E6A203A90048BD5602281D4A0208DD6202D026
:20322000FE684930DD6602D0FECA10E5A203A9FF48BD5602281D4A0208DD6202D0FE6849DA
:203240007DDD6602D0FECA10E5A003A90048B9560228194A0208D96202D0FE684930D966BA
:2032600002D0FE8810E5A003A9FF48B9560228194A0208D96202D0FE68497DD96602D0FE80
:203280008810E5A206A003A90048B9560228014A08D96202D0FE684930D96602D0FECACA5A
:2032A0008810E4A206A003A9FF48B9560228014A08D96202D0FE68497DD96602D0FECACAEF
:2032C0008810E4A003A90048B9560228114A08D96202D0FE684930D96602D0FE8810E6A029
:2032E00003A9FF48B9560228114A08D96202D0FE68497DD96602D0FE8810E658AD0002C9A9
:2033000028D0FEA9298D0002D8A20EA0FFA900850C850D850E8D0302850F8510A9FF8512D6
:203320008D0402A90285111820A235E60CE60F080868298228D002E610051085113820A20B
:2033400035C60CE60DD0E0A9008510EE0302E60E086829828511C612CE0402A50E850FD02A
:20336000C6AD0002C929D0FEA92A8D0002F8A20EA0FFA999850D850E8D0302850FA90185B3
:203380000C8510A90085128D040238206F34C60CA50FD008C610A999850FD012290FD00CBE
:2033A000C60FC60FC60FC60FC60FC60FC60F18206F34E60CA50DF015290FD00CC60DC60DFC
:2033C000C60DC60DC60DC60DC60D4C8A33A999850DA50EF030290FD018C60EC60EC60EC6BC
:2033E0000EC60EC60EE612E612E612E612E612E612C60EE612A5128D0402A50E8D03028567
:203400000FE610D085AD0002C92AD0FEA92B8D000218D808A9556955C9AAD0FE18F808A9C9
:20342000556955C910D0FED828A9556955C910D0FE28A9556955C9AAD0FE18A93448A9550F
:203440004808F8A93448A94C4808D840A9556955C910D0FE40A9556955C9AAD0FEAD000253
:20346000C92BD0FEA9F08D00024C69344C000408A50D650E08C50FD0FE682901C510D0FE1D
:203480002808A50DE51208C50FD0FE682901C510D0FE2808A50D6D030208C50FD0FE6829E5
:2034A00001C510D0FE2808A50DED040208C50FD0FE682901C510D0FE2808A50E8D1202A58B
:2034C0000D20110208C50FD0FE682901C510D0FE2808A5128D1502A50D20140208C50FD0AE
:2034E000FE682901C510D0FE2808A50D750008C50FD0FE682901C510D0FE2808A50DF50488
:2035000008C50FD0FE682901C510D0FE2808A50D7DF50108C50FD0FE682901C510D0FE2870
:2035200008A50DFDF60108C50FD0FE682901C510D0FE2808A50D79040108C50FD0FE682963
:2035400001C510D0FE2808A50DF9050108C50FD0FE682901C510D0FE2808A50D614408C5B3
:203560000FD0FE682901C510D0FE2808A50DE14608C50FD0FE682901C510D0FE2808A50D6F
:20358000715608C50FD0FE682901C510D0FE2808A50DF15808C50FD0FE682901C510D0FE7B
:2035A0002860A511298348A50D450E300AA50D450F10046809404868851108A50D650E0854
:2035C000C50FD0FE6829C3C511D0FE2808A50DE51208C50FD0FE6829C3C511D0FE2808A501
:2035E0000D6D030208C50FD0FE6829C3C511D0FE2808A50DED040208C50FD0FE6829C3C512
:2036000011D0FE2808A50E8D1202A50D20110208C50FD0FE6829C3C511D0FE2808A5128D4C
:203620001502A50D20140208C50FD0FE6829C3C511D0FE2808A50D750008C50FD0FE682957
:20364000C3C511D0FE2808A50DF50408C50FD0FE6829C3C511D0FE2808A50D7DF50108C564
:203660000FD0FE6829C3C511D0FE2808A50DFDF60108C50FD0FE6829C3C511D0FE2808A528
:203680000D79040108C50FD0FE6829C3C511D0FE2808A50DF9050108C50FD0FE6829C3C559
:2036A00011D0FE2808A50D614408C50FD0FE6829C3C511D0FE2808A50DE14608C50FD0FE4F
:2036C0006829C3C511D0FE2808A50D715608C50FD0FE6829C3C511D0FE2808A50DF1580874
:2036E000C50FD0FE6829C3C511D0FE286088880888888828B0FE70FE30FEF0FEC946D0FEBB
:20370000E041D0FEC04FD0FE488A48BAE0FDD0FE68AAA9FF482868E849AA4C0F090027372F
:2037200064094C223788880888888828B0FE70FE30FEF0FEC949D0FEE04ED0FEC041D0FEBC
:20374000488A48BAE0FDD0FE68AAA9FF482868E849AA6C20374C55374C000488880888886A
:203760008828B0FE70FE30FEF0FEC94AD0FEE053D0FEC04FD0FE488A48BAE0FBD0FEADFF79
:2037800001C909D0FEADFE01C99AD0FEA9FF482868AA68E849AA604C97374C00044C9D3754
:2037A0004C00044CA3374C0004888808888888C9BDF042C942D0FEE052D0FEC048D0FE85A7
:2037C0000A860BBABD0201C930D0FE68C934D0FEBAE0FCD0FEADFF01C909D0FEADFE01C9B4
:2037E000D1D0FEA9FF48A60BE8A50A49AA28404CEF374C0004E0ADD0FEC0B1D0FE850A8626
:203800000BBABD0201C9FFD0FE680908C9FFD0FEBAE0FCD0FEADFF01C909D0FEADFE01C958
:15382000F7D0FEA90448A60BE8A50A49AA28404C2F384C000433
:06FFFA009D37A337AB3771
:00040001FB

14354
tests/6502_functional_test.lst Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,537 @@
:16000A00000000000000000000C38241007F001F71800FFF7F80BE
:20002000FF0F8F8F1702180219021A021B021F0103020402050206020B014E024F025002D4
:1A004000510252025302540255024A024B024C024D020302040204010501B1
:200200000000000000000000290060490060090060690060E90060C38241007F808000022A
:20022000860482008705830161412000E1C1A0808101800281018000010001028180818012
:200240007F80FF00010080800200001F71800FFF7F80FF0F8F8F00F11F00F0FFFFFFFFF068
:0A026000F00F00FF7F800280008095
:20040000D8A2FF9AA9008D0002204C44A2054C3604A005D008205B44888888888888888838
:200420008888F017205B44CACACACACACACACACACAF0DE205B44D0F4205B44AD0002C9007A
:20044000F003205B44A9018D0002A0FE8898AA1008186902EAEAEAEAEAEAEAEAEAEA497FC2
:200460008DEC04A9004CEB04CACACACACACACACACACACACACACACACACACACACACACACACA2B
:20048000CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA1C
:2004A000CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACAFC
:2004C000CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACADC
:2004E000CACACACACACACACACACACAF03ECACACACACACACACACACACACACACACACACACACA22
:20050000CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA9B
:20052000CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA7B
:20054000CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA5B
:20056000CACACACACACACACACACACACAEAEAEAEAEAF008205B44EAEAEAEAEAEAEAEAEAEA96
:20058000C000F0034C4C04AD0002C901F003205B44A9028D0002C001D003205B44A900C9E2
:2005A00000F003205B44B003205B441003205B44C901D003205B449003205B443003205BE9
:2005C00044AAE000F003205B44B003205B441003205B44E001D003205B449003205B443062
:2005E00003205B44A8C000F003205B44B003205B441003205B44C001D003205B44900320D5
:200600005B443003205B44AD0002C902F003205B44A9038D0002A2FF9AA95548A9AA48CDF9
:20062000FE01F003205B44BA8AC9FDF003205B4468C9AAF003205B4468C955F003205B4488
:20064000CDFF01F003205B44BAE0FFF003205B44AD0002C903F003205B44A9048D0002A9BE
:20066000FF4828101A501B901CD01D3003205B447003205B44B003205B44F00F205B442069
:200680005B44205B44205B44205B4408BAE0FEF003205B4468C9FFF003205B44BAE0FFF0C1
:2006A00003205B44A9004828301A701BB01CF01D1003205B445003205B449003205B44D0AB
:2006C0000F205B44205B44205B44205B44205B440868C930F003205B44A9024828D002F058
:2006E00003205B44B0029003205B4430021003205B4470025003205B44A9014828F002D0D0
:2007000003205B449002B003205B4430021003205B4470025003205B44A9804828F002D030
:2007200003205B44B0029003205B4410023003205B4470025003205B44A9404828F002D050
:2007400003205B44B0029003205B4430021003205B4450027003205B44A9FD4828F002D073
:2007600003205B449002B003205B4410023003205B4450027003205B44A9FE4828D002F052
:2007800003205B44B0029003205B4410023003205B4450027003205B44A97F4828D002F0B1
:2007A00003205B449002B003205B4430021003205B4450027003205B44A9BF4828D002F051
:2007C00003205B449002B003205B4410023003205B4470025003205B44AD0002C904F0035C
:2007E000205B44A9058D0002A255A0AAA9FF48A901284808C901F003205B446848C9FFF0C6
:2008000003205B4428A90048A900284808C900F003205B446848C930F003205B4428A9FF36
:2008200048A9FF284808C9FFF003205B446848C9FFF003205B4428A90048A901284808C9A8
:2008400001F003205B446848C930F003205B4428A9FF48A900284808C900F003205B44686E
:2008600048C9FFF003205B4428A90048A9FF284808C9FFF003205B446848C930F003205BEC
:200880004428A9FF48A900286808C9FFF003205B446848C9FDF003205B4428A90048A9FF58
:2008A000286808C900F003205B446848C932F003205B4428A9FF48A9FE286808C901F003B4
:2008C000205B446848C97DF003205B4428A90048A900286808C9FFF003205B446848C9B0B4
:2008E000F003205B4428A9FF48A9FF286808C900F003205B446848C97FF003205B4428A9F8
:200900000048A9FE286808C901F003205B446848C930F003205B4428E055F003205B44C0AA
:20092000AAF003205B44AD0002C905F003205B44A9068D0002A90048A93C2849C308C9FF14
:20094000F003205B446848C9B0F003205B4428A90048A9C32849C308C900F003205B446866
:2009600048C932F003205B4428AD0002C906F003205B44A9078D0002A224A042A90048A9A9
:200980001828EA08C918F003205B446848C930F003205B4428E024F003205B44C042F00364
:2009A000205B44A2DBA0BDA9FF48A9E728EA08C9E7F003205B446848C9FFF003205B442850
:2009C000E0DBF003205B44C0BDF003205B44AD0002C907F003205B44A9088D0002A9004819
:2009E00028A946A241A0524C8C42EAEAF003205B44E8E8D003205B443003205B44B0032044
:200A00005B447003205B44C9ECF003205B44E042F003205B44C04FF003205B44CAC8C8C8E7
:200A200049AA4C2E0AEAEAF003205B44E8E8D003205B441003205B44B003205B4470032080
:200A40005B44C946F003205B44E041F003205B44C052F003205B44AD0002C908F003205BB1
:200A600044A9098D0002A9004828A949A24EA0446CD242EAF003205B44888808888888281E
:200A8000D003205B443003205B44B003205B447003205B44C9E3F003205B44E04FF003208E
:200AA0005B44C03EF003205B44BAE0FFF003205B44AD0002C909F003205B44A90A8D000227
:200AC000A9004828A94AA253A0522029430888888828D003205B443003205B44B003205B1D
:200AE000447003205B44C9E0F003205B44E054F003205B44C04CF003205B44BAE0FFF003F5
:200B0000205B44AD0002C90AF003205B44A90B8D0002A90048A942A252A04B2800880888A4
:200B20008888C9E8F003205B44E053F003205B44C045F003205B4468C930F003205B44BAD9
:200B4000E0FFF003205B44A9FF48A9BDA2ADA0B428008808888888C917F003205B44E0AE9B
:200B6000F003205B44C0AEF003205B4468C9FFF003205B44BAE0FFF003205B44AD0002C9FE
:200B80000BF003205B44A90C8D0002A9FF482818086848C9FEF003205B442838086848C912
:200BA000FFF003205B442858086848C9FBF003205B442878086848C9FFF003205B4428D804
:200BC000086848C9F7F003205B4428F8086848C9FFF003205B4428B8086848C9BFF0032066
:200BE0005B4428A9004828086848C930F003205B442838086848C931F003205B44281808A6
:200C00006848C930F003205B442878086848C934F003205B442858086848C930F003205BD3
:200C20004428F8086848C938F003205B4428D8086848C930F003205B4428A9404828086891
:200C400048C970F003205B4428B8086848C930F003205B4428AD0002C90CF003205B44A917
:200C60000D8D0002A2FEA9FF4828E808E0FFF003205B446848C9FDF003205B4428E808E07F
:200C800000F003205B446848C97FF003205B4428E808E001F003205B446848C97DF0032044
:200CA0005B4428CA08E000F003205B446848C97FF003205B4428CA08E0FFF003205B44686C
:200CC00048C9FDF003205B4428CAA9004828E808E0FFF003205B446848C9B0F003205B44ED
:200CE00028E808E000F003205B446848C932F003205B4428E808E001F003205B446848C9C9
:200D000030F003205B4428CA08E000F003205B446848C932F003205B4428CA08E0FFF0033C
:200D2000205B446848C9B0F003205B4428A0FEA9FF4828C808C0FFF003205B446848C9FD84
:200D4000F003205B4428C808C000F003205B446848C97FF003205B4428C808C001F0032001
:200D60005B446848C97DF003205B44288808C000F003205B446848C97FF003205B442888A8
:200D800008C0FFF003205B446848C9FDF003205B442888A9004828C808C0FFF003205B44A8
:200DA0006848C9B0F003205B4428C808C000F003205B446848C932F003205B4428C808C0D9
:200DC00001F003205B446848C930F003205B44288808C000F003205B446848C932F003201D
:200DE0005B44288808C0FFF003205B446848C9B0F003205B4428A2FFA9FF48288A08C9FF15
:200E0000F003205B446848C9FDF003205B442808E8288A08C900F003205B446848C97FF0C3
:200E200003205B442808E8288A08C901F003205B446848C97DF003205B4428A90048288A2F
:200E400008C901F003205B446848C930F003205B442808CA288A08C900F003205B446848D4
:200E6000C932F003205B442808CA288A08C9FFF003205B446848C9B0F003205B4428A0FFF5
:200E8000A9FF48289808C9FFF003205B446848C9FDF003205B442808C8289808C900F0037C
:200EA000205B446848C97FF003205B442808C8289808C901F003205B446848C97DF0032084
:200EC0005B4428A90048289808C901F003205B446848C930F003205B44280888289808C972
:200EE00000F003205B446848C932F003205B44280888289808C9FFF003205B446848C9B0C0
:200F0000F003205B4428A9FF48A2FF8A28A808C0FFF003205B446848C9FDF003205B442843
:200F200008E88A28A808C000F003205B446848C97FF003205B442808E88A28A808C001F018
:200F400003205B446848C97DF003205B4428A90048A9008A28A808C001F003205B446848E0
:200F6000C930F003205B442808CA8A28A808C000F003205B446848C932F003205B4428086B
:200F8000CA8A28A808C0FFF003205B446848C9B0F003205B4428A9FF48A0FF9828AA08E0D0
:200FA000FFF003205B446848C9FDF003205B442808C89828AA08E000F003205B446848C9E3
:200FC0007FF003205B442808C89828AA08E001F003205B446848C97DF003205B4428A9006A
:200FE00048A9009828AA08E001F003205B446848C930F003205B442808889828AA08E00096
:20100000F003205B446848C932F003205B442808889828AA08E0FFF003205B446848C9B0DD
:20102000F003205B4428AD0002C90DF003205B44A90E8D0002A201A9FF48289A08AD01014D
:20104000C9FFF003205B44A90048289A08AD0101C930F003205B44CAA9FF48289A08AD00D0
:2010600001C9FFF003205B44A90048289A08AD0001C930F003205B44CAA9FF48289A08ADB0
:20108000FF01C9FFF003205B44A90048289A08ADFF01C930A2019AA9FF4828BA08E001F08D
:2010A00003205B44AD0101C97DF003205B44A9FF4828BA08E000F003205B44AD0001C97F65
:2010C000F003205B44A9FF4828BA08E0FFF003205B44ADFF01C9FDF003205B44A2019AA9E8
:2010E000004828BA08E001F003205B44AD0101C930F003205B44A9004828BA08E000F00323
:20110000205B44AD0001C932F003205B44A9004828BA08E0FFF003205B44ADFF01C9B0F033
:2011200003205B4468AD0002C90EF003205B44A90F8D0002A003A9004828B613088A49C3E3
:20114000289903020849C3D91702F003205B44684930D91C02F003205B448810D9A003A9CA
:20116000FF4828B613088A49C3289903020849C3D91702F003205B4468497DD91C02F00303
:20118000205B448810D9A003A9004828BE1702088A49C3AA28960C0849C3D91300F0032067
:2011A0005B44684930D91C02F003205B448810D8A003A9FF4828BE1702088A49C3AA2896FE
:2011C0000C0849C3D91300F003205B4468497DD91C02F003205B448810D8A003A200B90C00
:2011E0000049C3D91300F003205B44960CB9030249C3D91702F003205B448A990302881075
:20120000DDAD0002C90FF003205B44A9108D0002A0FDB6198A99090188C0FAB0F5A0FDBE95
:201220001D01961288C0FAB0F6A003A200B90C00D91300F003205B44960CB90302D9170206
:20124000F003205B448A9903028810E1AD0002C910F003205B44A9118D0002A203A9004822
:2012600028B413089849C3289D03020849C3DD1702F003205B44684930DD1C02F003205B03
:2012800044CA10D9A203A9FF4828B413089849C3289D03020849C3DD1702F003205B446839
:2012A000497DDD1C02F003205B44CA10D9A203A9004828BC1702089849C3A828940C084908
:2012C000C3D513F003205B44684930DD1C02F003205B44CA10D9A203A9FF4828BC170208D6
:2012E0009849C3A828940C0849C3D513F003205B4468497DDD1C02F003205B44CA10D9A2FC
:2013000003A000B50C49C3D513F003205B44940CBD030249C3DD1702F003205B448A9D0383
:2013200002CA10DFAD0002C911F003205B44A9128D0002A2FDB419989D0901CAE0FAB0F579
:20134000A2FDBC1D019412CAE0FAB0F6A203A000B50CD513F003205B44940CBD0302DD172E
:2013600002F003205B448A9D0302CA10E3AD0002C912F003205B44A9138D0002A900482830
:20138000A613088A49C3AA288E03020849C3AAE0C3F003205B44684930CD1C02F003205B44
:2013A00044A9004828A614088A49C3AA288E04020849C3AAE082F003205B44684930CD1D75
:2013C00002F003205B44A9004828A615088A49C3AA288E05020849C3AAE041F003205B44EF
:2013E000684930CD1E02F003205B44A9004828A616088A49C3AA288E06020849C3AAE000F4
:20140000F003205B44684930CD1F02F003205B44A9FF4828A613088A49C3AA288E030208BD
:2014200049C3AAE0C3F003205B4468497DCD1C02F003205B44A9FF4828A614088A49C3AABC
:20144000288E04020849C3AAE082F003205B4468497DCD1D02F003205B44A9FF4828A6155F
:20146000088A49C3AA288E05020849C3AAE041F003205B4468497DCD1E02F003205B44A960
:20148000FF4828A616088A49C3AA288E06020849C3AAE000F003205B4468497DCD1F02F0BF
:2014A00003205B44A9004828AE1702088A49C3AA28860C0849C3C513F003205B4468493009
:2014C000CD1C02F003205B44A9004828AE1802088A49C3AA28860D0849C3C514F003205B30
:2014E00044684930CD1D02F003205B44A9004828AE1902088A49C3AA28860E0849C3C51555
:20150000F003205B44684930CD1E02F003205B44A9004828AE1A02088A49C3AA28860F08A9
:2015200049C3C516F003205B44684930CD1F02F003205B44A9FF4828AE1702088A49C3AA6A
:2015400028860C0849C3AAE413F003205B4468497DCD1C02F003205B44A9FF4828AE1802BF
:20156000088A49C3AA28860D0849C3AAE414F003205B4468497DCD1D02F003205B44A9FF8C
:201580004828AE1902088A49C3AA28860E0849C3AAE415F003205B4468497DCD1E02F00397
:2015A000205B44A9FF4828AE1A02088A49C3AA28860F0849C3AAE416F003205B4468497DED
:2015C000CD1F02F003205B44A9004828A2C308EC1702F003205B44684930CD1C02F003204F
:2015E0005B44A9004828A28208EC1802F003205B44684930CD1D02F003205B44A9004828B7
:20160000A24108EC1902F003205B44684930CD1E02F003205B44A9004828A20008EC1A02DB
:20162000F003205B44684930CD1F02F003205B44A9FF4828A2C308EC1702F003205B4468D3
:20164000497DCD1C02F003205B44A9FF4828A28208EC1802F003205B4468497DCD1D02F021
:2016600003205B44A9FF4828A24108EC1902F003205B4468497DCD1E02F003205B44A9FF77
:201680004828A20008EC1A02F003205B4468497DCD1F02F003205B44A200A50C49C3C51371
:2016A000F003205B44860CAD030249C3CD1702F003205B448E0302A50D49C3C514F0032053
:2016C0005B44860DAD040249C3CD1802F003205B448E0402A50E49C3C515F003205B44861B
:2016E0000EAD050249C3CD1902F003205B448E0502A50F49C3C516F003205B44860FAD0658
:201700000249C3CD1A02F003205B448E0602AD0002C913F003205B44A9148D0002A9004810
:2017200028A413089849C3A8288C03020849C3A8C0C3F003205B44684930CD1C02F00320ED
:201740005B44A9004828A414089849C3A8288C04020849C3A8C082F003205B44684930CDAD
:201760001D02F003205B44A9004828A415089849C3A8288C05020849C3A8C041F003205B8C
:2017800044684930CD1E02F003205B44A9004828A416089849C3A8288C06020849C3A8C026
:2017A00000F003205B44684930CD1F02F003205B44A9FF4828A413089849C3A8288C03021A
:2017C0000849C3A8C0C3F003205B4468497DCD1C02F003205B44A9FF4828A414089849C3D1
:2017E000A8288C04020849C3A8C082F003205B4468497DCD1D02F003205B44A9FF4828A44F
:2018000015089849C3A8288C05020849C3A8C041F003205B4468497DCD1E02F003205B4468
:20182000A9FF4828A416089849C3A8288C06020849C3A8C000F003205B4468497DCD1F027C
:20184000F003205B44A9004828AC1702089849C3A828840C0849C3A8C413F003205B44683F
:201860004930CD1C02F003205B44A9004828AC1802089849C3A828840D0849C3A8C414F0E2
:2018800003205B44684930CD1D02F003205B44A9004828AC1902089849C3A828840E0849C8
:2018A000C3A8C415F003205B44684930CD1E02F003205B44A9004828AC1A02089849C3A87D
:2018C00028840F0849C3A8C416F003205B44684930CD1F02F003205B44A9FF4828AC1702A7
:2018E000089849C3A828840C0849C3A8C513F003205B4468497DCD1C02F003205B44A9FF23
:201900004828AC1802089849C3A828840D0849C3A8C514F003205B4468497DCD1D02F00330
:20192000205B44A9FF4828AC1902089849C3A828840E0849C3A8C515F003205B4468497D85
:20194000CD1E02F003205B44A9FF4828AC1A02089849C3A828840F0849C3A8C516F003204F
:201960005B4468497DCD1F02F003205B44A9004828A0C308CC1702F003205B44684930CD31
:201980001C02F003205B44A9004828A08208CC1802F003205B44684930CD1D02F003205B61
:2019A00044A9004828A04108CC1902F003205B44684930CD1E02F003205B44A9004828A00F
:2019C0000008CC1A02F003205B44684930CD1F02F003205B44A9FF4828A0C308CC1702F08C
:2019E00003205B4468497DCD1C02F003205B44A9FF4828A08208CC1802F003205B446849CF
:201A00007DCD1D02F003205B44A9FF4828A04108CC1902F003205B4468497DCD1E02F00303
:201A2000205B44A9FF4828A00008CC1A02F003205B4468497DCD1F02F003205B44A000A57A
:201A40000C49C3C513F003205B44840CAD030249C3CD1702F003205B448C0302A50D49C3AF
:201A6000C514F003205B44840DAD040249C3CD1802F003205B448C0402A50E49C3C515F0D7
:201A800003205B44840EAD050249C3CD1902F003205B448C0502A50F49C3C516F003205BFC
:201AA00044840FAD060249C3CD1A02F003205B448C0602AD0002C914F003205B44A9158DD6
:201AC0000002A203A9004828B5130849C3289D03020849C3DD1702F003205B44684930DD26
:201AE0001C02F003205B44CA10DAA203A9FF4828B5130849C3289D03020849C3DD1702F005
:201B000003205B4468497DDD1C02F003205B44CA10DAA203A9004828BD17020849C328950F
:201B20000C0849C3D513F003205B44684930DD1C02F003205B44CA10DBA203A9FF4828BD2E
:201B400017020849C328950C0849C3D513F003205B4468497DDD1C02F003205B44CA10DB51
:201B6000A203A000B50C49C3D513F003205B44940CBD030249C3DD1702F003205B448A9D7C
:201B80000302CA10DFAD0002C915F003205B44A9168D0002A003A9004828B1240849C3282D
:201BA0009903020849C3D91702F003205B44684930D91C02F003205B448810DAA003A9FF88
:201BC0004828B1240849C3289903020849C3D91702F003205B4468497DD91C02F003205B9B
:201BE000448810DAA003A200B9030249C3D91702F003205B448A9903028810ECA003A90084
:201C00004828B917020849C32891300849C3D124F003205B44684930D91C02F003205B4440
:201C20008810DBA003A9FF4828B917020849C32891300849C3D124F003205B4468497DD9E5
:201C40001C02F003205B448810DBA003A200B9030249C3D91702F003205B448A99030288DE
:201C600010ECA206A003A9004828A1240849C32881300849C3D91702F003205B44684930B9
:201C8000D91C02F003205B44CACA8810D9A206A003A9FF4828A1240849C32881300849C36D
:201CA000D91702F003205B4468497DD91C02F003205B44CACA8810D9A003A200B903024958
:201CC000C3D91702F003205B448A9903028810ECAD0002C916F003205B44A9178D0002A2C0
:201CE000FDB5199D0901CAE0FAB0F6A2FDBD1D019512CAE0FAB0F6A203A000B50CD513F0DF
:201D000003205B44940CBD0302DD1702F003205B448A9D0302CA10E3A0FBA2FEA12C990B62
:201D200001CACA88C0F8B0F4A003A200B90302D91702F003205B448A9903028810EEA0FB3A
:201D4000B91F01913888C0F8B0F6A003A200B90302D91702F003205B448A9903028810EEA6
:201D6000A0FBA2FEB12E8138CACA88C0F8B0F5A003A200B90302D91702F003205B448A994D
:201D800003028810EEAD0002C917F003205B44A9188D0002A9004828A5130849C3288D038A
:201DA000020849C3C9C3F003205B44684930CD1C02F003205B44A9004828A5140849C32843
:201DC0008D04020849C3C982F003205B44684930CD1D02F003205B44A9004828A5150849BC
:201DE000C3288D05020849C3C941F003205B44684930CD1E02F003205B44A9004828A51640
:201E00000849C3288D06020849C3C900F003205B44684930CD1F02F003205B44A9FF4828C9
:201E2000A5130849C3288D03020849C3C9C3F003205B4468497DCD1C02F003205B44A9FF57
:201E40004828A5140849C3288D04020849C3C982F003205B4468497DCD1D02F003205B44AD
:201E6000A9FF4828A5150849C3288D05020849C3C941F003205B4468497DCD1E02F00320C2
:201E80005B44A9FF4828A5160849C3288D06020849C3C900F003205B4468497DCD1F02F064
:201EA00003205B44A9004828AD17020849C328850C0849C3C513F003205B44684930CD1C4C
:201EC00002F003205B44A9004828AD18020849C328850D0849C3C514F003205B4468493020
:201EE000CD1D02F003205B44A9004828AD19020849C328850E0849C3C515F003205B44688C
:201F00004930CD1E02F003205B44A9004828AD1A020849C328850F0849C3C516F003205B9A
:201F200044684930CD1F02F003205B44A9FF4828AD17020849C328850C0849C3C513F00352
:201F4000205B4468497DCD1C02F003205B44A9FF4828AD18020849C328850D0849C3C5145D
:201F6000F003205B4468497DCD1D02F003205B44A9FF4828AD19020849C328850E0849C320
:201F8000C515F003205B4468497DCD1E02F003205B44A9FF4828AD1A020849C328850F082F
:201FA00049C3C516F003205B4468497DCD1F02F003205B44A9004828A9C308CD1702F00354
:201FC000205B44684930CD1C02F003205B44A9004828A98208CD1802F003205B44684930FE
:201FE000CD1D02F003205B44A9004828A94108CD1902F003205B44684930CD1E02F00320BD
:202000005B44A9004828A90008CD1A02F003205B44684930CD1F02F003205B44A9FF482823
:20202000A9C308CD1702F003205B4468497DCD1C02F003205B44A9FF4828A98208CD180297
:20204000F003205B4468497DCD1D02F003205B44A9FF4828A94108CD1902F003205B4468F6
:20206000497DCD1E02F003205B44A9FF4828A90008CD1A02F003205B4468497DCD1F02F08B
:2020800003205B44A200A50C49C3C513F003205B44860CAD030249C3CD1702F003205B44AD
:2020A0008E0302A50D49C3C514F003205B44860DAD040249C3CD1802F003205B448E0402C5
:2020C000A50E49C3C515F003205B44860EAD050249C3CD1902F003205B448E0502A50F4935
:2020E000C3C516F003205B44860FAD060249C3CD1A02F003205B448E0602AD0002C918F089
:2021000003205B44A9198D0002A90048A9FF28241608C9FFF003205B446848C932F0032071
:202120005B4428A90048A90128241508C901F003205B446848C970F003205B4428A90048A4
:20214000A90128241408C901F003205B446848C9B2F003205B4428A90048A90128241308EA
:20216000C901F003205B446848C9F0F003205B4428A9FF48A9FF28241608C9FFF003205B68
:20218000446848C93FF003205B4428A9FF48A90128241508C901F003205B446848C97DF004
:2021A00003205B4428A9FF48A90128241408C901F003205B446848C9BFF003205B4428A9FC
:2021C000FF48A90128241308C901F003205B446848C9FDF003205B4428A90048A9FF282CEE
:2021E0001A0208C9FFF003205B446848C932F003205B4428A90048A901282C190208C901E0
:20220000F003205B446848C970F003205B4428A90048A901282C180208C901F003205B44BC
:202220006848C9B2F003205B4428A90048A901282C170208C901F003205B446848C9F0F0B4
:2022400003205B4428A9FF48A9FF282C1A0208C9FFF003205B446848C93FF003205B442878
:20226000A9FF48A901282C190208C901F003205B446848C97DF003205B4428A9FF48A90167
:20228000282C180208C901F003205B446848C9BFF003205B4428A9FF48A901282C1702082B
:2022A000C901F003205B446848C9FDF003205B4428AD0002C919F003205B44A91A8D0002BD
:2022C000A90048A28028E417086848C931F003205B4428CAE417086848C933F003205B4411
:2022E00028CAE41708E07EF003205B446848C9B0F003205B4428A9FF48A28028E417086831
:2023000048C97DF003205B4428CAE417086848C97FF003205B4428CAE41708E07EF0032078
:202320005B446848C9FCF003205B4428A90048A28028EC1B02086848C931F003205B4428DF
:20234000CAEC1B02086848C933F003205B4428CAEC1B0208E07EF003205B446848C9B0F018
:2023600003205B4428A9FF48A28028EC1B02086848C97DF003205B4428CAEC1B02086848CD
:20238000C97FF003205B4428CAEC1B0208E07EF003205B446848C9FCF003205B4428A90038
:2023A00048A28028E07F086848C931F003205B4428CAE07F086848C933F003205B4428CA1F
:2023C000E07F08E07EF003205B446848C9B0F003205B4428A9FF48A28028E07F086848C969
:2023E0007DF003205B4428CAE07F086848C97FF003205B4428CAE07F08E07EF003205B4442
:202400006848C9FCF003205B4428AD0002C91AF003205B44A91B8D0002A90048A08028C4D9
:2024200017086848C931F003205B442888C417086848C933F003205B442888C41708C07E5F
:20244000F003205B446848C9B0F003205B4428A9FF48A08028C417086848C97DF003205B48
:20246000442888C417086848C97FF003205B442888C41708C07EF003205B446848C9FCF0F3
:2024800003205B4428A90048A08028CC1B02086848C931F003205B442888CC1B020868487B
:2024A000C933F003205B442888CC1B0208C07EF003205B446848C9B0F003205B4428A9FF32
:2024C00048A08028CC1B02086848C97DF003205B442888CC1B02086848C97FF003205B4488
:2024E0002888CC1B0208C07EF003205B446848C9FCF003205B4428A90048A08028C07F087C
:202500006848C931F003205B442888C07F086848C933F003205B442888C07F08C07EF003E2
:20252000205B446848C9B0F003205B4428A9FF48A08028C07F086848C97DF003205B44288A
:2025400088C07F086848C97FF003205B442888C07F08C07EF003205B446848C9FCF0032093
:202560005B4428AD0002C91BF003205B44A91C8D0002A90048A98028C51708C980F0032079
:202580005B446848C931F003205B4428A90048A97F28C51708C97FF003205B446848C9334D
:2025A000F003205B4428A90048A97E28C51708C97EF003205B446848C9B0F003205B442821
:2025C000A9FF48A98028C51708C980F003205B446848C97DF003205B4428A9FF48A97F28CB
:2025E000C51708C97FF003205B446848C97FF003205B4428A9FF48A97E28C51708C97EF0D1
:2026000003205B446848C9FCF003205B4428A90048A98028CD1B0208C980F003205B446812
:2026200048C931F003205B4428A90048A97F28CD1B0208C97FF003205B446848C933F003B2
:20264000205B4428A90048A97E28CD1B0208C97EF003205B446848C9B0F003205B4428A9BC
:20266000FF48A98028CD1B0208C980F003205B446848C97DF003205B4428A9FF48A97F28C5
:20268000CD1B0208C97FF003205B446848C97FF003205B4428A9FF48A97E28CD1B0208C982
:2026A0007EF003205B446848C9FCF003205B4428A90048A98028C97F08C980F003205B440E
:2026C0006848C931F003205B4428A90048A97F28C97F08C97FF003205B446848C933F0034C
:2026E000205B4428A90048A97E28C97F08C97EF003205B446848C9B0F003205B4428A9FFBF
:2027000048A98028C97F08C980F003205B446848C97DF003205B4428A9FF48A97F28C97F7D
:2027200008C97FF003205B446848C97FF003205B4428A9FF48A97E28C97F08C97EF00320DC
:202740005B446848C9FCF003205B4428A204A90048A98028D51308C980F003205B44684808
:20276000C931F003205B4428A90048A97F28D51308C97FF003205B446848C933F003205B40
:202780004428A90048A97E28D51308C97EF003205B446848C9B0F003205B4428A9FF48A908
:2027A0008028D51308C980F003205B446848C97DF003205B4428A9FF48A97F28D51308C9BD
:2027C0007FF003205B446848C97FF003205B4428A9FF48A97E28D51308C97EF003205B44CE
:2027E0006848C9FCF003205B4428A90048A98028DD170208C980F003205B446848C931F0B5
:2028000003205B4428A90048A97F28DD170208C97FF003205B446848C933F003205B44280F
:20282000A90048A97E28DD170208C97EF003205B446848C9B0F003205B4428A9FF48A98045
:2028400028DD170208C980F003205B446848C97DF003205B4428A9FF48A97F28DD17020849
:20286000C97FF003205B446848C97FF003205B4428A9FF48A97E28DD170208C97EF00320F5
:202880005B446848C9FCF003205B4428A004A208A90048A98028D9170208C980F003205B09
:2028A000446848C931F003205B4428A90048A97F28D9170208C97FF003205B446848C9336F
:2028C000F003205B4428A90048A97E28D9170208C97EF003205B446848C9B0F003205B4410
:2028E00028A9FF48A98028D9170208C980F003205B446848C97DF003205B4428A9FF48A911
:202900007F28D9170208C97FF003205B446848C97FF003205B4428A9FF48A97E28D9170219
:2029200008C97EF003205B446848C9FCF003205B4428A90048A98028C12408C980F00320BC
:202940005B446848C931F003205B4428A90048A97F28C12408C97FF003205B446848C93380
:20296000F003205B4428A90048A97E28C12408C97EF003205B446848C9B0F003205B442854
:20298000A9FF48A98028C12408C980F003205B446848C97DF003205B4428A9FF48A97F28FE
:2029A000C12408C97FF003205B446848C97FF003205B4428A9FF48A97E28C12408C97EF0FB
:2029C00003205B446848C9FCF003205B4428A90048A98028D12408C980F003205B446848FC
:2029E000C931F003205B4428A90048A97F28D12408C97FF003205B446848C933F003205BB1
:202A00004428A90048A97E28D12408C97EF003205B446848C9B0F003205B4428A9FF48A978
:202A20008028D12408C980F003205B446848C97DF003205B4428A9FF48A97F28D12408C920
:202A40007FF003205B446848C97FF003205B4428A9FF48A97E28D12408C97EF003205B443E
:202A60006848C9FCF003205B4428AD0002C91CF003205B44A91D8D0002A203A90048B5130E
:202A8000280A08DD2002F003205B44684930DD3002F003205B44CA10E2A203A9FF48B51390
:202AA000280A08DD2002F003205B4468497CDD3002F003205B44CA10E2A203A90048B51323
:202AC000284A08DD2802F003205B44684930DD3802F003205B44CA10E2A203A9FF48B51300
:202AE000284A08DD2802F003205B4468497CDD3802F003205B44CA10E2A203A90048B51393
:202B0000282A08DD2002F003205B44684930DD3002F003205B44CA10E2A203A9FE48B513F0
:202B2000282A08DD2002F003205B4468497CDD3002F003205B44CA10E2A203A90148B51381
:202B4000282A08DD2402F003205B44684930DD3402F003205B44CA10E2A203A9FF48B513A7
:202B6000282A08DD2402F003205B4468497CDD3402F003205B44CA10E2A203A90048B5133A
:202B8000286A08DD2802F003205B44684930DD3802F003205B44CA10E2A203A9FE48B51320
:202BA000286A08DD2802F003205B4468497CDD3802F003205B44CA10E2A203A90148B513B1
:202BC000286A08DD2C02F003205B44684930DD3C02F003205B44CA10E2A203A9FF48B513D7
:202BE000286A08DD2C02F003205B4468497CDD3C02F003205B44CA10E2AD0002C91DF00340
:202C0000205B44A91E8D0002A203A90048B513850C28060C08A50CDD2002F003205B4468A4
:202C20004930DD3002F003205B44CA10DDA203A9FF48B513850C28060C08A50CDD2002F0D3
:202C400003205B4468497CDD3002F003205B44CA10DDA203A90048B513850C28460C08A5F7
:202C60000CDD2802F003205B44684930DD3802F003205B44CA10DDA203A9FF48B513850C40
:202C800028460C08A50CDD2802F003205B4468497CDD3802F003205B44CA10DDA203A9004D
:202CA00048B513850C28260C08A50CDD2002F003205B44684930DD3002F003205B44CA1033
:202CC000DDA203A9FE48B513850C28260C08A50CDD2002F003205B4468497CDD3002F00337
:202CE000205B44CA10DDA203A90148B513850C28260C08A50CDD2402F003205B44684930C5
:202D0000DD3402F003205B44CA10DDA203A9FF48B513850C28260C08A50CDD2402F0032020
:202D20005B4468497CDD3402F003205B44CA10DDA203A90048B513850C28660C08A50CDD2C
:202D40002802F003205B44684930DD3802F003205B44CA10DDA203A9FE48B513850C2866BB
:202D60000C08A50CDD2802F003205B4468497CDD3802F003205B44CA10DDA203A90148B5DC
:202D800013850C28660C08A50CDD2C02F003205B44684930DD3C02F003205B44CA10DDA278
:202DA00003A9FF48B513850C28660C08A50CDD2C02F003205B4468497CDD3C02F003205B01
:202DC00044CA10DDAD0002C91EF003205B44A91F8D0002A203A90048B5138D0302280E0330
:202DE0000208AD0302DD2002F003205B44684930DD3002F003205B44CA10DAA203A9FF487B
:202E0000B5138D0302280E030208AD0302DD2002F003205B4468497CDD3002F003205B44C4
:202E2000CA10DAA203A90048B5138D0302284E030208AD0302DD2802F003205B446849301F
:202E4000DD3802F003205B44CA10DAA203A9FF48B5138D0302284E030208AD0302DD2802CA
:202E6000F003205B4468497CDD3802F003205B44CA10DAA203A90048B5138D0302282E03AD
:202E80000208AD0302DD2002F003205B44684930DD3002F003205B44CA10DAA203A9FE48DB
:202EA000B5138D0302282E030208AD0302DD2002F003205B4468497CDD3002F003205B4404
:202EC000CA10DAA203A90148B5138D0302282E030208AD0302DD2402F003205B44684930A2
:202EE000DD3402F003205B44CA10DAA203A9FF48B5138D0302282E030208AD0302DD240252
:202F0000F003205B4468497CDD3402F003205B44CA10DAA203A90048B5138D0302286E03D0
:202F20000208AD0302DD2802F003205B44684930DD3802F003205B44CA10DAA203A9FE482A
:202F4000B5138D0302286E030208AD0302DD2802F003205B4468497CDD3802F003205B4413
:202F6000CA10DAA203A90148B5138D0302286E030208AD0302DD2C02F003205B44684930B9
:202F8000DD3C02F003205B44CA10DAA203A9FF48B5138D0302286E030208AD0302DD2C0261
:202FA000F003205B4468497CDD3C02F003205B44CA10DAAD0002C91FF003205B44A9208D12
:202FC0000002A203A90048B513950C28160C08B50CDD2002F003205B44684930DD3002F04C
:202FE00003205B44CA10DDA203A9FF48B513950C28160C08B50CDD2002F003205B446849E5
:203000007CDD3002F003205B44CA10DDA203A90048B513950C28560C08B50CDD2802F00370
:20302000205B44684930DD3802F003205B44CA10DDA203A9FF48B513950C28560C08B50C1F
:20304000DD2802F003205B4468497CDD3802F003205B44CA10DDA203A90048B513950C28E3
:20306000360C08B50CDD2002F003205B44684930DD3002F003205B44CA10DDA203A9FE48A7
:20308000B513950C28360C08B50CDD2002F003205B4468497CDD3002F003205B44CA10DD3E
:2030A000A203A90148B513950C28360C08B50CDD2402F003205B44684930DD3402F0032021
:2030C0005B44CA10DDA203A9FF48B513950C28360C08B50CDD2402F003205B4468497CDDAA
:2030E0003402F003205B44CA10DDA203A90048B513950C28760C08B50CDD2802F003205B4A
:2031000044684930DD3802F003205B44CA10DDA203A9FE48B513950C28760C08B50CDD2895
:2031200002F003205B4468497CDD3802F003205B44CA10DDA203A90148B513950C28760C84
:2031400008B50CDD2C02F003205B44684930DD3C02F003205B44CA10DDA203A9FF48B51327
:20316000950C28760C08B50CDD2C02F003205B4468497CDD3C02F003205B44CA10DDAD0020
:2031800002C920F003205B44A9218D0002A203A90048B5139D0302281E030208BD0302DD47
:2031A0002002F003205B44684930DD3002F003205B44CA10DAA203A9FF48B5139D030228BE
:2031C0001E030208BD0302DD2002F003205B4468497CDD3002F003205B44CA10DAA203A961
:2031E0000048B5139D0302285E030208BD0302DD2802F003205B44684930DD3802F0032004
:203200005B44CA10DAA203A9FF48B5139D0302285E030208BD0302DD2802F003205B4468E6
:20322000497CDD3802F003205B44CA10DAA203A90048B5139D0302283E030208BD0302DD3A
:203240002002F003205B44684930DD3002F003205B44CA10DAA203A9FE48B5139D0302281E
:203260003E030208BD0302DD2002F003205B4468497CDD3002F003205B44CA10DAA203A9A0
:203280000148B5139D0302283E030208BD0302DD2402F003205B44684930DD3402F003208A
:2032A0005B44CA10DAA203A9FF48B5139D0302283E030208BD0302DD2402F003205B44686A
:2032C000497CDD3402F003205B44CA10DAA203A90048B5139D0302287E030208BD0302DD5E
:2032E0002802F003205B44684930DD3802F003205B44CA10DAA203A9FE48B5139D0302286E
:203300007E030208BD0302DD2802F003205B4468497CDD3802F003205B44CA10DAA203A9AF
:203320000148B5139D0302287E030208BD0302DD2C02F003205B44684930DD3C02F0032099
:203340005B44CA10DAA203A9FF48B5139D0302287E030208BD0302DD2C02F003205B446881
:20336000497CDD3C02F003205B44CA10DAAD0002C921F003205B44A9228D0002A200A97E99
:20338000850CA9004828E60C08A50CDD4002F003205B44684930DD4502F003205B44E8E088
:2033A00002D004A9FE850CE005D0D7CAE60CA9004828C60C08A50CDD4002F003205B4468DA
:2033C0004930DD4502F003205B44CA300AE001D0DDA981850CD0D7A200A97E850CA9FF4860
:2033E00028E60C08A50CDD4002F003205B4468497DDD4502F003205B44E8E002D004A9FEE0
:20340000850CE005D0D7CAE60CA9FF4828C60C08A50CDD4002F003205B4468497DDD45020D
:20342000F003205B44CA300AE001D0DDA981850CD0D7AD0002C922F003205B44A9238D0041
:2034400002A200A97E8D0302A9004828EE030208AD0302DD4002F003205B44684930DD4575
:2034600002F003205B44E8E002D005A9FE8D0302E005D0D4CAEE0302A9004828CE03020886
:20348000AD0302DD4002F003205B44684930DD4502F003205B44CA300BE001D0DBA9818DAA
:2034A0000302D0D4A200A97E8D0302A9FF4828EE030208AD0302DD4002F003205B446849C1
:2034C0007DDD4502F003205B44E8E002D005A9FE8D0302E005D0D4CAEE0302A9FF4828CE95
:2034E000030208AD0302DD4002F003205B4468497DDD4502F003205B44CA300BE001D0DBA7
:20350000A9818D0302D0D4AD0002C923F003205B44A9248D0002A200A97E950CA90048281F
:20352000F60C08B50CDD4002F003205B44684930DD4502F003205B44B50CE8E002D002A932
:20354000FEE005D0D5CAA902950CA9004828D60C08B50CDD4002F003205B44684930DD4535
:2035600002F003205B44B50CCA3008E001D0D9A981D0D5A200A97E950CA9FF4828F60C08EF
:20358000B50CDD4002F003205B4468497DDD4502F003205B44B50CE8E002D002A9FEE005AC
:2035A000D0D5CAA902950CA9FF4828D60C08B50CDD4002F003205B4468497DDD4502F00377
:2035C000205B44B50CCA3008E001D0D9A981D0D5AD0002C924F003205B44A9258D0002A2C3
:2035E00000A97E9D0302A9004828FE030208BD0302DD4002F003205B44684930DD4502F056
:2036000003205B44BD0302E8E002D002A9FEE005D0D1CAA9029D0302A9004828DE03020842
:20362000BD0302DD4002F003205B44684930DD4502F003205B44BD0302CA3008E001D0D5F6
:20364000A981D0D1A200A97E9D0302A9FF4828FE030208BD0302DD4002F003205B446849CD
:203660007DDD4502F003205B44BD0302E8E002D002A9FEE005D0D1CAA9029D0302A9FF4865
:2036800028DE030208BD0302DD4002F003205B4468497DDD4502F003205B44BD0302CA30C4
:2036A00008E001D0D5A981D0D1AD0002C925F003205B44A9268D0002A203B51C8D0902A94D
:2036C0000048BD5A022820080208DD6202F003205B44684930DD6602F003205B44CA10DAB0
:2036E000A203B51C8D0902A9FF48BD5A022820080208DD6202F003205B4468497DDD6602F3
:20370000F003205B44CA10DAA203B51C850CA90048BD5A0228250C08DD6202F003205B44DE
:20372000684930DD6602F003205B44CA10DCA203B51C850CA9FF48BD5A0228250C08DD624B
:2037400002F003205B4468497DDD6602F003205B44CA10DCA203B51C8D0302A90048BD5ACA
:2037600002282D030208DD6202F003205B44684930DD6602F003205B44CA10DAA203B51CF0
:203780008D0302A9FF48BD5A02282D030208DD6202F003205B4468497DDD6602F003205B58
:2037A00044CA1002A203A90048BD5A0228351C08DD6202F003205B44684930DD6602F003AD
:2037C000205B44CA10E0A203A9FF48BD5A0228351C08DD6202F003205B4468497DDD6602DB
:2037E000F003205B44CA10E0A203A90048BD5A02283D4E0208DD6202F003205B446849301D
:20380000DD6602F003205B44CA10DFA203A9FF48BD5A02283D4E0208DD6202F003205B449A
:2038200068497DDD6602F003205B44CA10DFA003A90048B95A0228394E0208D96202F00318
:20384000205B44684930D96602F003205B448810DFA003A9FF48B95A0228394E0208D962C2
:2038600002F003205B4468497DD96602F003205B448810DFA206A003A90048B95A02282162
:203880003A08D96202F003205B44684930D96602F003205B44CACA8810DEA206A003A9FF26
:2038A00048B95A0228213A08D96202F003205B4468497DD96602F003205B44CACA8810DE06
:2038C000A003A90048B95A0228313A08D96202F003205B44684930D96602F003205B448859
:2038E00010E0A003A9FF48B95A0228313A08D96202F003205B4468497DD96602F003205BC9
:20390000448810E0AD0002C926F003205B44A9278D0002A203B5208D0C02A90048BD5E0219
:2039200028200B0208DD6202F003205B44684930DD6602F003205B44CA10DAA203B5208DA4
:203940000C02A9FF48BD5E0228200B0208DD6202F003205B4468497DDD6602F003205B44D7
:20396000CA10DAA203B520850CA90048BD5E0228450C08DD6202F003205B44684930DD66E2
:2039800002F003205B44CA10DCA203B520850CA9FF48BD5E0228450C08DD6202F003205B75
:2039A0004468497DDD6602F003205B44CA10DCA203B5208D0302A90048BD5E02284D030254
:2039C00008DD6202F003205B44684930DD6602F003205B44CA10DAA203B5208D0302A9FFAC
:2039E00048BD5E02284D030208DD6202F003205B4468497DDD6602F003205B44CA1002A24A
:203A000003A90048BD5E0228552008DD6202F003205B44684930DD6602F003205B44CA104B
:203A2000E0A203A9FF48BD5E0228552008DD6202F003205B4468497DDD6602F003205B4437
:203A4000CA10E0A203A90048BD5E02285D520208DD6202F003205B44684930DD6602F0030C
:203A6000205B44CA10DFA203A9FF48BD5E02285D520208DD6202F003205B4468497DDD66D7
:203A800002F003205B44CA10DFA003A90048B95E022859520208D96202F003205B4468498F
:203AA00030D96602F003205B448810DFA003A9FF48B95E022859520208D96202F003205B38
:203AC0004468497DD96602F003205B448810DFA206A003A90048B95E0228414208D96202C5
:203AE000F003205B44684930D96602F003205B44CACA8810DEA206A003A9FF48B95E0228BA
:203B0000414208D96202F003205B4468497DD96602F003205B44CACA8810DEA003A900486C
:203B2000B95E0228514208D96202F003205B44684930D96602F003205B448810E0A003A922
:203B4000FF48B95E0228514208D96202F003205B4468497DD96602F003205B448810E0AD0D
:203B60000002C927F003205B44A9288D0002A203B5188D0F02A90048BD560228200E0208CB
:203B8000DD6202F003205B44684930DD6602F003205B44CA10DAA203B5188D0F02A9FF48A6
:203BA000BD560228200E0208DD6202F003205B4468497DDD6602F003205B44CA10DAA2031F
:203BC000B518850CA90048BD560228050C08DD6202F003205B44684930DD6602F003205BB9
:203BE00044CA10DCA203B518850CA9FF48BD560228050C08DD6202F003205B4468497DDD84
:203C00006602F003205B44CA10DCA203B5188D0302A90048BD5602280D030208DD6202F057
:203C200003205B44684930DD6602F003205B44CA10DAA203B5188D0302A9FF48BD56022805
:203C40000D030208DD6202F003205B4468497DDD6602F003205B44CA1002A203A90048BD03
:203C6000560228151808DD6202F003205B44684930DD6602F003205B44CA10E0A203A9FFBD
:203C800048BD560228151808DD6202F003205B4468497DDD6602F003205B44CA10E0A203F3
:203CA000A90048BD5602281D4A0208DD6202F003205B44684930DD6602F003205B44CA10C0
:203CC000DFA203A9FF48BD5602281D4A0208DD6202F003205B4468497DDD6602F003205BEE
:203CE00044CA10DFA003A90048B9560228194A0208D96202F003205B44684930D96602F08C
:203D000003205B448810DFA003A9FF48B9560228194A0208D96202F003205B4468497DD93B
:203D20006602F003205B448810DFA206A003A90048B9560228014A08D96202F003205B443B
:203D4000684930D96602F003205B44CACA8810DEA206A003A9FF48B9560228014A08D96283
:203D600002F003205B4468497DD96602F003205B44CACA8810DEA003A90048B95602281186
:203D80004A08D96202F003205B44684930D96602F003205B448810E0A003A9FF48B95602F2
:203DA00028114A08D96202F003205B4468497DD96602F003205B448810E058AD0002C928F8
:203DC000F003205B44A9298D0002D8A20EA0FFA900850C850D850E8D0302850F8510A9FFE7
:203DE00085128D0402A90285111820DF40E60CE60F080868298228D002E610051085113824
:203E000020DF40C60CE60DD0E0A9008510EE0302E60E086829828511C612CE0402A50E8534
:203E20000FD0C6AD0002C929F003205B44A92A8D0002F8A20EA0FFA999850D850E8D0302E8
:203E4000850FA901850C8510A90085128D040238204C3FC60CA50FD008C610A999850FD06E
:203E600012290FD00CC60FC60FC60FC60FC60FC60FC60F18204C3FE60CA50DF015290FD0D5
:203E80000CC60DC60DC60DC60DC60DC60DC60D4C4F3EA999850DA50EF030290FD018C60EDD
:203EA000C60EC60EC60EC60EC60EE612E612E612E612E612E612C60EE612A5128D0402A553
:203EC0000E8D0302850FE610D085AD0002C92AF003205B44A92B8D000218D808A9556955F8
:203EE000C9AAF003205B4418F808A9556955C910F003205B44D828A9556955C910F0032096
:203F00005B4428A9556955C9AAF003205B4418A93F48A92C4808F8A93F48A9204808D84033
:203F2000A9556955C910F003205B4440A9556955C9AAF003205B44AD0002C92BF003205B08
:203F400044A9F08D00022024454C000408A50D650E08C50FF003205B44682901C510F00307
:203F6000205B442808A50DE51208C50FF003205B44682901C510F003205B442808A50D6DB3
:203F8000030208C50FF003205B44682901C510F003205B442808A50DED040208C50FF003D1
:203FA000205B44682901C510F003205B442808A50E8D1202A50D20110208C50FF003205B76
:203FC00044682901C510F003205B442808A5128D1502A50D20140208C50FF003205B44681B
:203FE0002901C510F003205B442808A50D750008C50FF003205B44682901C510F003205B56
:20400000442808A50DF50408C50FF003205B44682901C510F003205B442808A50D7DF50185
:2040200008C50FF003205B44682901C510F003205B442808A50DFDF60108C50FF003205BB9
:2040400044682901C510F003205B442808A50D79040108C50FF003205B44682901C510F0BE
:2040600003205B442808A50DF9050108C50FF003205B44682901C510F003205B442808A521
:204080000D614408C50FF003205B44682901C510F003205B442808A50DE14608C50FF003EF
:2040A000205B44682901C510F003205B442808A50D715608C50FF003205B44682901C5108A
:2040C000F003205B442808A50DF15808C50FF003205B44682901C510F003205B442860A52F
:2040E00011298348A50D450E300AA50D450F10046809404868851108A50D650E08C50FF072
:2041000003205B446829C3C511F003205B442808A50DE51208C50FF003205B446829C3C581
:2041200011F003205B442808A50D6D030208C50FF003205B446829C3C511F003205B4428D6
:2041400008A50DED040208C50FF003205B446829C3C511F003205B442808A50E8D1202A51F
:204160000D20110208C50FF003205B446829C3C511F003205B442808A5128D1502A50D2038
:20418000140208C50FF003205B446829C3C511F003205B442808A50D750008C50FF0032059
:2041A0005B446829C3C511F003205B442808A50DF50408C50FF003205B446829C3C511F001
:2041C00003205B442808A50D7DF50108C50FF003205B446829C3C511F003205B442808A589
:2041E0000DFDF60108C50FF003205B446829C3C511F003205B442808A50D79040108C50F18
:20420000F003205B446829C3C511F003205B442808A50DF9050108C50FF003205B44682910
:20422000C3C511F003205B442808A50D614408C50FF003205B446829C3C511F003205B4442
:204240002808A50DE14608C50FF003205B446829C3C511F003205B442808A50D715608C575
:204260000FF003205B446829C3C511F003205B442808A50DF15808C50FF003205B44682957
:20428000C3C511F003205B442860888808888888289003205B445003205B441003205B443D
:2042A000D003205B44C946F003205B44E041F003205B44C04FF003205B44488A48BAE0FD66
:2042C000F003205B4468AAA9FF482868E849AA4CF309DB427B0A205B44888808888888283E
:2042E0009003205B445003205B441003205B44D003205B44C949F003205B44E04EF00320F1
:204300005B44C041F003205B44488A48BAE0FDF003205B4468AAA9FF482868E849AA6CD43B
:2043200042205B444C0004888808888888289003205B445003205B441003205B44D003202B
:204340005B44C94AF003205B44E053F003205B44C04FF003205B44488A48BAE0FBF0032091
:204360005B44ADFF01C90AF003205B44ADFE01C9CCF003205B44A9FF482868AA68E849AA0C
:2043800060205B444C0004205B444C0004205B444C0004888808888888C9BDF05AC942F015
:2043A00003205B44E052F003205B44C048F003205B44850A860BBABD0201C930F003205B9C
:2043C0004468C934F003205B44BAE0FCF003205B44ADFF01C90BF003205B44ADFE01C91E74
:2043E000F003205B44A9FF48A60BE8A50A49AA2840205B444C0004E0ADF003205B44C0B1B9
:20440000F003205B44850A860BBABD0201C9FFF003205B44680908C9FFF003205B44BAE049
:20442000FCF003205B44ADFF01C90BF003205B44ADFE01C953F003205B44A90448A60BE893
:20444000A50A49AA2840205B444C0004A200AD6945206545E8BD6945D0F76008488A489848
:2044600048D8A200AD7D45206545E8BD7D45D0F7BAE8A9012051458A205145204D45BD0062
:2044800001205145E8D0F4204445A900205145A90CAA205145204D45B500205145E8E013A4
:2044A000D0F3204445A902205145A900205145A200204D45BD0002205145E8E008D0F2A2D3
:2044C00000AD9945206545E8BD9945D0F7203A45C953F00BC943D0F568A868AA682860A9FB
:2044E000F0CD0002F0E7A2FF9AEE0002A900850CA904850DA004B10CD91F45D00A88300F43
:20450000C001D0F288F0EFE60CD0E9E60DD0E5A001B10CC9F0F005CD0002D0EB6C0C00A9A7
:20452000008D0002A200ADCB45206545E8BDCB45D0F7203A45C952D0F960AD04F0C9619009
:2045400002295F60A90A206545A90DD018A920D014484A4A4A4A205C4568290F186930C95E
:204560003A900269068D01F0600A0D537461727465642074657374696E670A0D000A0D7276
:204580006567732059202058202041202050532050434C5043480A0D000A0D707265737332
:2045A000204320746F20636F6E74696E7565206F72205320746F20736B69702063757272E6
:2045C000656E7420746573740A0D000A0D416C6C20746573747320636F6D706C657465643D
:1645E0002C207072657373205220746F207265706561740A0D001F
:06FFFA0087438D4395438F
:00040001FB

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,302 @@
:16000A00000000000000000000C38241007F001F71800FFF7F80BE
:20002000FF0F8F8F10021102120213021402180105020602070208020D0147024802490209
:1A0040004A024B024C024D024E0243024402450246020502060206010701E8
:2002000000000000000000000000690060E90060C38241007F8080000286048200870583AA
:200220000161412000E1C1A080810180028101800001000102818081807F80FF00010080AE
:20024000800200001F71800FFF7F80FF0F8F8F00F11F00F0FFFFFFFFF0F00F00FF7F8002E8
:030260008000809B
:20040000D8A2FF9AA9008D0202AD0202C900D0FEA9018D0202A999A2FF9AA255DAA2AADA98
:20042000ECFE01D0FEBAE0FDD0FE7AC0AAD0FE7AC055D0FECCFF01D0FEBAE0FFD0FEA0A549
:200440005AA05A5ACCFE01D0FEBAE0FDD0FEFAE05AD0FEFAE0A5D0FEECFF01D0FEBAE0FF4E
:20046000D0FEC999D0FEAD0202C901D0FEA9028D0202A0AAA9FF48A20128DA08E001D0FE63
:200480006848C9FFD0FE28A90048A20028DA08E000D0FE6848C930D0FE28A9FF48A2FF284B
:2004A000DA08E0FFD0FE6848C9FFD0FE28A90048A20128DA08E001D0FE6848C930D0FE2853
:2004C000A9FF48A20028DA08E000D0FE6848C9FFD0FE28A90048A2FF28DA08E0FFD0FE68B3
:2004E00048C930D0FE28A9FF48A20028FA08E0FFD0FE6848C9FDD0FE28A90048A2FF28FA3C
:2005000008E000D0FE6848C932D0FE28A9FF48A2FE28FA08E001D0FE6848C97DD0FE28A986
:200520000048A20028FA08E0FFD0FE6848C9B0D0FE28A9FF48A2FF28FA08E000D0FE6848C2
:20054000C97FD0FE28A90048A2FE28FA08E001D0FE6848C930D0FE28C0AAD0FEAD0202C9A2
:2005600002D0FEA9038D0202A255A9FF48A001285A08C001D0FE6848C9FFD0FE28A900486E
:20058000A000285A08C000D0FE6848C930D0FE28A9FF48A0FF285A08C0FFD0FE6848C9FFE6
:2005A000D0FE28A90048A001285A08C001D0FE6848C930D0FE28A9FF48A000285A08C00021
:2005C000D0FE6848C9FFD0FE28A90048A0FF285A08C0FFD0FE6848C930D0FE28A9FF48A009
:2005E00000287A08C0FFD0FE6848C9FDD0FE28A90048A0FF287A08C000D0FE6848C932D015
:20060000FE28A9FF48A0FE287A08C001D0FE6848C97DD0FE28A90048A000287A08C0FFD037
:20062000FE6848C9B0D0FE28A9FF48A0FF287A08C000D0FE6848C97FD0FE28A90048A0FE59
:20064000287A08C001D0FE6848C930D0FE28E055D0FEAD0202C903D0FEA9048D0202A28113
:20066000A07EA9FF48A9002880034C6A0608C900D0FE6848C9FFD0FE28A90048A9FF28800E
:20068000034C810608C9FFD0FE6848C930D0FE28E081D0FEC07ED0FEAD0202C904D0FEA917
:2006A000058D0202A0008061C001D0FEC88053C003D0FEC88045C005D0FEC8A0008004C894
:2006C000C8C8C88003C8C8C8C88002C8C8C8C88001C8C8C8C88000C8C8C8C8C00AD0FE8024
:2006E0001288888888800E88888880F5888880F78880F980FBC000D0FE8015C004D0FEC8AD
:2007000080B4C002D0FEC880A6C000D0FEC88098AD0202C905D0FEA9068D0202A211A022B7
:20072000A901850CA90048A933280F0C068F0C064C30074C330708C933D0FE6848C930D073
:20074000FE28A9FF48A9CC280F0C068F0C064C4E074C510708C9CCD0FE6848C9FFD0FE2806
:20076000A50CC901D0FEA9FE850CA90048A933288F0C060F0C064C76074C790708C933D0D8
:20078000FE6848C930D0FE28A9FF48A9CC288F0C060F0C064C94074C970708C9CCD0FE68C9
:2007A00048C9FFD0FE28A50CC9FED0FEA902850CA90048A933281F0C069F0C064CBC074C7F
:2007C000BF0708C933D0FE6848C930D0FE28A9FF48A9CC281F0C069F0C064CDA074CDD0716
:2007E00008C9CCD0FE6848C9FFD0FE28A50CC902D0FEA9FD850CA90048A933289F0C061FDA
:200800000C064C02084C050808C933D0FE6848C930D0FE28A9FF48A9CC289F0C061F0C0637
:200820004C20084C230808C9CCD0FE6848C9FFD0FE28A50CC9FDD0FEA904850CA90048A9D7
:2008400033282F0C06AF0C064C48084C4B0808C933D0FE6848C930D0FE28A9FF48A9CC2802
:200860002F0C06AF0C064C66084C690808C9CCD0FE6848C9FFD0FE28A50CC904D0FEA9FB36
:20088000850CA90048A93328AF0C062F0C064C8E084C910808C933D0FE6848C930D0FE2898
:2008A000A9FF48A9CC28AF0C062F0C064CAC084CAF0808C9CCD0FE6848C9FFD0FE28A50C1C
:2008C000C9FBD0FEA908850CA90048A933283F0C06BF0C064CD4084CD70808C933D0FE68A0
:2008E00048C930D0FE28A9FF48A9CC283F0C06BF0C064CF2084CF50808C9CCD0FE6848C99F
:20090000FFD0FE28A50CC908D0FEA9F7850CA90048A93328BF0C063F0C064C1A094C1D0969
:2009200008C933D0FE6848C930D0FE28A9FF48A9CC28BF0C063F0C064C38094C3B0908C9A9
:20094000CCD0FE6848C9FFD0FE28A50CC9F7D0FEA910850CA90048A933284F0C06CF0C06CF
:200960004C60094C630908C933D0FE6848C930D0FE28A9FF48A9CC284F0C06CF0C064C7E00
:20098000094C810908C9CCD0FE6848C9FFD0FE28A50CC910D0FEA9EF850CA90048A9332829
:2009A000CF0C064F0C064CA6094CA90908C933D0FE6848C930D0FE28A9FF48A9CC28CF0C23
:2009C000064F0C064CC4094CC70908C9CCD0FE6848C9FFD0FE28A50CC9EFD0FEA920850C11
:2009E000A90048A933285F0C06DF0C064CEC094CEF0908C933D0FE6848C930D0FE28A9FF02
:200A000048A9CC285F0C06DF0C064C0A0A4C0D0A08C9CCD0FE6848C9FFD0FE28A50CC92059
:200A2000D0FEA9DF850CA90048A93328DF0C065F0C064C320A4C350A08C933D0FE6848C91A
:200A400030D0FE28A9FF48A9CC28DF0C065F0C064C500A4C530A08C9CCD0FE6848C9FFD07F
:200A6000FE28A50CC9DFD0FEA940850CA90048A933286F0C06EF0C064C780A4C7B0A08C9C8
:200A800033D0FE6848C930D0FE28A9FF48A9CC286F0C06EF0C064C960A4C990A08C9CCD05F
:200AA000FE6848C9FFD0FE28A50CC940D0FEA9BF850CA90048A93328EF0C066F0C064CBEC8
:200AC0000A4CC10A08C933D0FE6848C930D0FE28A9FF48A9CC28EF0C066F0C064CDC0A4CF7
:200AE000DF0A08C9CCD0FE6848C9FFD0FE28A50CC9BFD0FEA980850CA90048A933287F0CF3
:200B000006FF0C064C040B4C070B08C933D0FE6848C930D0FE28A9FF48A9CC287F0C06FF77
:200B20000C064C220B4C250B08C9CCD0FE6848C9FFD0FE28A50CC980D0FEA97F850CA900AB
:200B400048A93328FF0C067F0C064C4A0B4C4D0B08C933D0FE6848C930D0FE28A9FF48A958
:200B6000CC28FF0C067F0C064C680B4C6B0B08C9CCD0FE6848C9FFD0FE28A50CC97FD0FEBE
:200B8000E011D0FEC022D0FEAD0202C906D0FEA9078D0202A900850CA9000F0C0249011FEE
:200BA0000C0249022F0C0249043F0C0249084F0C0249105F0C0249206F0C0249407F0C0295
:200BC0004980450CD0FEA9FF8F0C0249019F0C024902AF0C024904BF0C024908CF0C024958
:200BE00010DF0C024920EF0C024940FF0C024980450CD0FEE60CD0A0AD0202C907D0FEA9BA
:200C0000088D0202A042A20202C8CACAD0FEA90048A9FD2802EAEA08C9FDD0FE6848C930AF
:200C2000D0FE28A9FF48A9A82802EAEA08C9A8D0FE6848C9FFD0FE28C042D0FEE000D0FE4C
:200C4000A042A20222C8CACAD0FEA90048A9DD2822EAEA08C9DDD0FE6848C930D0FE28A969
:200C6000FF48A9882822EAEA08C988D0FE6848C9FFD0FE28C042D0FEE000D0FEA042A20245
:200C800042C8CACAD0FEA90048A9BD2842EAEA08C9BDD0FE6848C930D0FE28A9FF48A96857
:200CA0002842EAEA08C968D0FE6848C9FFD0FE28C042D0FEE000D0FEA042A20262C8CACABF
:200CC000D0FEA90048A99D2862EAEA08C99DD0FE6848C930D0FE28A9FF48A9482862EAEA97
:200CE00008C948D0FE6848C9FFD0FE28C042D0FEE000D0FEA042A20282C8CACAD0FEA90046
:200D000048A97D2882EAEA08C97DD0FE6848C930D0FE28A9FF48A9282882EAEA08C928D024
:200D2000FE6848C9FFD0FE28C042D0FEE000D0FEA042A202C2C8CACAD0FEA90048A93D2858
:200D4000C2EAEA08C93DD0FE6848C930D0FE28A9FF48A9E828C2EAEA08C9E8D0FE6848C943
:200D6000FFD0FE28C042D0FEE000D0FEA042A202E2C8CACAD0FEA90048A91D28E2EAEA08D1
:200D8000C91DD0FE6848C930D0FE28A9FF48A9C828E2EAEA08C9C8D0FE6848C9FFD0FE28EC
:200DA000C042D0FEE000D0FEA042A20244C8CACAD0FEA90048A9BB2844EAEA08C9BBD0FED2
:200DC0006848C930D0FE28A9FF48A9662844EAEA08C966D0FE6848C9FFD0FE28C042D0FEF2
:200DE000E000D0FEA042A20254C8CACAD0FEA90048A9AB2854EAEA08C9ABD0FE6848C930B9
:200E0000D0FE28A9FF48A9562854EAEA08C956D0FE6848C9FFD0FE28C042D0FEE000D0FEBC
:200E2000A042A202D4C8CACAD0FEA90048A92B28D4EAEA08C92BD0FE6848C930D0FE28A987
:200E4000FF48A9D628D4EAEA08C9D6D0FE6848C9FFD0FE28C042D0FEE000D0FEA042A20215
:200E6000F4C8CACAD0FEA90048A90B28F4EAEA08C90BD0FE6848C930D0FE28A9FF48A9B627
:200E800028F4EAEA08C9B6D0FE6848C9FFD0FE28C042D0FEE000D0FEA042A2015CC8C8CAE6
:200EA000D0FEA90048A9A3285CEAEA08C9A3D0FE6848C930D0FE28A9FF48A94E285CEAEAAF
:200EC00008C94ED0FE6848C9FFD0FE28C042D0FEE000D0FEA042A201DCC8C8CAD0FEA90007
:200EE00048A92328DCEAEA08C923D0FE6848C930D0FE28A9FF48A9CE28DCEAEA08C9CED0F7
:200F0000FE6848C9FFD0FE28C042D0FEE000D0FEA042A201FCC8C8CAD0FEA90048A9032879
:200F2000FCEAEA08C903D0FE6848C930D0FE28A9FF48A9AE28FCEAEA08C9AED0FE6848C99B
:200F4000FFD0FE28C042D0FEE000D0FEA042A20303CACACAD0FEA90048A9FC2803EAEA08CB
:200F6000C9FCD0FE6848C930D0FE28A9FF48A9A72803EAEA08C9A7D0FE6848C9FFD0FE284C
:200F8000C042D0FEE000D0FEA042A20313CACACAD0FEA90048A9EC2813EAEA08C9ECD0FEED
:200FA0006848C930D0FE28A9FF48A9972813EAEA08C997D0FE6848C9FFD0FE28C042D0FEDF
:200FC000E000D0FEA042A20323CACACAD0FEA90048A9DC2823EAEA08C9DCD0FE6848C930D4
:200FE000D0FE28A9FF48A9872823EAEA08C987D0FE6848C9FFD0FE28C042D0FEE000D0FEAA
:20100000A042A20333CACACAD0FEA90048A9CC2833EAEA08C9CCD0FE6848C930D0FE28A9A2
:20102000FF48A9772833EAEA08C977D0FE6848C9FFD0FE28C042D0FEE000D0FEA042A20391
:2010400043CACACAD0FEA90048A9BC2843EAEA08C9BCD0FE6848C930D0FE28A9FF48A96792
:201060002843EAEA08C967D0FE6848C9FFD0FE28C042D0FEE000D0FEA042A20353CACACA07
:20108000D0FEA90048A9AC2853EAEA08C9ACD0FE6848C930D0FE28A9FF48A9572853EAEAC4
:2010A00008C957D0FE6848C9FFD0FE28C042D0FEE000D0FEA042A20363CACACAD0FEA9008F
:2010C00048A99C2863EAEA08C99CD0FE6848C930D0FE28A9FF48A9472863EAEA08C947D023
:2010E000FE6848C9FFD0FE28C042D0FEE000D0FEA042A20373CACACAD0FEA90048A98C2892
:2011000073EAEA08C98CD0FE6848C930D0FE28A9FF48A9372873EAEA08C937D0FE6848C930
:20112000FFD0FE28C042D0FEE000D0FEA042A20383CACACAD0FEA90048A97C2883EAEA0869
:20114000C97CD0FE6848C930D0FE28A9FF48A9272883EAEA08C927D0FE6848C9FFD0FE286A
:20116000C042D0FEE000D0FEA042A20393CACACAD0FEA90048A96C2893EAEA08C96CD0FE0B
:201180006848C930D0FE28A9FF48A9172893EAEA08C917D0FE6848C9FFD0FE28C042D0FE7D
:2011A000E000D0FEA042A203A3CACACAD0FEA90048A95C28A3EAEA08C95CD0FE6848C930F2
:2011C000D0FE28A9FF48A90728A3EAEA08C907D0FE6848C9FFD0FE28C042D0FEE000D0FE48
:2011E000A042A203B3CACACAD0FEA90048A94C28B3EAEA08C94CD0FE6848C930D0FE28A9C1
:20120000FF48A9F728B3EAEA08C9F7D0FE6848C9FFD0FE28C042D0FEE000D0FEA042A2032F
:20122000C3CACACAD0FEA90048A93C28C3EAEA08C93CD0FE6848C930D0FE28A9FF48A9E730
:2012400028C3EAEA08C9E7D0FE6848C9FFD0FE28C042D0FEE000D0FEA042A203D3CACACAA5
:20126000D0FEA90048A92C28D3EAEA08C92CD0FE6848C930D0FE28A9FF48A9D728D3EAEA62
:2012800008C9D7D0FE6848C9FFD0FE28C042D0FEE000D0FEA042A203E3CACACAD0FEA900AD
:2012A00048A91C28E3EAEA08C91CD0FE6848C930D0FE28A9FF48A9C728E3EAEA08C9C7D041
:2012C000FE6848C9FFD0FE28C042D0FEE000D0FEA042A203F3CACACAD0FEA90048A90C28B0
:2012E000F3EAEA08C90CD0FE6848C930D0FE28A9FF48A9B728F3EAEA08C9B7D0FE6848C9CF
:20130000FFD0FE28C042D0FEE000D0FEA042A2030BCACACAD0FEA90048A9F4280BEAEA08FF
:20132000C9F4D0FE6848C930D0FE28A9FF48A99F280BEAEA08C99FD0FE6848C9FFD0FE2898
:20134000C042D0FEE000D0FEA042A2031BCACACAD0FEA90048A9E4281BEAEA08C9E4D0FE29
:201360006848C930D0FE28A9FF48A98F281BEAEA08C98FD0FE6848C9FFD0FE28C042D0FE23
:20138000E000D0FEA042A2032BCACACAD0FEA90048A9D4282BEAEA08C9D4D0FE6848C93010
:2013A000D0FE28A9FF48A97F282BEAEA08C97FD0FE6848C9FFD0FE28C042D0FEE000D0FEEE
:2013C000A042A2033BCACACAD0FEA90048A9C4283BEAEA08C9C4D0FE6848C930D0FE28A9DF
:2013E000FF48A96F283BEAEA08C96FD0FE6848C9FFD0FE28C042D0FEE000D0FEA042A203D6
:201400004BCACACAD0FEA90048A9B4284BEAEA08C9B4D0FE6848C930D0FE28A9FF48A95FD6
:20142000284BEAEA08C95FD0FE6848C9FFD0FE28C042D0FEE000D0FEA042A2035BCACACA3B
:20144000D0FEA90048A9A4285BEAEA08C9A4D0FE6848C930D0FE28A9FF48A94F285BEAEA08
:2014600008C94FD0FE6848C9FFD0FE28C042D0FEE000D0FEA042A2036BCACACAD0FEA900CB
:2014800048A994286BEAEA08C994D0FE6848C930D0FE28A9FF48A93F286BEAEA08C93FD06F
:2014A000FE6848C9FFD0FE28C042D0FEE000D0FEA042A2037BCACACAD0FEA90048A98428CE
:2014C0007BEAEA08C984D0FE6848C930D0FE28A9FF48A92F287BEAEA08C92FD0FE6848C975
:2014E000FFD0FE28C042D0FEE000D0FEA042A2038BCACACAD0FEA90048A974288BEAEA089E
:20150000C974D0FE6848C930D0FE28A9FF48A91F288BEAEA08C91FD0FE6848C9FFD0FE28B6
:20152000C042D0FEE000D0FEA042A2039BCACACAD0FEA90048A964289BEAEA08C964D0FE47
:201540006848C930D0FE28A9FF48A90F289BEAEA08C90FD0FE6848C9FFD0FE28C042D0FEC1
:20156000E000D0FEA042A203ABCACACAD0FEA90048A95428ABEAEA08C954D0FE6848C9302E
:20158000D0FE28A9FF48A9FF28ABEAEA08C9FFD0FE6848C9FFD0FE28C042D0FEE000D0FE8C
:2015A000A042A203BBCACACAD0FEA90048A94428BBEAEA08C944D0FE6848C930D0FE28A9FD
:2015C000FF48A9EF28BBEAEA08C9EFD0FE6848C9FFD0FE28C042D0FEE000D0FEA042A20374
:2015E000EBCACACAD0FEA90048A91428EBEAEA08C914D0FE6848C930D0FE28A9FF48A9BF95
:2016000028EBEAEA08C9BFD0FE6848C9FFD0FE28C042D0FEE000D0FEA042A203FBCACACAB9
:20162000D0FEA90048A90428FBEAEA08C904D0FE6848C930D0FE28A9FF48A9AF28FBEAEAC6
:2016400008C9AFD0FE6848C9FFD0FE28C042D0FEE000D0FEAD0202C908D0FEA9098D0202BD
:20166000A203BD8B269DFD02CA10F7A9288D0002A9004828A949A24EA0446CFD02EAD0FE88
:2016800088880888888828F0FE10FE90FE50FEC9E3D0FEE04FD0FEC03ED0FEBAE0FFD0FEF0
:2016A000AD0202C909D0FEA90A8D0202A20BBDC7269DF902CA10F7A9278D0002A90048285D
:2016C000A958A204A0497CF902EAD0FE88880888888828F0FE10FE90FE50FEC9F2D0FEE032
:2016E00006D0FEC043D0FEBAE0FFD0FEA9088D0003A9178D0103A9058D0002A9178D0102BF
:20170000A2FF7C01024C0517AD0202C90AD0FEA90B8D0202A90048A942A252A04B2800883F
:2017200008888888C9E8D0FEE053D0FEC045D0FE68C930D0FEBAE0FFD0FEA9FF48A9BDA228
:20174000ADA0B428008808888888C917D0FEE0AED0FEC0AED0FE68C9FFD0FEBAE0FFD0FE8D
:20176000AD0202C90BD0FEA90C8D0202A2ACA0DCA9FF48A9FE281A4808C9FFD0FE6848C9CE
:20178000FDD0FE28681A4808C900D0FE6848C97FD0FE28681A4808C901D0FE6848C97DD0CF
:2017A000FE28683A4808C900D0FE6848C97FD0FE28683A4808C9FFD0FE6848C9FDD0FE2898
:2017C000683AA90048A9FE281A4808C9FFD0FE6848C9B0D0FE28681A4808C900D0FE68486F
:2017E000C932D0FE28681A4808C901D0FE6848C930D0FE28683A4808C900D0FE6848C932BB
:20180000D0FE28683A4808C9FFD0FE6848C9B0D0FE2868E0ACD0FEC0DCD0FEBAE0FFD0FE98
:20182000AD0202C90CD0FEA90D8D0202A299A066A9004828B2240849C32892300849C3C902
:20184000C3D0FE684930CD1502D0FEA9004828B2260849C32892320849C3C982D0FE684995
:2018600030CD1602D0FEA9004828B2280849C32892340849C3C941D0FE684930CD1702D00D
:20188000FEA9004828B22A0849C32892360849C3C900D0FE684930CD1802D0FEE099D0FEC9
:2018A000C066D0FEA003A200B9050249C3D91002D0FE8A9905028810EFA299A066A9FF4888
:2018C00028B2240849C32892300849C3C9C3D0FE68497DCD1502D0FEA9FF4828B22608497D
:2018E000C32892320849C3C982D0FE68497DCD1602D0FEA9FF4828B2280849C3289234082F
:2019000049C3C941D0FE68497DCD1702D0FEA9FF4828B22A0849C32892360849C3C900D05C
:20192000FE68497DCD1802D0FEE099D0FEC066D0FEA003A200B9050249C3D91002D0FE8A37
:201940009905028810EFBAE0FFD0FEAD0202C90DD0FEA90E8D0202A07BA204A907950C0A40
:20196000CA10FAA204A9FF48A95528640C640D640E640F641008C955D0FE6848C9FFD0FE63
:2019800028B50CD0FECA10F9A204A907950C0ACA10FAA204A90048A9AA28640C640D640E83
:2019A000640F641008C9AAD0FE6848C930D0FE28B50CD0FECA10F9A204A9079D05020ACA28
:2019C00010F9A204A9FF48A955289C05029C06029C07029C08029C090208C955D0FE684865
:2019E000C9FFD0FE28BD0502D0FECA10F8A204A9079D05020ACA10F9A204A90048A9AA28DC
:201A00009C05029C06029C07029C08029C090208C9AAD0FE6848C930D0FE28BD0502D0FE13
:201A2000CA10F8A204A907950C0ACA10FAA204A9FF48A95528740C08C955D0FE6848C9FF57
:201A4000D0FE28CA10E9A204B50CD0FECA10F9A204A907950C0ACA10FAA204A90048A9AA06
:201A600028740C08C9AAD0FE6848C930D0FE28CA10E9A204B50CD0FECA10F9A204A9079D18
:201A800005020ACA10F9A204A9FF48A955289E050208C955D0FE6848C9FFD0FE28CA10E8DD
:201AA000A204BD0502D0FECA10F8A204A9079D05020ACA10F9A204A90048A9AA289E05028E
:201AC00008C9AAD0FE6848C930D0FE28CA10E8A204BD0502D0FECA10F8C07BD0FEBAE0FFB0
:201AE000D0FEAD0202C90ED0FEA90F8D0202A042A203A90048A9FF28341308C9FFD0FE68E4
:201B000048C932D0FE28CAA90048A90128341308C901D0FE6848C970D0FE28CAA90048A9D5
:201B20000128341308C901D0FE6848C9B2D0FE28CAA90048A90128341308C901D0FE684850
:201B4000C9F0D0FE28A9FF48A90128341308C901D0FE6848C9FDD0FE28E8A9FF48A9012817
:201B6000341308C901D0FE6848C9BFD0FE28E8A9FF48A90128341308C901D0FE6848C97DC9
:201B8000D0FE28E8A9FF48A9FF28341308C9FFD0FE6848C93FD0FE28A90048A9FF283C1007
:201BA0000208C9FFD0FE6848C932D0FE28CAA90048A901283C100208C901D0FE6848C97080
:201BC000D0FE28CAA90048A901283C100208C901D0FE6848C9B2D0FE28CAA90048A90128E6
:201BE0003C100208C901D0FE6848C9F0D0FE28A9FF48A901283C100208C901D0FE6848C96F
:201C0000FDD0FE28E8A9FF48A901283C100208C901D0FE6848C9BFD0FE28E8A9FF48A90189
:201C2000283C100208C901D0FE6848C97DD0FE28E8A9FF48A9FF283C100208C9FFD0FE68A6
:201C400048C93FD0FE28A90048A9FF28890008C9FFD0FE6848C932D0FE28CAA90048A90150
:201C600028894108C901D0FE6848C930D0FE28CAA90048A90128898208C901D0FE6848C982
:201C800032D0FE28CAA90048A9012889C308C901D0FE6848C930D0FE28A9FF48A9012889B9
:201CA000C308C901D0FE6848C9FDD0FE28E8A9FF48A90128898208C901D0FE6848C9FFD0B8
:201CC000FE28E8A9FF48A90128894108C901D0FE6848C9FDD0FE28E8A9FF48A9FF2889002D
:201CE00008C9FFD0FE6848C9FFD0FE28E003D0FEC042D0FEBAE0FFD0FEAD0202C90FD0FE99
:201D0000A9108D0202A2C0A000640D98250D08682902850E9849FF050D49FF850F98050D96
:201D20008510840CA9FF48A50D28140C08C50DD0FE68480902C9FFD0FE682902C50ED0FE67
:201D4000A50FC50CD0FE8C0502A9FF48A50D281C050208C50DD0FE68480902C9FFD0FE684F
:201D60002902C50ED0FEA50FC50CD0FE840CA90048A50D28140C08C50DD0FE68480902C99D
:201D800032D0FE682902C50ED0FEA50FC50CD0FE8C0502A90048A50D281C050208C50DD091
:201DA000FE68480902C932D0FE682902C50ED0FEA50FC50CD0FE840CA9FF48A50D28040CB0
:201DC00008C50DD0FE68480902C9FFD0FE682902C50ED0FEA510C50CD0FE8C0502A9FF48FF
:201DE000A50D280C050208C50DD0FE68480902C9FFD0FE682902C50ED0FEA510C50CD0FE75
:201E0000840CA90048A50D28040C08C50DD0FE68480902C932D0FE682902C50ED0FEA51042
:201E2000C50CD0FE8C0502A90048A50D280C050208C50DD0FE68480902C932D0FE682902D3
:201E4000C50ED0FEA510C50CD0FEC8D004E60DF0034C0B1DE0C0D0FEBAE0FFD0FEAD020211
:201E6000C910D0FEA9118D0202A2BAA0D0A9FF850CA90048A9A528070C08C9A5D0FE6848FD
:201E8000C930D0FE28A50CC9FED0FEA901850CA9FF48A95A28070C08C95AD0FE6848C9FF33
:201EA000D0FE28A50CD0FEA9FF850CA90048A9A528170C08C9A5D0FE6848C930D0FE28A562
:201EC0000CC9FDD0FEA902850CA9FF48A95A28170C08C95AD0FE6848C9FFD0FE28A50CD000
:201EE000FEA9FF850CA90048A9A528270C08C9A5D0FE6848C930D0FE28A50CC9FBD0FEA942
:201F000004850CA9FF48A95A28270C08C95AD0FE6848C9FFD0FE28A50CD0FEA9FF850CA916
:201F20000048A9A528370C08C9A5D0FE6848C930D0FE28A50CC9F7D0FEA908850CA9FF484C
:201F4000A95A28370C08C95AD0FE6848C9FFD0FE28A50CD0FEA9FF850CA90048A9A5284746
:201F60000C08C9A5D0FE6848C930D0FE28A50CC9EFD0FEA910850CA9FF48A95A28470C087B
:201F8000C95AD0FE6848C9FFD0FE28A50CD0FEA9FF850CA90048A9A528570C08C9A5D0FE1C
:201FA0006848C930D0FE28A50CC9DFD0FEA920850CA9FF48A95A28570C08C95AD0FE6848DA
:201FC000C9FFD0FE28A50CD0FEA9FF850CA90048A9A528670C08C9A5D0FE6848C930D0FEF6
:201FE00028A50CC9BFD0FEA940850CA9FF48A95A28670C08C95AD0FE6848C9FFD0FE28A59E
:202000000CD0FEA9FF850CA90048A9A528770C08C9A5D0FE6848C930D0FE28A50CC97FD017
:20202000FEA980850CA9FF48A95A28770C08C95AD0FE6848C9FFD0FE28A50CD0FEA9FE8538
:202040000CA90048A9A528870C08C9A5D0FE6848C930D0FE28A50CC9FFD0FEA900850CA96D
:20206000FF48A95A28870C08C95AD0FE6848C9FFD0FE28A50CC901D0FEA9FD850CA9004883
:20208000A9A528970C08C9A5D0FE6848C930D0FE28A50CC9FFD0FEA900850CA9FF48A95AD0
:2020A00028970C08C95AD0FE6848C9FFD0FE28A50CC902D0FEA9FB850CA90048A9A528A761
:2020C0000C08C9A5D0FE6848C930D0FE28A50CC9FFD0FEA900850CA9FF48A95A28A70C08BA
:2020E000C95AD0FE6848C9FFD0FE28A50CC904D0FEA9F7850CA90048A9A528B70C08C9A564
:20210000D0FE6848C930D0FE28A50CC9FFD0FEA900850CA9FF48A95A28B70C08C95AD0FEFA
:202120006848C9FFD0FE28A50CC908D0FEA9EF850CA90048A9A528C70C08C9A5D0FE68488A
:20214000C930D0FE28A50CC9FFD0FEA900850CA9FF48A95A28C70C08C95AD0FE6848C9FFB0
:20216000D0FE28A50CC910D0FEA9DF850CA90048A9A528D70C08C9A5D0FE6848C930D0FEF3
:2021800028A50CC9FFD0FEA900850CA9FF48A95A28D70C08C95AD0FE6848C9FFD0FE28A58C
:2021A0000CC920D0FEA9BF850CA90048A9A528E70C08C9A5D0FE6848C930D0FE28A50CC9AC
:2021C000FFD0FEA900850CA9FF48A95A28E70C08C95AD0FE6848C9FFD0FE28A50CC940D0F9
:2021E000FEA97F850CA90048A9A528F70C08C9A5D0FE6848C930D0FE28A50CC9FFD0FEA9EB
:2022000000850CA9FF48A95A28F70C08C95AD0FE6848C9FFD0FE28A50CC980D0FEE0BAD076
:20222000FEC0D0D0FEBAE0FFD0FEAD0202C911D0FEA9128D0202A2DEA0ADA90048A9802827
:20224000D22C08C980D0FE6848C931D0FE28A90048A97F28D22C08C97FD0FE6848C933D0E8
:20226000FE28A90048A97E28D22C08C97ED0FE6848C9B0D0FE28A9FF48A98028D22C08C9AE
:2022800080D0FE6848C97DD0FE28A9FF48A97F28D22C08C97FD0FE6848C97FD0FE28A9FF12
:2022A00048A97E28D22C08C97ED0FE6848C9FCD0FE28E0DED0FEC0ADD0FEBAE0FFD0FEAD26
:2022C0000202C912D0FEA9138D0202A242A000A53A850CA53B850DA90048B9530228320C39
:2022E00008D95B02D0FE684930D95F02D0FEE60CC8C004D0E288C60CA9FF48B95302283207
:202300000C08D95B02D0FE68497DD95F02D0FEC60C8810E4A000A542850CA543850DA900E6
:2023200048B9570228520C08D95B02D0FE684930D95F02D0FEE60CC8C004D0E288C60CA995
:20234000FF48B9570228520C08D95B02D0FE68497DD95F02D0FEC60C8810E4A000A54A85FA
:202360000CA54B850DA90048B94F0228120C08D95B02D0FE684930D95F02D0FEE60CC8C01F
:2023800004D0E288C60CA9FF48B94F0228120C08D95B02D0FE68497DD95F02D0FEC60C8851
:2023A00010E4E042D0FEBAE0FFD0FEAD0202C913D0FEA9148D020258D8A20EA0FFA900857C
:2023C0000C850D850E8D0502850F8510A9FF85128D0602A902851118204E26E60CE60F085F
:2023E0000868298228D002E6100510851138204E26C60CE60DD0E0A9008510EE0502E60EBF
:20240000086829828511C612CE0602A50E850FD0C6E00ED0FEC0FFD0FEBAE0FFD0FEAD0221
:2024200002C914D0FEA9158D0202F8A20EA0FFA999850D850E8D0502850FA901850C8510FA
:20244000A9818511A90085128D06023820F724C60CA50FD008C610A999850FD012290FD080
:202460000CC60FC60FC60FC60FC60FC60FC60F08682982051085111820F724E60CA50DF0D0
:2024800015290FD00CC60DC60DC60DC60DC60DC60DC60D4C4B24A999850DA50EF039290FAB
:2024A000D018C60EC60EC60EC60EC60EC60EE612E612E612E612E612E612C60EE612A512E9
:2024C0008D0602A50E8D0502850F0868298209018511E6104C4B24E00ED0FEC0FFD0FEBA1D
:2024E000E0FFD0FED8AD0202C915D0FEA9F08D02024CF1244C000408A50D650E08C50FD046
:20250000FE682983C511D0FE2808A50DE51208C50FD0FE682983C511D0FE2808A50D6D0576
:202520000208C50FD0FE682983C511D0FE2808A50DED060208C50FD0FE682983C511D0FEFE
:202540002808A50E8D0B02A50D200A0208C50FD0FE682983C511D0FE2808A5128D0E02A595
:202560000D200D0208C50FD0FE682983C511D0FE2808A50D750008C50FD0FE682983C511D2
:20258000D0FE2808A50DF50408C50FD0FE682983C511D0FE2808A50D7DF70108C50FD0FE2F
:2025A000682983C511D0FE2808A50DFDF80108C50FD0FE682983C511D0FE2808A50D7906C8
:2025C0000108C50FD0FE682983C511D0FE2808A50DF9070108C50FD0FE682983C511D0FE53
:2025E0002808A50D614408C50FD0FE682983C511D0FE2808A50DE14608C50FD0FE6829832B
:20260000C511D0FE2808A50D715608C50FD0FE682983C511D0FE2808A50DF15808C50FD034
:20262000FE682983C511D0FE2808A50D725208C50FD0FE682983C511D0FE2808A50DF254B4
:2026400008C50FD0FE682983C511D0FE2860A511298348A50D450E300AA50D450F10046825
:2026600009404868851108A50D725208C50FD0FE6829C3C511D0FE2808A50DF25408C50FA7
:20268000D0FE6829C3C511D0FE28609126821688880888888828B0FE70FE30FEF0FEC9497B
:2026A000D0FEE04ED0FEC041D0FE488A48BAE0FDD0FE68AAA9FF482868E849AA6CFF02EA3E
:2026C000EA4CC1264C00040E270E27D526CE160E270E2788880888888828B0FE70FE30FEB8
:2026E000F0FEC958D0FEE004D0FEC046D0FE488A48BAE0FDD0FE68AAA9FF482868E8E8494D
:20270000AA7CF902EAEA4C06274C0004EAEAEAEA4C10274C00044C16274C00044C1C274CCC
:202720000004888808888888C9BDF042C942D0FEE052D0FEC048D0FE850A860BBABD0201E4
:20274000C930D0FE68C934D0FEBAE0FCD0FEADFF01C917D0FEADFE01C920D0FEA9FF48A6C7
:202760000BE8A50A49AA28404C68274C0004E0ADD0FEC0B1D0FE850A860BBABD0201C9FF35
:20278000D0FE68C9F7D0FEBAE0FCD0FEADFF01C917D0FEADFE01C946D0FEA90448A60BE89F
:2027A000A50A49AA28404CA6274C00040000000000000000000000000000000000000000A6
:2027C000000000000000000000000000EAEAEAEA4CD027000000000000000000000000000E
:2027E0000000000000000000000000000000000000000000000000000000000000000000D9
:202800000000000000000000000000000000000000000000000000000000000000000000B8
:20282000000000000000000000000000000000000000000000000000000000000000000098
:20284000000000000000000000000000000000000000000000000000000000000000000078
:20286000000000000000000000000000000000000000000000000000000000000000000058
:07288000EAEAEAEA4C8428B1
:06FFFA0016271C27242736
:00040001FB

File diff suppressed because it is too large Load Diff

BIN
tests/65c02-a.bin Normal file

Binary file not shown.

363
tests/65c02-a.lst Normal file
View File

@ -0,0 +1,363 @@
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
----------------------------------------------------- 6502_decimal_test.a65 ------------------------------------------------------
355 lines read, no errors in pass 1.
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
0001 = cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
0000 = vld_bcd = 0 ; 0 = allow invalid bcd, 1 = valid bcd only
0001 = chk_a = 1 ; check accumulator
0000 = chk_n = 0 ; check sign (negative) flag
0000 = chk_v = 0 ; check overflow flag
0000 = chk_z = 0 ; check zero flag
0000 = chk_c = 0 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
0000 = org 0
; operands - register Y = carry in
0000 = N1 ds 1
0001 = N2 ds 1
; binary result
0002 = HA ds 1
0003 = HNVZC ds 1
;04
; decimal result
0004 = DA ds 1
0005 = DNVZC ds 1
; predicted results
0006 = AR ds 1
0007 = NF ds 1
;08
0008 = VF ds 1
0009 = ZF ds 1
000a = CF ds 1
000b = ERROR ds 1
;0C
; workspace
000c = N1L ds 1
000d = N1H ds 1
000e = N2L ds 1
000f = N2H ds 2
code
0200 = org $200
0200 : a001 TEST ldy #1 ; initialize Y (used to loop through carry flag values)
0202 : 840b sty ERROR ; store 1 in ERROR until the test passes
0204 : a900 lda #0 ; initialize N1 and N2
0206 : 8500 sta N1
0208 : 8501 sta N2
020a : a501 LOOP1 lda N2 ; N2L = N2 & $0F
020c : 290f and #$0F ; [1] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT2
endif
020e : 850e sta N2L
0210 : a501 lda N2 ; N2H = N2 & $F0
0212 : 29f0 and #$F0 ; [2] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT2
endif
0214 : 850f sta N2H
0216 : 090f ora #$0F ; N2H+1 = (N2 & $F0) + $0F
0218 : 8510 sta N2H+1
021a : a500 LOOP2 lda N1 ; N1L = N1 & $0F
021c : 290f and #$0F ; [3] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT1
endif
021e : 850c sta N1L
0220 : a500 lda N1 ; N1H = N1 & $F0
0222 : 29f0 and #$F0 ; [4] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT1
endif
0224 : 850d sta N1H
0226 : 204c02 jsr ADD
0229 : 20d102 jsr A6502
022c : 20ca02 jsr COMPARE
022f : d01a bne DONE
0231 : 209002 jsr SUB
0234 : 20da02 jsr S6502
0237 : 20ca02 jsr COMPARE
023a : d00f bne DONE
023c : e600 NEXT1 inc N1 ; [5] see text
023e : d0da bne LOOP2 ; loop through all 256 values of N1
0240 : e601 NEXT2 inc N2 ; [6] see text
0242 : d0c6 bne LOOP1 ; loop through all 256 values of N2
0244 : 88 dey
0245 : 10c3 bpl LOOP1 ; loop through both values of the carry flag
0247 : a900 lda #0 ; test passed, so store 0 in ERROR
0249 : 850b sta ERROR
024b : DONE
end_of_test
024b : db > db $db ;execute 65C02 stop instruction
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
024c : f8 ADD sed ; decimal mode
024d : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
024f : a500 lda N1
0251 : 6501 adc N2
0253 : 8504 sta DA ; actual accumulator result in decimal mode
0255 : 08 php
0256 : 68 pla
0257 : 8505 sta DNVZC ; actual flags result in decimal mode
0259 : d8 cld ; binary mode
025a : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
025c : a500 lda N1
025e : 6501 adc N2
0260 : 8502 sta HA ; accumulator result of N1+N2 using binary arithmetic
0262 : 08 php
0263 : 68 pla
0264 : 8503 sta HNVZC ; flags result of N1+N2 using binary arithmetic
0266 : c001 cpy #1
0268 : a50c lda N1L
026a : 650e adc N2L
026c : c90a cmp #$0A
026e : a200 ldx #0
0270 : 9006 bcc A1
0272 : e8 inx
0273 : 6905 adc #5 ; add 6 (carry is set)
0275 : 290f and #$0F
0277 : 38 sec
0278 : 050d A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
027a : 750f adc N2H,x
027c : 08 php
027d : b004 bcs A2
027f : c9a0 cmp #$A0
0281 : 9003 bcc A3
0283 : 695f A2 adc #$5F ; add $60 (carry is set)
0285 : 38 sec
0286 : 8506 A3 sta AR ; predicted accumulator result
0288 : 08 php
0289 : 68 pla
028a : 850a sta CF ; predicted carry result
028c : 68 pla
;
; note that all 8 bits of the P register are stored in VF
;
028d : 8508 sta VF ; predicted V flags
028f : 60 rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
0290 : f8 SUB sed ; decimal mode
0291 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0293 : a500 lda N1
0295 : e501 sbc N2
0297 : 8504 sta DA ; actual accumulator result in decimal mode
0299 : 08 php
029a : 68 pla
029b : 8505 sta DNVZC ; actual flags result in decimal mode
029d : d8 cld ; binary mode
029e : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02a0 : a500 lda N1
02a2 : e501 sbc N2
02a4 : 8502 sta HA ; accumulator result of N1-N2 using binary arithmetic
02a6 : 08 php
02a7 : 68 pla
02a8 : 8503 sta HNVZC ; flags result of N1-N2 using binary arithmetic
02aa : 60 rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
02ab : c001 SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02ad : a50c lda N1L
02af : e50e sbc N2L
02b1 : a200 ldx #0
02b3 : b004 bcs S21
02b5 : e8 inx
02b6 : 290f and #$0F
02b8 : 18 clc
02b9 : 050d S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
02bb : f50f sbc N2H,x
02bd : b002 bcs S22
02bf : e95f sbc #$5F ; subtract $60 (carry is clear)
02c1 : e000 S22 cpx #0
02c3 : f002 beq S23
02c5 : e906 sbc #6
02c7 : 8506 S23 sta AR ; predicted accumulator result
02c9 : 60 rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
02ca : COMPARE
if chk_a = 1
02ca : a504 lda DA
02cc : c506 cmp AR
02ce : d000 bne C1
endif
if chk_n = 1
lda DNVZC ; [7] see text
eor NF
and #$80 ; mask off N flag
bne C1
endif
if chk_v = 1
lda DNVZC ; [8] see text
eor VF
and #$40 ; mask off V flag
bne C1 ; [9] see text
endif
if chk_z = 1
lda DNVZC
eor ZF ; mask off Z flag
and #2
bne C1 ; [10] see text
endif
if chk_c = 1
lda DNVZC
eor CF
and #1 ; mask off C flag
endif
02d0 : 60 C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
02d1 : a506 A6502 lda AR ; 65C02
02d3 : 08 php
02d4 : 68 pla
02d5 : 8507 sta NF
02d7 : 8509 sta ZF
02d9 : 60 rts
02da : 20ab02 S6502 jsr SUB2
02dd : a506 lda AR
02df : 08 php
02e0 : 68 pla
02e1 : 8507 sta NF
02e3 : 8509 sta ZF
02e5 : a503 lda HNVZC
02e7 : 8508 sta VF
02e9 : 850a sta CF
02eb : 60 rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
02da = end TEST
No errors in pass 2.

BIN
tests/65c02-addonly-a.bin Normal file

Binary file not shown.

363
tests/65c02-addonly-a.lst Normal file
View File

@ -0,0 +1,363 @@
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
----------------------------------------------------- 6502_decimal_test.a65 ------------------------------------------------------
355 lines read, no errors in pass 1.
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
0001 = cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
0000 = vld_bcd = 0 ; 0 = allow invalid bcd, 1 = valid bcd only
0001 = chk_a = 1 ; check accumulator
0000 = chk_n = 0 ; check sign (negative) flag
0000 = chk_v = 0 ; check overflow flag
0000 = chk_z = 0 ; check zero flag
0000 = chk_c = 0 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
0000 = org 0
; operands - register Y = carry in
0000 = N1 ds 1
0001 = N2 ds 1
; binary result
0002 = HA ds 1
0003 = HNVZC ds 1
;04
; decimal result
0004 = DA ds 1
0005 = DNVZC ds 1
; predicted results
0006 = AR ds 1
0007 = NF ds 1
;08
0008 = VF ds 1
0009 = ZF ds 1
000a = CF ds 1
000b = ERROR ds 1
;0C
; workspace
000c = N1L ds 1
000d = N1H ds 1
000e = N2L ds 1
000f = N2H ds 2
code
0200 = org $200
0200 : a001 TEST ldy #1 ; initialize Y (used to loop through carry flag values)
0202 : 840b sty ERROR ; store 1 in ERROR until the test passes
0204 : a900 lda #0 ; initialize N1 and N2
0206 : 8500 sta N1
0208 : 8501 sta N2
020a : a501 LOOP1 lda N2 ; N2L = N2 & $0F
020c : 290f and #$0F ; [1] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT2
endif
020e : 850e sta N2L
0210 : a501 lda N2 ; N2H = N2 & $F0
0212 : 29f0 and #$F0 ; [2] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT2
endif
0214 : 850f sta N2H
0216 : 090f ora #$0F ; N2H+1 = (N2 & $F0) + $0F
0218 : 8510 sta N2H+1
021a : a500 LOOP2 lda N1 ; N1L = N1 & $0F
021c : 290f and #$0F ; [3] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT1
endif
021e : 850c sta N1L
0220 : a500 lda N1 ; N1H = N1 & $F0
0222 : 29f0 and #$F0 ; [4] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT1
endif
0224 : 850d sta N1H
0226 : 204102 jsr ADD
0229 : 20c602 jsr A6502
022c : 20bf02 jsr COMPARE
022f : d00f bne DONE
; jsr SUB
; jsr S6502
; jsr COMPARE
; bne DONE
0231 : e600 NEXT1 inc N1 ; [5] see text
0233 : d0e5 bne LOOP2 ; loop through all 256 values of N1
0235 : e601 NEXT2 inc N2 ; [6] see text
0237 : d0d1 bne LOOP1 ; loop through all 256 values of N2
0239 : 88 dey
023a : 10ce bpl LOOP1 ; loop through both values of the carry flag
023c : a900 lda #0 ; test passed, so store 0 in ERROR
023e : 850b sta ERROR
0240 : DONE
end_of_test
0240 : db > db $db ;execute 65C02 stop instruction
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
0241 : f8 ADD sed ; decimal mode
0242 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0244 : a500 lda N1
0246 : 6501 adc N2
0248 : 8504 sta DA ; actual accumulator result in decimal mode
024a : 08 php
024b : 68 pla
024c : 8505 sta DNVZC ; actual flags result in decimal mode
024e : d8 cld ; binary mode
024f : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0251 : a500 lda N1
0253 : 6501 adc N2
0255 : 8502 sta HA ; accumulator result of N1+N2 using binary arithmetic
0257 : 08 php
0258 : 68 pla
0259 : 8503 sta HNVZC ; flags result of N1+N2 using binary arithmetic
025b : c001 cpy #1
025d : a50c lda N1L
025f : 650e adc N2L
0261 : c90a cmp #$0A
0263 : a200 ldx #0
0265 : 9006 bcc A1
0267 : e8 inx
0268 : 6905 adc #5 ; add 6 (carry is set)
026a : 290f and #$0F
026c : 38 sec
026d : 050d A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
026f : 750f adc N2H,x
0271 : 08 php
0272 : b004 bcs A2
0274 : c9a0 cmp #$A0
0276 : 9003 bcc A3
0278 : 695f A2 adc #$5F ; add $60 (carry is set)
027a : 38 sec
027b : 8506 A3 sta AR ; predicted accumulator result
027d : 08 php
027e : 68 pla
027f : 850a sta CF ; predicted carry result
0281 : 68 pla
;
; note that all 8 bits of the P register are stored in VF
;
0282 : 8508 sta VF ; predicted V flags
0284 : 60 rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
0285 : f8 SUB sed ; decimal mode
0286 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0288 : a500 lda N1
028a : e501 sbc N2
028c : 8504 sta DA ; actual accumulator result in decimal mode
028e : 08 php
028f : 68 pla
0290 : 8505 sta DNVZC ; actual flags result in decimal mode
0292 : d8 cld ; binary mode
0293 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0295 : a500 lda N1
0297 : e501 sbc N2
0299 : 8502 sta HA ; accumulator result of N1-N2 using binary arithmetic
029b : 08 php
029c : 68 pla
029d : 8503 sta HNVZC ; flags result of N1-N2 using binary arithmetic
029f : 60 rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
02a0 : c001 SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02a2 : a50c lda N1L
02a4 : e50e sbc N2L
02a6 : a200 ldx #0
02a8 : b004 bcs S21
02aa : e8 inx
02ab : 290f and #$0F
02ad : 18 clc
02ae : 050d S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
02b0 : f50f sbc N2H,x
02b2 : b002 bcs S22
02b4 : e95f sbc #$5F ; subtract $60 (carry is clear)
02b6 : e000 S22 cpx #0
02b8 : f002 beq S23
02ba : e906 sbc #6
02bc : 8506 S23 sta AR ; predicted accumulator result
02be : 60 rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
02bf : COMPARE
if chk_a = 1
02bf : a504 lda DA
02c1 : c506 cmp AR
02c3 : d000 bne C1
endif
if chk_n = 1
lda DNVZC ; [7] see text
eor NF
and #$80 ; mask off N flag
bne C1
endif
if chk_v = 1
lda DNVZC ; [8] see text
eor VF
and #$40 ; mask off V flag
bne C1 ; [9] see text
endif
if chk_z = 1
lda DNVZC
eor ZF ; mask off Z flag
and #2
bne C1 ; [10] see text
endif
if chk_c = 1
lda DNVZC
eor CF
and #1 ; mask off C flag
endif
02c5 : 60 C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
02c6 : a506 A6502 lda AR ; 65C02
02c8 : 08 php
02c9 : 68 pla
02ca : 8507 sta NF
02cc : 8509 sta ZF
02ce : 60 rts
02cf : 20a002 S6502 jsr SUB2
02d2 : a506 lda AR
02d4 : 08 php
02d5 : 68 pla
02d6 : 8507 sta NF
02d8 : 8509 sta ZF
02da : a503 lda HNVZC
02dc : 8508 sta VF
02de : 850a sta CF
02e0 : 60 rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
02cf = end TEST
No errors in pass 2.

BIN
tests/65c02-addonly-c.bin Normal file

Binary file not shown.

363
tests/65c02-addonly-c.lst Normal file
View File

@ -0,0 +1,363 @@
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
----------------------------------------------------- 6502_decimal_test.a65 ------------------------------------------------------
355 lines read, no errors in pass 1.
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
0001 = cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
0000 = vld_bcd = 0 ; 0 = allow invalid bcd, 1 = valid bcd only
0000 = chk_a = 0 ; check accumulator
0000 = chk_n = 0 ; check sign (negative) flag
0000 = chk_v = 0 ; check overflow flag
0000 = chk_z = 0 ; check zero flag
0001 = chk_c = 1 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
0000 = org 0
; operands - register Y = carry in
0000 = N1 ds 1
0001 = N2 ds 1
; binary result
0002 = HA ds 1
0003 = HNVZC ds 1
;04
; decimal result
0004 = DA ds 1
0005 = DNVZC ds 1
; predicted results
0006 = AR ds 1
0007 = NF ds 1
;08
0008 = VF ds 1
0009 = ZF ds 1
000a = CF ds 1
000b = ERROR ds 1
;0C
; workspace
000c = N1L ds 1
000d = N1H ds 1
000e = N2L ds 1
000f = N2H ds 2
code
0200 = org $200
0200 : a001 TEST ldy #1 ; initialize Y (used to loop through carry flag values)
0202 : 840b sty ERROR ; store 1 in ERROR until the test passes
0204 : a900 lda #0 ; initialize N1 and N2
0206 : 8500 sta N1
0208 : 8501 sta N2
020a : a501 LOOP1 lda N2 ; N2L = N2 & $0F
020c : 290f and #$0F ; [1] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT2
endif
020e : 850e sta N2L
0210 : a501 lda N2 ; N2H = N2 & $F0
0212 : 29f0 and #$F0 ; [2] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT2
endif
0214 : 850f sta N2H
0216 : 090f ora #$0F ; N2H+1 = (N2 & $F0) + $0F
0218 : 8510 sta N2H+1
021a : a500 LOOP2 lda N1 ; N1L = N1 & $0F
021c : 290f and #$0F ; [3] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT1
endif
021e : 850c sta N1L
0220 : a500 lda N1 ; N1H = N1 & $F0
0222 : 29f0 and #$F0 ; [4] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT1
endif
0224 : 850d sta N1H
0226 : 204102 jsr ADD
0229 : 20c602 jsr A6502
022c : 20bf02 jsr COMPARE
022f : d00f bne DONE
; jsr SUB
; jsr S6502
; jsr COMPARE
; bne DONE
0231 : e600 NEXT1 inc N1 ; [5] see text
0233 : d0e5 bne LOOP2 ; loop through all 256 values of N1
0235 : e601 NEXT2 inc N2 ; [6] see text
0237 : d0d1 bne LOOP1 ; loop through all 256 values of N2
0239 : 88 dey
023a : 10ce bpl LOOP1 ; loop through both values of the carry flag
023c : a900 lda #0 ; test passed, so store 0 in ERROR
023e : 850b sta ERROR
0240 : DONE
end_of_test
0240 : db > db $db ;execute 65C02 stop instruction
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
0241 : f8 ADD sed ; decimal mode
0242 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0244 : a500 lda N1
0246 : 6501 adc N2
0248 : 8504 sta DA ; actual accumulator result in decimal mode
024a : 08 php
024b : 68 pla
024c : 8505 sta DNVZC ; actual flags result in decimal mode
024e : d8 cld ; binary mode
024f : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0251 : a500 lda N1
0253 : 6501 adc N2
0255 : 8502 sta HA ; accumulator result of N1+N2 using binary arithmetic
0257 : 08 php
0258 : 68 pla
0259 : 8503 sta HNVZC ; flags result of N1+N2 using binary arithmetic
025b : c001 cpy #1
025d : a50c lda N1L
025f : 650e adc N2L
0261 : c90a cmp #$0A
0263 : a200 ldx #0
0265 : 9006 bcc A1
0267 : e8 inx
0268 : 6905 adc #5 ; add 6 (carry is set)
026a : 290f and #$0F
026c : 38 sec
026d : 050d A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
026f : 750f adc N2H,x
0271 : 08 php
0272 : b004 bcs A2
0274 : c9a0 cmp #$A0
0276 : 9003 bcc A3
0278 : 695f A2 adc #$5F ; add $60 (carry is set)
027a : 38 sec
027b : 8506 A3 sta AR ; predicted accumulator result
027d : 08 php
027e : 68 pla
027f : 850a sta CF ; predicted carry result
0281 : 68 pla
;
; note that all 8 bits of the P register are stored in VF
;
0282 : 8508 sta VF ; predicted V flags
0284 : 60 rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
0285 : f8 SUB sed ; decimal mode
0286 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0288 : a500 lda N1
028a : e501 sbc N2
028c : 8504 sta DA ; actual accumulator result in decimal mode
028e : 08 php
028f : 68 pla
0290 : 8505 sta DNVZC ; actual flags result in decimal mode
0292 : d8 cld ; binary mode
0293 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0295 : a500 lda N1
0297 : e501 sbc N2
0299 : 8502 sta HA ; accumulator result of N1-N2 using binary arithmetic
029b : 08 php
029c : 68 pla
029d : 8503 sta HNVZC ; flags result of N1-N2 using binary arithmetic
029f : 60 rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
02a0 : c001 SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02a2 : a50c lda N1L
02a4 : e50e sbc N2L
02a6 : a200 ldx #0
02a8 : b004 bcs S21
02aa : e8 inx
02ab : 290f and #$0F
02ad : 18 clc
02ae : 050d S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
02b0 : f50f sbc N2H,x
02b2 : b002 bcs S22
02b4 : e95f sbc #$5F ; subtract $60 (carry is clear)
02b6 : e000 S22 cpx #0
02b8 : f002 beq S23
02ba : e906 sbc #6
02bc : 8506 S23 sta AR ; predicted accumulator result
02be : 60 rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
02bf : COMPARE
if chk_a = 1
lda DA
cmp AR
bne C1
endif
if chk_n = 1
lda DNVZC ; [7] see text
eor NF
and #$80 ; mask off N flag
bne C1
endif
if chk_v = 1
lda DNVZC ; [8] see text
eor VF
and #$40 ; mask off V flag
bne C1 ; [9] see text
endif
if chk_z = 1
lda DNVZC
eor ZF ; mask off Z flag
and #2
bne C1 ; [10] see text
endif
if chk_c = 1
02bf : a505 lda DNVZC
02c1 : 450a eor CF
02c3 : 2901 and #1 ; mask off C flag
endif
02c5 : 60 C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
02c6 : a506 A6502 lda AR ; 65C02
02c8 : 08 php
02c9 : 68 pla
02ca : 8507 sta NF
02cc : 8509 sta ZF
02ce : 60 rts
02cf : 20a002 S6502 jsr SUB2
02d2 : a506 lda AR
02d4 : 08 php
02d5 : 68 pla
02d6 : 8507 sta NF
02d8 : 8509 sta ZF
02da : a503 lda HNVZC
02dc : 8508 sta VF
02de : 850a sta CF
02e0 : 60 rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
02cf = end TEST
No errors in pass 2.

BIN
tests/65c02-addonly-n.bin Normal file

Binary file not shown.

363
tests/65c02-addonly-n.lst Normal file
View File

@ -0,0 +1,363 @@
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
----------------------------------------------------- 6502_decimal_test.a65 ------------------------------------------------------
355 lines read, no errors in pass 1.
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
0001 = cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
0000 = vld_bcd = 0 ; 0 = allow invalid bcd, 1 = valid bcd only
0000 = chk_a = 0 ; check accumulator
0001 = chk_n = 1 ; check sign (negative) flag
0000 = chk_v = 0 ; check overflow flag
0000 = chk_z = 0 ; check zero flag
0000 = chk_c = 0 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
0000 = org 0
; operands - register Y = carry in
0000 = N1 ds 1
0001 = N2 ds 1
; binary result
0002 = HA ds 1
0003 = HNVZC ds 1
;04
; decimal result
0004 = DA ds 1
0005 = DNVZC ds 1
; predicted results
0006 = AR ds 1
0007 = NF ds 1
;08
0008 = VF ds 1
0009 = ZF ds 1
000a = CF ds 1
000b = ERROR ds 1
;0C
; workspace
000c = N1L ds 1
000d = N1H ds 1
000e = N2L ds 1
000f = N2H ds 2
code
0200 = org $200
0200 : a001 TEST ldy #1 ; initialize Y (used to loop through carry flag values)
0202 : 840b sty ERROR ; store 1 in ERROR until the test passes
0204 : a900 lda #0 ; initialize N1 and N2
0206 : 8500 sta N1
0208 : 8501 sta N2
020a : a501 LOOP1 lda N2 ; N2L = N2 & $0F
020c : 290f and #$0F ; [1] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT2
endif
020e : 850e sta N2L
0210 : a501 lda N2 ; N2H = N2 & $F0
0212 : 29f0 and #$F0 ; [2] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT2
endif
0214 : 850f sta N2H
0216 : 090f ora #$0F ; N2H+1 = (N2 & $F0) + $0F
0218 : 8510 sta N2H+1
021a : a500 LOOP2 lda N1 ; N1L = N1 & $0F
021c : 290f and #$0F ; [3] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT1
endif
021e : 850c sta N1L
0220 : a500 lda N1 ; N1H = N1 & $F0
0222 : 29f0 and #$F0 ; [4] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT1
endif
0224 : 850d sta N1H
0226 : 204102 jsr ADD
0229 : 20c802 jsr A6502
022c : 20bf02 jsr COMPARE
022f : d00f bne DONE
; jsr SUB
; jsr S6502
; jsr COMPARE
; bne DONE
0231 : e600 NEXT1 inc N1 ; [5] see text
0233 : d0e5 bne LOOP2 ; loop through all 256 values of N1
0235 : e601 NEXT2 inc N2 ; [6] see text
0237 : d0d1 bne LOOP1 ; loop through all 256 values of N2
0239 : 88 dey
023a : 10ce bpl LOOP1 ; loop through both values of the carry flag
023c : a900 lda #0 ; test passed, so store 0 in ERROR
023e : 850b sta ERROR
0240 : DONE
end_of_test
0240 : db > db $db ;execute 65C02 stop instruction
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
0241 : f8 ADD sed ; decimal mode
0242 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0244 : a500 lda N1
0246 : 6501 adc N2
0248 : 8504 sta DA ; actual accumulator result in decimal mode
024a : 08 php
024b : 68 pla
024c : 8505 sta DNVZC ; actual flags result in decimal mode
024e : d8 cld ; binary mode
024f : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0251 : a500 lda N1
0253 : 6501 adc N2
0255 : 8502 sta HA ; accumulator result of N1+N2 using binary arithmetic
0257 : 08 php
0258 : 68 pla
0259 : 8503 sta HNVZC ; flags result of N1+N2 using binary arithmetic
025b : c001 cpy #1
025d : a50c lda N1L
025f : 650e adc N2L
0261 : c90a cmp #$0A
0263 : a200 ldx #0
0265 : 9006 bcc A1
0267 : e8 inx
0268 : 6905 adc #5 ; add 6 (carry is set)
026a : 290f and #$0F
026c : 38 sec
026d : 050d A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
026f : 750f adc N2H,x
0271 : 08 php
0272 : b004 bcs A2
0274 : c9a0 cmp #$A0
0276 : 9003 bcc A3
0278 : 695f A2 adc #$5F ; add $60 (carry is set)
027a : 38 sec
027b : 8506 A3 sta AR ; predicted accumulator result
027d : 08 php
027e : 68 pla
027f : 850a sta CF ; predicted carry result
0281 : 68 pla
;
; note that all 8 bits of the P register are stored in VF
;
0282 : 8508 sta VF ; predicted V flags
0284 : 60 rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
0285 : f8 SUB sed ; decimal mode
0286 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0288 : a500 lda N1
028a : e501 sbc N2
028c : 8504 sta DA ; actual accumulator result in decimal mode
028e : 08 php
028f : 68 pla
0290 : 8505 sta DNVZC ; actual flags result in decimal mode
0292 : d8 cld ; binary mode
0293 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0295 : a500 lda N1
0297 : e501 sbc N2
0299 : 8502 sta HA ; accumulator result of N1-N2 using binary arithmetic
029b : 08 php
029c : 68 pla
029d : 8503 sta HNVZC ; flags result of N1-N2 using binary arithmetic
029f : 60 rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
02a0 : c001 SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02a2 : a50c lda N1L
02a4 : e50e sbc N2L
02a6 : a200 ldx #0
02a8 : b004 bcs S21
02aa : e8 inx
02ab : 290f and #$0F
02ad : 18 clc
02ae : 050d S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
02b0 : f50f sbc N2H,x
02b2 : b002 bcs S22
02b4 : e95f sbc #$5F ; subtract $60 (carry is clear)
02b6 : e000 S22 cpx #0
02b8 : f002 beq S23
02ba : e906 sbc #6
02bc : 8506 S23 sta AR ; predicted accumulator result
02be : 60 rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
02bf : COMPARE
if chk_a = 1
lda DA
cmp AR
bne C1
endif
if chk_n = 1
02bf : a505 lda DNVZC ; [7] see text
02c1 : 4507 eor NF
02c3 : 2980 and #$80 ; mask off N flag
02c5 : d000 bne C1
endif
if chk_v = 1
lda DNVZC ; [8] see text
eor VF
and #$40 ; mask off V flag
bne C1 ; [9] see text
endif
if chk_z = 1
lda DNVZC
eor ZF ; mask off Z flag
and #2
bne C1 ; [10] see text
endif
if chk_c = 1
lda DNVZC
eor CF
and #1 ; mask off C flag
endif
02c7 : 60 C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
02c8 : a506 A6502 lda AR ; 65C02
02ca : 08 php
02cb : 68 pla
02cc : 8507 sta NF
02ce : 8509 sta ZF
02d0 : 60 rts
02d1 : 20a002 S6502 jsr SUB2
02d4 : a506 lda AR
02d6 : 08 php
02d7 : 68 pla
02d8 : 8507 sta NF
02da : 8509 sta ZF
02dc : a503 lda HNVZC
02de : 8508 sta VF
02e0 : 850a sta CF
02e2 : 60 rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
02d1 = end TEST
No errors in pass 2.

BIN
tests/65c02-addonly-v.bin Normal file

Binary file not shown.

363
tests/65c02-addonly-v.lst Normal file
View File

@ -0,0 +1,363 @@
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
----------------------------------------------------- 6502_decimal_test.a65 ------------------------------------------------------
355 lines read, no errors in pass 1.
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
0001 = cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
0000 = vld_bcd = 0 ; 0 = allow invalid bcd, 1 = valid bcd only
0000 = chk_a = 0 ; check accumulator
0000 = chk_n = 0 ; check sign (negative) flag
0001 = chk_v = 1 ; check overflow flag
0000 = chk_z = 0 ; check zero flag
0000 = chk_c = 0 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
0000 = org 0
; operands - register Y = carry in
0000 = N1 ds 1
0001 = N2 ds 1
; binary result
0002 = HA ds 1
0003 = HNVZC ds 1
;04
; decimal result
0004 = DA ds 1
0005 = DNVZC ds 1
; predicted results
0006 = AR ds 1
0007 = NF ds 1
;08
0008 = VF ds 1
0009 = ZF ds 1
000a = CF ds 1
000b = ERROR ds 1
;0C
; workspace
000c = N1L ds 1
000d = N1H ds 1
000e = N2L ds 1
000f = N2H ds 2
code
0200 = org $200
0200 : a001 TEST ldy #1 ; initialize Y (used to loop through carry flag values)
0202 : 840b sty ERROR ; store 1 in ERROR until the test passes
0204 : a900 lda #0 ; initialize N1 and N2
0206 : 8500 sta N1
0208 : 8501 sta N2
020a : a501 LOOP1 lda N2 ; N2L = N2 & $0F
020c : 290f and #$0F ; [1] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT2
endif
020e : 850e sta N2L
0210 : a501 lda N2 ; N2H = N2 & $F0
0212 : 29f0 and #$F0 ; [2] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT2
endif
0214 : 850f sta N2H
0216 : 090f ora #$0F ; N2H+1 = (N2 & $F0) + $0F
0218 : 8510 sta N2H+1
021a : a500 LOOP2 lda N1 ; N1L = N1 & $0F
021c : 290f and #$0F ; [3] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT1
endif
021e : 850c sta N1L
0220 : a500 lda N1 ; N1H = N1 & $F0
0222 : 29f0 and #$F0 ; [4] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT1
endif
0224 : 850d sta N1H
0226 : 204102 jsr ADD
0229 : 20c802 jsr A6502
022c : 20bf02 jsr COMPARE
022f : d00f bne DONE
; jsr SUB
; jsr S6502
; jsr COMPARE
; bne DONE
0231 : e600 NEXT1 inc N1 ; [5] see text
0233 : d0e5 bne LOOP2 ; loop through all 256 values of N1
0235 : e601 NEXT2 inc N2 ; [6] see text
0237 : d0d1 bne LOOP1 ; loop through all 256 values of N2
0239 : 88 dey
023a : 10ce bpl LOOP1 ; loop through both values of the carry flag
023c : a900 lda #0 ; test passed, so store 0 in ERROR
023e : 850b sta ERROR
0240 : DONE
end_of_test
0240 : db > db $db ;execute 65C02 stop instruction
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
0241 : f8 ADD sed ; decimal mode
0242 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0244 : a500 lda N1
0246 : 6501 adc N2
0248 : 8504 sta DA ; actual accumulator result in decimal mode
024a : 08 php
024b : 68 pla
024c : 8505 sta DNVZC ; actual flags result in decimal mode
024e : d8 cld ; binary mode
024f : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0251 : a500 lda N1
0253 : 6501 adc N2
0255 : 8502 sta HA ; accumulator result of N1+N2 using binary arithmetic
0257 : 08 php
0258 : 68 pla
0259 : 8503 sta HNVZC ; flags result of N1+N2 using binary arithmetic
025b : c001 cpy #1
025d : a50c lda N1L
025f : 650e adc N2L
0261 : c90a cmp #$0A
0263 : a200 ldx #0
0265 : 9006 bcc A1
0267 : e8 inx
0268 : 6905 adc #5 ; add 6 (carry is set)
026a : 290f and #$0F
026c : 38 sec
026d : 050d A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
026f : 750f adc N2H,x
0271 : 08 php
0272 : b004 bcs A2
0274 : c9a0 cmp #$A0
0276 : 9003 bcc A3
0278 : 695f A2 adc #$5F ; add $60 (carry is set)
027a : 38 sec
027b : 8506 A3 sta AR ; predicted accumulator result
027d : 08 php
027e : 68 pla
027f : 850a sta CF ; predicted carry result
0281 : 68 pla
;
; note that all 8 bits of the P register are stored in VF
;
0282 : 8508 sta VF ; predicted V flags
0284 : 60 rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
0285 : f8 SUB sed ; decimal mode
0286 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0288 : a500 lda N1
028a : e501 sbc N2
028c : 8504 sta DA ; actual accumulator result in decimal mode
028e : 08 php
028f : 68 pla
0290 : 8505 sta DNVZC ; actual flags result in decimal mode
0292 : d8 cld ; binary mode
0293 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0295 : a500 lda N1
0297 : e501 sbc N2
0299 : 8502 sta HA ; accumulator result of N1-N2 using binary arithmetic
029b : 08 php
029c : 68 pla
029d : 8503 sta HNVZC ; flags result of N1-N2 using binary arithmetic
029f : 60 rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
02a0 : c001 SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02a2 : a50c lda N1L
02a4 : e50e sbc N2L
02a6 : a200 ldx #0
02a8 : b004 bcs S21
02aa : e8 inx
02ab : 290f and #$0F
02ad : 18 clc
02ae : 050d S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
02b0 : f50f sbc N2H,x
02b2 : b002 bcs S22
02b4 : e95f sbc #$5F ; subtract $60 (carry is clear)
02b6 : e000 S22 cpx #0
02b8 : f002 beq S23
02ba : e906 sbc #6
02bc : 8506 S23 sta AR ; predicted accumulator result
02be : 60 rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
02bf : COMPARE
if chk_a = 1
lda DA
cmp AR
bne C1
endif
if chk_n = 1
lda DNVZC ; [7] see text
eor NF
and #$80 ; mask off N flag
bne C1
endif
if chk_v = 1
02bf : a505 lda DNVZC ; [8] see text
02c1 : 4508 eor VF
02c3 : 2940 and #$40 ; mask off V flag
02c5 : d000 bne C1 ; [9] see text
endif
if chk_z = 1
lda DNVZC
eor ZF ; mask off Z flag
and #2
bne C1 ; [10] see text
endif
if chk_c = 1
lda DNVZC
eor CF
and #1 ; mask off C flag
endif
02c7 : 60 C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
02c8 : a506 A6502 lda AR ; 65C02
02ca : 08 php
02cb : 68 pla
02cc : 8507 sta NF
02ce : 8509 sta ZF
02d0 : 60 rts
02d1 : 20a002 S6502 jsr SUB2
02d4 : a506 lda AR
02d6 : 08 php
02d7 : 68 pla
02d8 : 8507 sta NF
02da : 8509 sta ZF
02dc : a503 lda HNVZC
02de : 8508 sta VF
02e0 : 850a sta CF
02e2 : 60 rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
02d1 = end TEST
No errors in pass 2.

BIN
tests/65c02-addonly-z.bin Normal file

Binary file not shown.

363
tests/65c02-addonly-z.lst Normal file
View File

@ -0,0 +1,363 @@
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
----------------------------------------------------- 6502_decimal_test.a65 ------------------------------------------------------
355 lines read, no errors in pass 1.
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
0001 = cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
0000 = vld_bcd = 0 ; 0 = allow invalid bcd, 1 = valid bcd only
0000 = chk_a = 0 ; check accumulator
0000 = chk_n = 0 ; check sign (negative) flag
0000 = chk_v = 0 ; check overflow flag
0001 = chk_z = 1 ; check zero flag
0000 = chk_c = 0 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
0000 = org 0
; operands - register Y = carry in
0000 = N1 ds 1
0001 = N2 ds 1
; binary result
0002 = HA ds 1
0003 = HNVZC ds 1
;04
; decimal result
0004 = DA ds 1
0005 = DNVZC ds 1
; predicted results
0006 = AR ds 1
0007 = NF ds 1
;08
0008 = VF ds 1
0009 = ZF ds 1
000a = CF ds 1
000b = ERROR ds 1
;0C
; workspace
000c = N1L ds 1
000d = N1H ds 1
000e = N2L ds 1
000f = N2H ds 2
code
0200 = org $200
0200 : a001 TEST ldy #1 ; initialize Y (used to loop through carry flag values)
0202 : 840b sty ERROR ; store 1 in ERROR until the test passes
0204 : a900 lda #0 ; initialize N1 and N2
0206 : 8500 sta N1
0208 : 8501 sta N2
020a : a501 LOOP1 lda N2 ; N2L = N2 & $0F
020c : 290f and #$0F ; [1] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT2
endif
020e : 850e sta N2L
0210 : a501 lda N2 ; N2H = N2 & $F0
0212 : 29f0 and #$F0 ; [2] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT2
endif
0214 : 850f sta N2H
0216 : 090f ora #$0F ; N2H+1 = (N2 & $F0) + $0F
0218 : 8510 sta N2H+1
021a : a500 LOOP2 lda N1 ; N1L = N1 & $0F
021c : 290f and #$0F ; [3] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT1
endif
021e : 850c sta N1L
0220 : a500 lda N1 ; N1H = N1 & $F0
0222 : 29f0 and #$F0 ; [4] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT1
endif
0224 : 850d sta N1H
0226 : 204102 jsr ADD
0229 : 20c802 jsr A6502
022c : 20bf02 jsr COMPARE
022f : d00f bne DONE
; jsr SUB
; jsr S6502
; jsr COMPARE
; bne DONE
0231 : e600 NEXT1 inc N1 ; [5] see text
0233 : d0e5 bne LOOP2 ; loop through all 256 values of N1
0235 : e601 NEXT2 inc N2 ; [6] see text
0237 : d0d1 bne LOOP1 ; loop through all 256 values of N2
0239 : 88 dey
023a : 10ce bpl LOOP1 ; loop through both values of the carry flag
023c : a900 lda #0 ; test passed, so store 0 in ERROR
023e : 850b sta ERROR
0240 : DONE
end_of_test
0240 : db > db $db ;execute 65C02 stop instruction
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
0241 : f8 ADD sed ; decimal mode
0242 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0244 : a500 lda N1
0246 : 6501 adc N2
0248 : 8504 sta DA ; actual accumulator result in decimal mode
024a : 08 php
024b : 68 pla
024c : 8505 sta DNVZC ; actual flags result in decimal mode
024e : d8 cld ; binary mode
024f : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0251 : a500 lda N1
0253 : 6501 adc N2
0255 : 8502 sta HA ; accumulator result of N1+N2 using binary arithmetic
0257 : 08 php
0258 : 68 pla
0259 : 8503 sta HNVZC ; flags result of N1+N2 using binary arithmetic
025b : c001 cpy #1
025d : a50c lda N1L
025f : 650e adc N2L
0261 : c90a cmp #$0A
0263 : a200 ldx #0
0265 : 9006 bcc A1
0267 : e8 inx
0268 : 6905 adc #5 ; add 6 (carry is set)
026a : 290f and #$0F
026c : 38 sec
026d : 050d A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
026f : 750f adc N2H,x
0271 : 08 php
0272 : b004 bcs A2
0274 : c9a0 cmp #$A0
0276 : 9003 bcc A3
0278 : 695f A2 adc #$5F ; add $60 (carry is set)
027a : 38 sec
027b : 8506 A3 sta AR ; predicted accumulator result
027d : 08 php
027e : 68 pla
027f : 850a sta CF ; predicted carry result
0281 : 68 pla
;
; note that all 8 bits of the P register are stored in VF
;
0282 : 8508 sta VF ; predicted V flags
0284 : 60 rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
0285 : f8 SUB sed ; decimal mode
0286 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0288 : a500 lda N1
028a : e501 sbc N2
028c : 8504 sta DA ; actual accumulator result in decimal mode
028e : 08 php
028f : 68 pla
0290 : 8505 sta DNVZC ; actual flags result in decimal mode
0292 : d8 cld ; binary mode
0293 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0295 : a500 lda N1
0297 : e501 sbc N2
0299 : 8502 sta HA ; accumulator result of N1-N2 using binary arithmetic
029b : 08 php
029c : 68 pla
029d : 8503 sta HNVZC ; flags result of N1-N2 using binary arithmetic
029f : 60 rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
02a0 : c001 SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02a2 : a50c lda N1L
02a4 : e50e sbc N2L
02a6 : a200 ldx #0
02a8 : b004 bcs S21
02aa : e8 inx
02ab : 290f and #$0F
02ad : 18 clc
02ae : 050d S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
02b0 : f50f sbc N2H,x
02b2 : b002 bcs S22
02b4 : e95f sbc #$5F ; subtract $60 (carry is clear)
02b6 : e000 S22 cpx #0
02b8 : f002 beq S23
02ba : e906 sbc #6
02bc : 8506 S23 sta AR ; predicted accumulator result
02be : 60 rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
02bf : COMPARE
if chk_a = 1
lda DA
cmp AR
bne C1
endif
if chk_n = 1
lda DNVZC ; [7] see text
eor NF
and #$80 ; mask off N flag
bne C1
endif
if chk_v = 1
lda DNVZC ; [8] see text
eor VF
and #$40 ; mask off V flag
bne C1 ; [9] see text
endif
if chk_z = 1
02bf : a505 lda DNVZC
02c1 : 4509 eor ZF ; mask off Z flag
02c3 : 2902 and #2
02c5 : d000 bne C1 ; [10] see text
endif
if chk_c = 1
lda DNVZC
eor CF
and #1 ; mask off C flag
endif
02c7 : 60 C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
02c8 : a506 A6502 lda AR ; 65C02
02ca : 08 php
02cb : 68 pla
02cc : 8507 sta NF
02ce : 8509 sta ZF
02d0 : 60 rts
02d1 : 20a002 S6502 jsr SUB2
02d4 : a506 lda AR
02d6 : 08 php
02d7 : 68 pla
02d8 : 8507 sta NF
02da : 8509 sta ZF
02dc : a503 lda HNVZC
02de : 8508 sta VF
02e0 : 850a sta CF
02e2 : 60 rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
02d1 = end TEST
No errors in pass 2.

BIN
tests/65c02-all.bin Normal file

Binary file not shown.

363
tests/65c02-all.lst Normal file
View File

@ -0,0 +1,363 @@
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
----------------------------------------------------- 6502_decimal_test.a65 ------------------------------------------------------
355 lines read, no errors in pass 1.
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
0001 = cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
0000 = vld_bcd = 0 ; 0 = allow invalid bcd, 1 = valid bcd only
0001 = chk_a = 1 ; check accumulator
0001 = chk_n = 1 ; check sign (negative) flag
0001 = chk_v = 1 ; check overflow flag
0001 = chk_z = 1 ; check zero flag
0001 = chk_c = 1 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
0000 = org 0
; operands - register Y = carry in
0000 = N1 ds 1
0001 = N2 ds 1
; binary result
0002 = HA ds 1
0003 = HNVZC ds 1
;04
; decimal result
0004 = DA ds 1
0005 = DNVZC ds 1
; predicted results
0006 = AR ds 1
0007 = NF ds 1
;08
0008 = VF ds 1
0009 = ZF ds 1
000a = CF ds 1
000b = ERROR ds 1
;0C
; workspace
000c = N1L ds 1
000d = N1H ds 1
000e = N2L ds 1
000f = N2H ds 2
code
0200 = org $200
0200 : a001 TEST ldy #1 ; initialize Y (used to loop through carry flag values)
0202 : 840b sty ERROR ; store 1 in ERROR until the test passes
0204 : a900 lda #0 ; initialize N1 and N2
0206 : 8500 sta N1
0208 : 8501 sta N2
020a : a501 LOOP1 lda N2 ; N2L = N2 & $0F
020c : 290f and #$0F ; [1] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT2
endif
020e : 850e sta N2L
0210 : a501 lda N2 ; N2H = N2 & $F0
0212 : 29f0 and #$F0 ; [2] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT2
endif
0214 : 850f sta N2H
0216 : 090f ora #$0F ; N2H+1 = (N2 & $F0) + $0F
0218 : 8510 sta N2H+1
021a : a500 LOOP2 lda N1 ; N1L = N1 & $0F
021c : 290f and #$0F ; [3] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT1
endif
021e : 850c sta N1L
0220 : a500 lda N1 ; N1H = N1 & $F0
0222 : 29f0 and #$F0 ; [4] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT1
endif
0224 : 850d sta N1H
0226 : 204c02 jsr ADD
0229 : 20ef02 jsr A6502
022c : 20ca02 jsr COMPARE
022f : d01a bne DONE
0231 : 209002 jsr SUB
0234 : 20f802 jsr S6502
0237 : 20ca02 jsr COMPARE
023a : d00f bne DONE
023c : e600 NEXT1 inc N1 ; [5] see text
023e : d0da bne LOOP2 ; loop through all 256 values of N1
0240 : e601 NEXT2 inc N2 ; [6] see text
0242 : d0c6 bne LOOP1 ; loop through all 256 values of N2
0244 : 88 dey
0245 : 10c3 bpl LOOP1 ; loop through both values of the carry flag
0247 : a900 lda #0 ; test passed, so store 0 in ERROR
0249 : 850b sta ERROR
024b : DONE
end_of_test
024b : db > db $db ;execute 65C02 stop instruction
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
024c : f8 ADD sed ; decimal mode
024d : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
024f : a500 lda N1
0251 : 6501 adc N2
0253 : 8504 sta DA ; actual accumulator result in decimal mode
0255 : 08 php
0256 : 68 pla
0257 : 8505 sta DNVZC ; actual flags result in decimal mode
0259 : d8 cld ; binary mode
025a : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
025c : a500 lda N1
025e : 6501 adc N2
0260 : 8502 sta HA ; accumulator result of N1+N2 using binary arithmetic
0262 : 08 php
0263 : 68 pla
0264 : 8503 sta HNVZC ; flags result of N1+N2 using binary arithmetic
0266 : c001 cpy #1
0268 : a50c lda N1L
026a : 650e adc N2L
026c : c90a cmp #$0A
026e : a200 ldx #0
0270 : 9006 bcc A1
0272 : e8 inx
0273 : 6905 adc #5 ; add 6 (carry is set)
0275 : 290f and #$0F
0277 : 38 sec
0278 : 050d A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
027a : 750f adc N2H,x
027c : 08 php
027d : b004 bcs A2
027f : c9a0 cmp #$A0
0281 : 9003 bcc A3
0283 : 695f A2 adc #$5F ; add $60 (carry is set)
0285 : 38 sec
0286 : 8506 A3 sta AR ; predicted accumulator result
0288 : 08 php
0289 : 68 pla
028a : 850a sta CF ; predicted carry result
028c : 68 pla
;
; note that all 8 bits of the P register are stored in VF
;
028d : 8508 sta VF ; predicted V flags
028f : 60 rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
0290 : f8 SUB sed ; decimal mode
0291 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0293 : a500 lda N1
0295 : e501 sbc N2
0297 : 8504 sta DA ; actual accumulator result in decimal mode
0299 : 08 php
029a : 68 pla
029b : 8505 sta DNVZC ; actual flags result in decimal mode
029d : d8 cld ; binary mode
029e : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02a0 : a500 lda N1
02a2 : e501 sbc N2
02a4 : 8502 sta HA ; accumulator result of N1-N2 using binary arithmetic
02a6 : 08 php
02a7 : 68 pla
02a8 : 8503 sta HNVZC ; flags result of N1-N2 using binary arithmetic
02aa : 60 rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
02ab : c001 SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02ad : a50c lda N1L
02af : e50e sbc N2L
02b1 : a200 ldx #0
02b3 : b004 bcs S21
02b5 : e8 inx
02b6 : 290f and #$0F
02b8 : 18 clc
02b9 : 050d S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
02bb : f50f sbc N2H,x
02bd : b002 bcs S22
02bf : e95f sbc #$5F ; subtract $60 (carry is clear)
02c1 : e000 S22 cpx #0
02c3 : f002 beq S23
02c5 : e906 sbc #6
02c7 : 8506 S23 sta AR ; predicted accumulator result
02c9 : 60 rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
02ca : COMPARE
if chk_a = 1
02ca : a504 lda DA
02cc : c506 cmp AR
02ce : d01e bne C1
endif
if chk_n = 1
02d0 : a505 lda DNVZC ; [7] see text
02d2 : 4507 eor NF
02d4 : 2980 and #$80 ; mask off N flag
02d6 : d016 bne C1
endif
if chk_v = 1
02d8 : a505 lda DNVZC ; [8] see text
02da : 4508 eor VF
02dc : 2940 and #$40 ; mask off V flag
02de : d00e bne C1 ; [9] see text
endif
if chk_z = 1
02e0 : a505 lda DNVZC
02e2 : 4509 eor ZF ; mask off Z flag
02e4 : 2902 and #2
02e6 : d006 bne C1 ; [10] see text
endif
if chk_c = 1
02e8 : a505 lda DNVZC
02ea : 450a eor CF
02ec : 2901 and #1 ; mask off C flag
endif
02ee : 60 C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
02ef : a506 A6502 lda AR ; 65C02
02f1 : 08 php
02f2 : 68 pla
02f3 : 8507 sta NF
02f5 : 8509 sta ZF
02f7 : 60 rts
02f8 : 20ab02 S6502 jsr SUB2
02fb : a506 lda AR
02fd : 08 php
02fe : 68 pla
02ff : 8507 sta NF
0301 : 8509 sta ZF
0303 : a503 lda HNVZC
0305 : 8508 sta VF
0307 : 850a sta CF
0309 : 60 rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
02f8 = end TEST
No errors in pass 2.

BIN
tests/65c02-c.bin Normal file

Binary file not shown.

363
tests/65c02-c.lst Normal file
View File

@ -0,0 +1,363 @@
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
----------------------------------------------------- 6502_decimal_test.a65 ------------------------------------------------------
355 lines read, no errors in pass 1.
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
0001 = cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
0000 = vld_bcd = 0 ; 0 = allow invalid bcd, 1 = valid bcd only
0000 = chk_a = 0 ; check accumulator
0000 = chk_n = 0 ; check sign (negative) flag
0000 = chk_v = 0 ; check overflow flag
0000 = chk_z = 0 ; check zero flag
0001 = chk_c = 1 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
0000 = org 0
; operands - register Y = carry in
0000 = N1 ds 1
0001 = N2 ds 1
; binary result
0002 = HA ds 1
0003 = HNVZC ds 1
;04
; decimal result
0004 = DA ds 1
0005 = DNVZC ds 1
; predicted results
0006 = AR ds 1
0007 = NF ds 1
;08
0008 = VF ds 1
0009 = ZF ds 1
000a = CF ds 1
000b = ERROR ds 1
;0C
; workspace
000c = N1L ds 1
000d = N1H ds 1
000e = N2L ds 1
000f = N2H ds 2
code
0200 = org $200
0200 : a001 TEST ldy #1 ; initialize Y (used to loop through carry flag values)
0202 : 840b sty ERROR ; store 1 in ERROR until the test passes
0204 : a900 lda #0 ; initialize N1 and N2
0206 : 8500 sta N1
0208 : 8501 sta N2
020a : a501 LOOP1 lda N2 ; N2L = N2 & $0F
020c : 290f and #$0F ; [1] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT2
endif
020e : 850e sta N2L
0210 : a501 lda N2 ; N2H = N2 & $F0
0212 : 29f0 and #$F0 ; [2] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT2
endif
0214 : 850f sta N2H
0216 : 090f ora #$0F ; N2H+1 = (N2 & $F0) + $0F
0218 : 8510 sta N2H+1
021a : a500 LOOP2 lda N1 ; N1L = N1 & $0F
021c : 290f and #$0F ; [3] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT1
endif
021e : 850c sta N1L
0220 : a500 lda N1 ; N1H = N1 & $F0
0222 : 29f0 and #$F0 ; [4] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT1
endif
0224 : 850d sta N1H
0226 : 204c02 jsr ADD
0229 : 20d102 jsr A6502
022c : 20ca02 jsr COMPARE
022f : d01a bne DONE
0231 : 209002 jsr SUB
0234 : 20da02 jsr S6502
0237 : 20ca02 jsr COMPARE
023a : d00f bne DONE
023c : e600 NEXT1 inc N1 ; [5] see text
023e : d0da bne LOOP2 ; loop through all 256 values of N1
0240 : e601 NEXT2 inc N2 ; [6] see text
0242 : d0c6 bne LOOP1 ; loop through all 256 values of N2
0244 : 88 dey
0245 : 10c3 bpl LOOP1 ; loop through both values of the carry flag
0247 : a900 lda #0 ; test passed, so store 0 in ERROR
0249 : 850b sta ERROR
024b : DONE
end_of_test
024b : db > db $db ;execute 65C02 stop instruction
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
024c : f8 ADD sed ; decimal mode
024d : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
024f : a500 lda N1
0251 : 6501 adc N2
0253 : 8504 sta DA ; actual accumulator result in decimal mode
0255 : 08 php
0256 : 68 pla
0257 : 8505 sta DNVZC ; actual flags result in decimal mode
0259 : d8 cld ; binary mode
025a : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
025c : a500 lda N1
025e : 6501 adc N2
0260 : 8502 sta HA ; accumulator result of N1+N2 using binary arithmetic
0262 : 08 php
0263 : 68 pla
0264 : 8503 sta HNVZC ; flags result of N1+N2 using binary arithmetic
0266 : c001 cpy #1
0268 : a50c lda N1L
026a : 650e adc N2L
026c : c90a cmp #$0A
026e : a200 ldx #0
0270 : 9006 bcc A1
0272 : e8 inx
0273 : 6905 adc #5 ; add 6 (carry is set)
0275 : 290f and #$0F
0277 : 38 sec
0278 : 050d A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
027a : 750f adc N2H,x
027c : 08 php
027d : b004 bcs A2
027f : c9a0 cmp #$A0
0281 : 9003 bcc A3
0283 : 695f A2 adc #$5F ; add $60 (carry is set)
0285 : 38 sec
0286 : 8506 A3 sta AR ; predicted accumulator result
0288 : 08 php
0289 : 68 pla
028a : 850a sta CF ; predicted carry result
028c : 68 pla
;
; note that all 8 bits of the P register are stored in VF
;
028d : 8508 sta VF ; predicted V flags
028f : 60 rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
0290 : f8 SUB sed ; decimal mode
0291 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0293 : a500 lda N1
0295 : e501 sbc N2
0297 : 8504 sta DA ; actual accumulator result in decimal mode
0299 : 08 php
029a : 68 pla
029b : 8505 sta DNVZC ; actual flags result in decimal mode
029d : d8 cld ; binary mode
029e : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02a0 : a500 lda N1
02a2 : e501 sbc N2
02a4 : 8502 sta HA ; accumulator result of N1-N2 using binary arithmetic
02a6 : 08 php
02a7 : 68 pla
02a8 : 8503 sta HNVZC ; flags result of N1-N2 using binary arithmetic
02aa : 60 rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
02ab : c001 SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02ad : a50c lda N1L
02af : e50e sbc N2L
02b1 : a200 ldx #0
02b3 : b004 bcs S21
02b5 : e8 inx
02b6 : 290f and #$0F
02b8 : 18 clc
02b9 : 050d S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
02bb : f50f sbc N2H,x
02bd : b002 bcs S22
02bf : e95f sbc #$5F ; subtract $60 (carry is clear)
02c1 : e000 S22 cpx #0
02c3 : f002 beq S23
02c5 : e906 sbc #6
02c7 : 8506 S23 sta AR ; predicted accumulator result
02c9 : 60 rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
02ca : COMPARE
if chk_a = 1
lda DA
cmp AR
bne C1
endif
if chk_n = 1
lda DNVZC ; [7] see text
eor NF
and #$80 ; mask off N flag
bne C1
endif
if chk_v = 1
lda DNVZC ; [8] see text
eor VF
and #$40 ; mask off V flag
bne C1 ; [9] see text
endif
if chk_z = 1
lda DNVZC
eor ZF ; mask off Z flag
and #2
bne C1 ; [10] see text
endif
if chk_c = 1
02ca : a505 lda DNVZC
02cc : 450a eor CF
02ce : 2901 and #1 ; mask off C flag
endif
02d0 : 60 C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
02d1 : a506 A6502 lda AR ; 65C02
02d3 : 08 php
02d4 : 68 pla
02d5 : 8507 sta NF
02d7 : 8509 sta ZF
02d9 : 60 rts
02da : 20ab02 S6502 jsr SUB2
02dd : a506 lda AR
02df : 08 php
02e0 : 68 pla
02e1 : 8507 sta NF
02e3 : 8509 sta ZF
02e5 : a503 lda HNVZC
02e7 : 8508 sta VF
02e9 : 850a sta CF
02eb : 60 rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
02da = end TEST
No errors in pass 2.

BIN
tests/65c02-n.bin Normal file

Binary file not shown.

363
tests/65c02-n.lst Normal file
View File

@ -0,0 +1,363 @@
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
----------------------------------------------------- 6502_decimal_test.a65 ------------------------------------------------------
355 lines read, no errors in pass 1.
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
0001 = cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
0000 = vld_bcd = 0 ; 0 = allow invalid bcd, 1 = valid bcd only
0000 = chk_a = 0 ; check accumulator
0001 = chk_n = 1 ; check sign (negative) flag
0000 = chk_v = 0 ; check overflow flag
0000 = chk_z = 0 ; check zero flag
0000 = chk_c = 0 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
0000 = org 0
; operands - register Y = carry in
0000 = N1 ds 1
0001 = N2 ds 1
; binary result
0002 = HA ds 1
0003 = HNVZC ds 1
;04
; decimal result
0004 = DA ds 1
0005 = DNVZC ds 1
; predicted results
0006 = AR ds 1
0007 = NF ds 1
;08
0008 = VF ds 1
0009 = ZF ds 1
000a = CF ds 1
000b = ERROR ds 1
;0C
; workspace
000c = N1L ds 1
000d = N1H ds 1
000e = N2L ds 1
000f = N2H ds 2
code
0200 = org $200
0200 : a001 TEST ldy #1 ; initialize Y (used to loop through carry flag values)
0202 : 840b sty ERROR ; store 1 in ERROR until the test passes
0204 : a900 lda #0 ; initialize N1 and N2
0206 : 8500 sta N1
0208 : 8501 sta N2
020a : a501 LOOP1 lda N2 ; N2L = N2 & $0F
020c : 290f and #$0F ; [1] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT2
endif
020e : 850e sta N2L
0210 : a501 lda N2 ; N2H = N2 & $F0
0212 : 29f0 and #$F0 ; [2] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT2
endif
0214 : 850f sta N2H
0216 : 090f ora #$0F ; N2H+1 = (N2 & $F0) + $0F
0218 : 8510 sta N2H+1
021a : a500 LOOP2 lda N1 ; N1L = N1 & $0F
021c : 290f and #$0F ; [3] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT1
endif
021e : 850c sta N1L
0220 : a500 lda N1 ; N1H = N1 & $F0
0222 : 29f0 and #$F0 ; [4] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT1
endif
0224 : 850d sta N1H
0226 : 204c02 jsr ADD
0229 : 20d302 jsr A6502
022c : 20ca02 jsr COMPARE
022f : d01a bne DONE
0231 : 209002 jsr SUB
0234 : 20dc02 jsr S6502
0237 : 20ca02 jsr COMPARE
023a : d00f bne DONE
023c : e600 NEXT1 inc N1 ; [5] see text
023e : d0da bne LOOP2 ; loop through all 256 values of N1
0240 : e601 NEXT2 inc N2 ; [6] see text
0242 : d0c6 bne LOOP1 ; loop through all 256 values of N2
0244 : 88 dey
0245 : 10c3 bpl LOOP1 ; loop through both values of the carry flag
0247 : a900 lda #0 ; test passed, so store 0 in ERROR
0249 : 850b sta ERROR
024b : DONE
end_of_test
024b : db > db $db ;execute 65C02 stop instruction
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
024c : f8 ADD sed ; decimal mode
024d : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
024f : a500 lda N1
0251 : 6501 adc N2
0253 : 8504 sta DA ; actual accumulator result in decimal mode
0255 : 08 php
0256 : 68 pla
0257 : 8505 sta DNVZC ; actual flags result in decimal mode
0259 : d8 cld ; binary mode
025a : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
025c : a500 lda N1
025e : 6501 adc N2
0260 : 8502 sta HA ; accumulator result of N1+N2 using binary arithmetic
0262 : 08 php
0263 : 68 pla
0264 : 8503 sta HNVZC ; flags result of N1+N2 using binary arithmetic
0266 : c001 cpy #1
0268 : a50c lda N1L
026a : 650e adc N2L
026c : c90a cmp #$0A
026e : a200 ldx #0
0270 : 9006 bcc A1
0272 : e8 inx
0273 : 6905 adc #5 ; add 6 (carry is set)
0275 : 290f and #$0F
0277 : 38 sec
0278 : 050d A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
027a : 750f adc N2H,x
027c : 08 php
027d : b004 bcs A2
027f : c9a0 cmp #$A0
0281 : 9003 bcc A3
0283 : 695f A2 adc #$5F ; add $60 (carry is set)
0285 : 38 sec
0286 : 8506 A3 sta AR ; predicted accumulator result
0288 : 08 php
0289 : 68 pla
028a : 850a sta CF ; predicted carry result
028c : 68 pla
;
; note that all 8 bits of the P register are stored in VF
;
028d : 8508 sta VF ; predicted V flags
028f : 60 rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
0290 : f8 SUB sed ; decimal mode
0291 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0293 : a500 lda N1
0295 : e501 sbc N2
0297 : 8504 sta DA ; actual accumulator result in decimal mode
0299 : 08 php
029a : 68 pla
029b : 8505 sta DNVZC ; actual flags result in decimal mode
029d : d8 cld ; binary mode
029e : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02a0 : a500 lda N1
02a2 : e501 sbc N2
02a4 : 8502 sta HA ; accumulator result of N1-N2 using binary arithmetic
02a6 : 08 php
02a7 : 68 pla
02a8 : 8503 sta HNVZC ; flags result of N1-N2 using binary arithmetic
02aa : 60 rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
02ab : c001 SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02ad : a50c lda N1L
02af : e50e sbc N2L
02b1 : a200 ldx #0
02b3 : b004 bcs S21
02b5 : e8 inx
02b6 : 290f and #$0F
02b8 : 18 clc
02b9 : 050d S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
02bb : f50f sbc N2H,x
02bd : b002 bcs S22
02bf : e95f sbc #$5F ; subtract $60 (carry is clear)
02c1 : e000 S22 cpx #0
02c3 : f002 beq S23
02c5 : e906 sbc #6
02c7 : 8506 S23 sta AR ; predicted accumulator result
02c9 : 60 rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
02ca : COMPARE
if chk_a = 1
lda DA
cmp AR
bne C1
endif
if chk_n = 1
02ca : a505 lda DNVZC ; [7] see text
02cc : 4507 eor NF
02ce : 2980 and #$80 ; mask off N flag
02d0 : d000 bne C1
endif
if chk_v = 1
lda DNVZC ; [8] see text
eor VF
and #$40 ; mask off V flag
bne C1 ; [9] see text
endif
if chk_z = 1
lda DNVZC
eor ZF ; mask off Z flag
and #2
bne C1 ; [10] see text
endif
if chk_c = 1
lda DNVZC
eor CF
and #1 ; mask off C flag
endif
02d2 : 60 C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
02d3 : a506 A6502 lda AR ; 65C02
02d5 : 08 php
02d6 : 68 pla
02d7 : 8507 sta NF
02d9 : 8509 sta ZF
02db : 60 rts
02dc : 20ab02 S6502 jsr SUB2
02df : a506 lda AR
02e1 : 08 php
02e2 : 68 pla
02e3 : 8507 sta NF
02e5 : 8509 sta ZF
02e7 : a503 lda HNVZC
02e9 : 8508 sta VF
02eb : 850a sta CF
02ed : 60 rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
02dc = end TEST
No errors in pass 2.

BIN
tests/65c02-v.bin Normal file

Binary file not shown.

363
tests/65c02-v.lst Normal file
View File

@ -0,0 +1,363 @@
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
----------------------------------------------------- 6502_decimal_test.a65 ------------------------------------------------------
355 lines read, no errors in pass 1.
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
0001 = cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
0000 = vld_bcd = 0 ; 0 = allow invalid bcd, 1 = valid bcd only
0000 = chk_a = 0 ; check accumulator
0000 = chk_n = 0 ; check sign (negative) flag
0001 = chk_v = 1 ; check overflow flag
0000 = chk_z = 0 ; check zero flag
0000 = chk_c = 0 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
0000 = org 0
; operands - register Y = carry in
0000 = N1 ds 1
0001 = N2 ds 1
; binary result
0002 = HA ds 1
0003 = HNVZC ds 1
;04
; decimal result
0004 = DA ds 1
0005 = DNVZC ds 1
; predicted results
0006 = AR ds 1
0007 = NF ds 1
;08
0008 = VF ds 1
0009 = ZF ds 1
000a = CF ds 1
000b = ERROR ds 1
;0C
; workspace
000c = N1L ds 1
000d = N1H ds 1
000e = N2L ds 1
000f = N2H ds 2
code
0200 = org $200
0200 : a001 TEST ldy #1 ; initialize Y (used to loop through carry flag values)
0202 : 840b sty ERROR ; store 1 in ERROR until the test passes
0204 : a900 lda #0 ; initialize N1 and N2
0206 : 8500 sta N1
0208 : 8501 sta N2
020a : a501 LOOP1 lda N2 ; N2L = N2 & $0F
020c : 290f and #$0F ; [1] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT2
endif
020e : 850e sta N2L
0210 : a501 lda N2 ; N2H = N2 & $F0
0212 : 29f0 and #$F0 ; [2] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT2
endif
0214 : 850f sta N2H
0216 : 090f ora #$0F ; N2H+1 = (N2 & $F0) + $0F
0218 : 8510 sta N2H+1
021a : a500 LOOP2 lda N1 ; N1L = N1 & $0F
021c : 290f and #$0F ; [3] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT1
endif
021e : 850c sta N1L
0220 : a500 lda N1 ; N1H = N1 & $F0
0222 : 29f0 and #$F0 ; [4] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT1
endif
0224 : 850d sta N1H
0226 : 204c02 jsr ADD
0229 : 20d302 jsr A6502
022c : 20ca02 jsr COMPARE
022f : d01a bne DONE
0231 : 209002 jsr SUB
0234 : 20dc02 jsr S6502
0237 : 20ca02 jsr COMPARE
023a : d00f bne DONE
023c : e600 NEXT1 inc N1 ; [5] see text
023e : d0da bne LOOP2 ; loop through all 256 values of N1
0240 : e601 NEXT2 inc N2 ; [6] see text
0242 : d0c6 bne LOOP1 ; loop through all 256 values of N2
0244 : 88 dey
0245 : 10c3 bpl LOOP1 ; loop through both values of the carry flag
0247 : a900 lda #0 ; test passed, so store 0 in ERROR
0249 : 850b sta ERROR
024b : DONE
end_of_test
024b : db > db $db ;execute 65C02 stop instruction
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
024c : f8 ADD sed ; decimal mode
024d : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
024f : a500 lda N1
0251 : 6501 adc N2
0253 : 8504 sta DA ; actual accumulator result in decimal mode
0255 : 08 php
0256 : 68 pla
0257 : 8505 sta DNVZC ; actual flags result in decimal mode
0259 : d8 cld ; binary mode
025a : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
025c : a500 lda N1
025e : 6501 adc N2
0260 : 8502 sta HA ; accumulator result of N1+N2 using binary arithmetic
0262 : 08 php
0263 : 68 pla
0264 : 8503 sta HNVZC ; flags result of N1+N2 using binary arithmetic
0266 : c001 cpy #1
0268 : a50c lda N1L
026a : 650e adc N2L
026c : c90a cmp #$0A
026e : a200 ldx #0
0270 : 9006 bcc A1
0272 : e8 inx
0273 : 6905 adc #5 ; add 6 (carry is set)
0275 : 290f and #$0F
0277 : 38 sec
0278 : 050d A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
027a : 750f adc N2H,x
027c : 08 php
027d : b004 bcs A2
027f : c9a0 cmp #$A0
0281 : 9003 bcc A3
0283 : 695f A2 adc #$5F ; add $60 (carry is set)
0285 : 38 sec
0286 : 8506 A3 sta AR ; predicted accumulator result
0288 : 08 php
0289 : 68 pla
028a : 850a sta CF ; predicted carry result
028c : 68 pla
;
; note that all 8 bits of the P register are stored in VF
;
028d : 8508 sta VF ; predicted V flags
028f : 60 rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
0290 : f8 SUB sed ; decimal mode
0291 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0293 : a500 lda N1
0295 : e501 sbc N2
0297 : 8504 sta DA ; actual accumulator result in decimal mode
0299 : 08 php
029a : 68 pla
029b : 8505 sta DNVZC ; actual flags result in decimal mode
029d : d8 cld ; binary mode
029e : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02a0 : a500 lda N1
02a2 : e501 sbc N2
02a4 : 8502 sta HA ; accumulator result of N1-N2 using binary arithmetic
02a6 : 08 php
02a7 : 68 pla
02a8 : 8503 sta HNVZC ; flags result of N1-N2 using binary arithmetic
02aa : 60 rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
02ab : c001 SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02ad : a50c lda N1L
02af : e50e sbc N2L
02b1 : a200 ldx #0
02b3 : b004 bcs S21
02b5 : e8 inx
02b6 : 290f and #$0F
02b8 : 18 clc
02b9 : 050d S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
02bb : f50f sbc N2H,x
02bd : b002 bcs S22
02bf : e95f sbc #$5F ; subtract $60 (carry is clear)
02c1 : e000 S22 cpx #0
02c3 : f002 beq S23
02c5 : e906 sbc #6
02c7 : 8506 S23 sta AR ; predicted accumulator result
02c9 : 60 rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
02ca : COMPARE
if chk_a = 1
lda DA
cmp AR
bne C1
endif
if chk_n = 1
lda DNVZC ; [7] see text
eor NF
and #$80 ; mask off N flag
bne C1
endif
if chk_v = 1
02ca : a505 lda DNVZC ; [8] see text
02cc : 4508 eor VF
02ce : 2940 and #$40 ; mask off V flag
02d0 : d000 bne C1 ; [9] see text
endif
if chk_z = 1
lda DNVZC
eor ZF ; mask off Z flag
and #2
bne C1 ; [10] see text
endif
if chk_c = 1
lda DNVZC
eor CF
and #1 ; mask off C flag
endif
02d2 : 60 C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
02d3 : a506 A6502 lda AR ; 65C02
02d5 : 08 php
02d6 : 68 pla
02d7 : 8507 sta NF
02d9 : 8509 sta ZF
02db : 60 rts
02dc : 20ab02 S6502 jsr SUB2
02df : a506 lda AR
02e1 : 08 php
02e2 : 68 pla
02e3 : 8507 sta NF
02e5 : 8509 sta ZF
02e7 : a503 lda HNVZC
02e9 : 8508 sta VF
02eb : 850a sta CF
02ed : 60 rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
02dc = end TEST
No errors in pass 2.

BIN
tests/65c02-vld-a.bin Normal file

Binary file not shown.

363
tests/65c02-vld-a.lst Normal file
View File

@ -0,0 +1,363 @@
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
----------------------------------------------------- 6502_decimal_test.a65 ------------------------------------------------------
355 lines read, no errors in pass 1.
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
0001 = cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
0001 = vld_bcd = 1 ; 0 = allow invalid bcd, 1 = valid bcd only
0001 = chk_a = 1 ; check accumulator
0000 = chk_n = 0 ; check sign (negative) flag
0000 = chk_v = 0 ; check overflow flag
0000 = chk_z = 0 ; check zero flag
0000 = chk_c = 0 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
0000 = org 0
; operands - register Y = carry in
0000 = N1 ds 1
0001 = N2 ds 1
; binary result
0002 = HA ds 1
0003 = HNVZC ds 1
;04
; decimal result
0004 = DA ds 1
0005 = DNVZC ds 1
; predicted results
0006 = AR ds 1
0007 = NF ds 1
;08
0008 = VF ds 1
0009 = ZF ds 1
000a = CF ds 1
000b = ERROR ds 1
;0C
; workspace
000c = N1L ds 1
000d = N1H ds 1
000e = N2L ds 1
000f = N2H ds 2
code
0200 = org $200
0200 : a001 TEST ldy #1 ; initialize Y (used to loop through carry flag values)
0202 : 840b sty ERROR ; store 1 in ERROR until the test passes
0204 : a900 lda #0 ; initialize N1 and N2
0206 : 8500 sta N1
0208 : 8501 sta N2
020a : a501 LOOP1 lda N2 ; N2L = N2 & $0F
020c : 290f and #$0F ; [1] see text
if vld_bcd = 1
020e : c90a cmp #$0a
0210 : b03e bcs NEXT2
endif
0212 : 850e sta N2L
0214 : a501 lda N2 ; N2H = N2 & $F0
0216 : 29f0 and #$F0 ; [2] see text
if vld_bcd = 1
0218 : c9a0 cmp #$a0
021a : b034 bcs NEXT2
endif
021c : 850f sta N2H
021e : 090f ora #$0F ; N2H+1 = (N2 & $F0) + $0F
0220 : 8510 sta N2H+1
0222 : a500 LOOP2 lda N1 ; N1L = N1 & $0F
0224 : 290f and #$0F ; [3] see text
if vld_bcd = 1
0226 : c90a cmp #$0a
0228 : b022 bcs NEXT1
endif
022a : 850c sta N1L
022c : a500 lda N1 ; N1H = N1 & $F0
022e : 29f0 and #$F0 ; [4] see text
if vld_bcd = 1
0230 : c9a0 cmp #$a0
0232 : b018 bcs NEXT1
endif
0234 : 850d sta N1H
0236 : 205c02 jsr ADD
0239 : 20e102 jsr A6502
023c : 20da02 jsr COMPARE
023f : d01a bne DONE
0241 : 20a002 jsr SUB
0244 : 20ea02 jsr S6502
0247 : 20da02 jsr COMPARE
024a : d00f bne DONE
024c : e600 NEXT1 inc N1 ; [5] see text
024e : d0d2 bne LOOP2 ; loop through all 256 values of N1
0250 : e601 NEXT2 inc N2 ; [6] see text
0252 : d0b6 bne LOOP1 ; loop through all 256 values of N2
0254 : 88 dey
0255 : 10b3 bpl LOOP1 ; loop through both values of the carry flag
0257 : a900 lda #0 ; test passed, so store 0 in ERROR
0259 : 850b sta ERROR
025b : DONE
end_of_test
025b : db > db $db ;execute 65C02 stop instruction
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
025c : f8 ADD sed ; decimal mode
025d : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
025f : a500 lda N1
0261 : 6501 adc N2
0263 : 8504 sta DA ; actual accumulator result in decimal mode
0265 : 08 php
0266 : 68 pla
0267 : 8505 sta DNVZC ; actual flags result in decimal mode
0269 : d8 cld ; binary mode
026a : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
026c : a500 lda N1
026e : 6501 adc N2
0270 : 8502 sta HA ; accumulator result of N1+N2 using binary arithmetic
0272 : 08 php
0273 : 68 pla
0274 : 8503 sta HNVZC ; flags result of N1+N2 using binary arithmetic
0276 : c001 cpy #1
0278 : a50c lda N1L
027a : 650e adc N2L
027c : c90a cmp #$0A
027e : a200 ldx #0
0280 : 9006 bcc A1
0282 : e8 inx
0283 : 6905 adc #5 ; add 6 (carry is set)
0285 : 290f and #$0F
0287 : 38 sec
0288 : 050d A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
028a : 750f adc N2H,x
028c : 08 php
028d : b004 bcs A2
028f : c9a0 cmp #$A0
0291 : 9003 bcc A3
0293 : 695f A2 adc #$5F ; add $60 (carry is set)
0295 : 38 sec
0296 : 8506 A3 sta AR ; predicted accumulator result
0298 : 08 php
0299 : 68 pla
029a : 850a sta CF ; predicted carry result
029c : 68 pla
;
; note that all 8 bits of the P register are stored in VF
;
029d : 8508 sta VF ; predicted V flags
029f : 60 rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
02a0 : f8 SUB sed ; decimal mode
02a1 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02a3 : a500 lda N1
02a5 : e501 sbc N2
02a7 : 8504 sta DA ; actual accumulator result in decimal mode
02a9 : 08 php
02aa : 68 pla
02ab : 8505 sta DNVZC ; actual flags result in decimal mode
02ad : d8 cld ; binary mode
02ae : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02b0 : a500 lda N1
02b2 : e501 sbc N2
02b4 : 8502 sta HA ; accumulator result of N1-N2 using binary arithmetic
02b6 : 08 php
02b7 : 68 pla
02b8 : 8503 sta HNVZC ; flags result of N1-N2 using binary arithmetic
02ba : 60 rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
02bb : c001 SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02bd : a50c lda N1L
02bf : e50e sbc N2L
02c1 : a200 ldx #0
02c3 : b004 bcs S21
02c5 : e8 inx
02c6 : 290f and #$0F
02c8 : 18 clc
02c9 : 050d S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
02cb : f50f sbc N2H,x
02cd : b002 bcs S22
02cf : e95f sbc #$5F ; subtract $60 (carry is clear)
02d1 : e000 S22 cpx #0
02d3 : f002 beq S23
02d5 : e906 sbc #6
02d7 : 8506 S23 sta AR ; predicted accumulator result
02d9 : 60 rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
02da : COMPARE
if chk_a = 1
02da : a504 lda DA
02dc : c506 cmp AR
02de : d000 bne C1
endif
if chk_n = 1
lda DNVZC ; [7] see text
eor NF
and #$80 ; mask off N flag
bne C1
endif
if chk_v = 1
lda DNVZC ; [8] see text
eor VF
and #$40 ; mask off V flag
bne C1 ; [9] see text
endif
if chk_z = 1
lda DNVZC
eor ZF ; mask off Z flag
and #2
bne C1 ; [10] see text
endif
if chk_c = 1
lda DNVZC
eor CF
and #1 ; mask off C flag
endif
02e0 : 60 C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
02e1 : a506 A6502 lda AR ; 65C02
02e3 : 08 php
02e4 : 68 pla
02e5 : 8507 sta NF
02e7 : 8509 sta ZF
02e9 : 60 rts
02ea : 20bb02 S6502 jsr SUB2
02ed : a506 lda AR
02ef : 08 php
02f0 : 68 pla
02f1 : 8507 sta NF
02f3 : 8509 sta ZF
02f5 : a503 lda HNVZC
02f7 : 8508 sta VF
02f9 : 850a sta CF
02fb : 60 rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
02ea = end TEST
No errors in pass 2.

BIN
tests/65c02-vld-all.bin Normal file

Binary file not shown.

363
tests/65c02-vld-all.lst Normal file
View File

@ -0,0 +1,363 @@
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
----------------------------------------------------- 6502_decimal_test.a65 ------------------------------------------------------
355 lines read, no errors in pass 1.
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
0001 = cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
0001 = vld_bcd = 1 ; 0 = allow invalid bcd, 1 = valid bcd only
0001 = chk_a = 1 ; check accumulator
0001 = chk_n = 1 ; check sign (negative) flag
0001 = chk_v = 1 ; check overflow flag
0001 = chk_z = 1 ; check zero flag
0001 = chk_c = 1 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
0000 = org 0
; operands - register Y = carry in
0000 = N1 ds 1
0001 = N2 ds 1
; binary result
0002 = HA ds 1
0003 = HNVZC ds 1
;04
; decimal result
0004 = DA ds 1
0005 = DNVZC ds 1
; predicted results
0006 = AR ds 1
0007 = NF ds 1
;08
0008 = VF ds 1
0009 = ZF ds 1
000a = CF ds 1
000b = ERROR ds 1
;0C
; workspace
000c = N1L ds 1
000d = N1H ds 1
000e = N2L ds 1
000f = N2H ds 2
code
0200 = org $200
0200 : a001 TEST ldy #1 ; initialize Y (used to loop through carry flag values)
0202 : 840b sty ERROR ; store 1 in ERROR until the test passes
0204 : a900 lda #0 ; initialize N1 and N2
0206 : 8500 sta N1
0208 : 8501 sta N2
020a : a501 LOOP1 lda N2 ; N2L = N2 & $0F
020c : 290f and #$0F ; [1] see text
if vld_bcd = 1
020e : c90a cmp #$0a
0210 : b03e bcs NEXT2
endif
0212 : 850e sta N2L
0214 : a501 lda N2 ; N2H = N2 & $F0
0216 : 29f0 and #$F0 ; [2] see text
if vld_bcd = 1
0218 : c9a0 cmp #$a0
021a : b034 bcs NEXT2
endif
021c : 850f sta N2H
021e : 090f ora #$0F ; N2H+1 = (N2 & $F0) + $0F
0220 : 8510 sta N2H+1
0222 : a500 LOOP2 lda N1 ; N1L = N1 & $0F
0224 : 290f and #$0F ; [3] see text
if vld_bcd = 1
0226 : c90a cmp #$0a
0228 : b022 bcs NEXT1
endif
022a : 850c sta N1L
022c : a500 lda N1 ; N1H = N1 & $F0
022e : 29f0 and #$F0 ; [4] see text
if vld_bcd = 1
0230 : c9a0 cmp #$a0
0232 : b018 bcs NEXT1
endif
0234 : 850d sta N1H
0236 : 205c02 jsr ADD
0239 : 20ff02 jsr A6502
023c : 20da02 jsr COMPARE
023f : d01a bne DONE
0241 : 20a002 jsr SUB
0244 : 200803 jsr S6502
0247 : 20da02 jsr COMPARE
024a : d00f bne DONE
024c : e600 NEXT1 inc N1 ; [5] see text
024e : d0d2 bne LOOP2 ; loop through all 256 values of N1
0250 : e601 NEXT2 inc N2 ; [6] see text
0252 : d0b6 bne LOOP1 ; loop through all 256 values of N2
0254 : 88 dey
0255 : 10b3 bpl LOOP1 ; loop through both values of the carry flag
0257 : a900 lda #0 ; test passed, so store 0 in ERROR
0259 : 850b sta ERROR
025b : DONE
end_of_test
025b : db > db $db ;execute 65C02 stop instruction
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
025c : f8 ADD sed ; decimal mode
025d : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
025f : a500 lda N1
0261 : 6501 adc N2
0263 : 8504 sta DA ; actual accumulator result in decimal mode
0265 : 08 php
0266 : 68 pla
0267 : 8505 sta DNVZC ; actual flags result in decimal mode
0269 : d8 cld ; binary mode
026a : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
026c : a500 lda N1
026e : 6501 adc N2
0270 : 8502 sta HA ; accumulator result of N1+N2 using binary arithmetic
0272 : 08 php
0273 : 68 pla
0274 : 8503 sta HNVZC ; flags result of N1+N2 using binary arithmetic
0276 : c001 cpy #1
0278 : a50c lda N1L
027a : 650e adc N2L
027c : c90a cmp #$0A
027e : a200 ldx #0
0280 : 9006 bcc A1
0282 : e8 inx
0283 : 6905 adc #5 ; add 6 (carry is set)
0285 : 290f and #$0F
0287 : 38 sec
0288 : 050d A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
028a : 750f adc N2H,x
028c : 08 php
028d : b004 bcs A2
028f : c9a0 cmp #$A0
0291 : 9003 bcc A3
0293 : 695f A2 adc #$5F ; add $60 (carry is set)
0295 : 38 sec
0296 : 8506 A3 sta AR ; predicted accumulator result
0298 : 08 php
0299 : 68 pla
029a : 850a sta CF ; predicted carry result
029c : 68 pla
;
; note that all 8 bits of the P register are stored in VF
;
029d : 8508 sta VF ; predicted V flags
029f : 60 rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
02a0 : f8 SUB sed ; decimal mode
02a1 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02a3 : a500 lda N1
02a5 : e501 sbc N2
02a7 : 8504 sta DA ; actual accumulator result in decimal mode
02a9 : 08 php
02aa : 68 pla
02ab : 8505 sta DNVZC ; actual flags result in decimal mode
02ad : d8 cld ; binary mode
02ae : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02b0 : a500 lda N1
02b2 : e501 sbc N2
02b4 : 8502 sta HA ; accumulator result of N1-N2 using binary arithmetic
02b6 : 08 php
02b7 : 68 pla
02b8 : 8503 sta HNVZC ; flags result of N1-N2 using binary arithmetic
02ba : 60 rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
02bb : c001 SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02bd : a50c lda N1L
02bf : e50e sbc N2L
02c1 : a200 ldx #0
02c3 : b004 bcs S21
02c5 : e8 inx
02c6 : 290f and #$0F
02c8 : 18 clc
02c9 : 050d S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
02cb : f50f sbc N2H,x
02cd : b002 bcs S22
02cf : e95f sbc #$5F ; subtract $60 (carry is clear)
02d1 : e000 S22 cpx #0
02d3 : f002 beq S23
02d5 : e906 sbc #6
02d7 : 8506 S23 sta AR ; predicted accumulator result
02d9 : 60 rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
02da : COMPARE
if chk_a = 1
02da : a504 lda DA
02dc : c506 cmp AR
02de : d01e bne C1
endif
if chk_n = 1
02e0 : a505 lda DNVZC ; [7] see text
02e2 : 4507 eor NF
02e4 : 2980 and #$80 ; mask off N flag
02e6 : d016 bne C1
endif
if chk_v = 1
02e8 : a505 lda DNVZC ; [8] see text
02ea : 4508 eor VF
02ec : 2940 and #$40 ; mask off V flag
02ee : d00e bne C1 ; [9] see text
endif
if chk_z = 1
02f0 : a505 lda DNVZC
02f2 : 4509 eor ZF ; mask off Z flag
02f4 : 2902 and #2
02f6 : d006 bne C1 ; [10] see text
endif
if chk_c = 1
02f8 : a505 lda DNVZC
02fa : 450a eor CF
02fc : 2901 and #1 ; mask off C flag
endif
02fe : 60 C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
02ff : a506 A6502 lda AR ; 65C02
0301 : 08 php
0302 : 68 pla
0303 : 8507 sta NF
0305 : 8509 sta ZF
0307 : 60 rts
0308 : 20bb02 S6502 jsr SUB2
030b : a506 lda AR
030d : 08 php
030e : 68 pla
030f : 8507 sta NF
0311 : 8509 sta ZF
0313 : a503 lda HNVZC
0315 : 8508 sta VF
0317 : 850a sta CF
0319 : 60 rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
0308 = end TEST
No errors in pass 2.

BIN
tests/65c02-vld-c.bin Normal file

Binary file not shown.

363
tests/65c02-vld-c.lst Normal file
View File

@ -0,0 +1,363 @@
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
----------------------------------------------------- 6502_decimal_test.a65 ------------------------------------------------------
355 lines read, no errors in pass 1.
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
0001 = cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
0001 = vld_bcd = 1 ; 0 = allow invalid bcd, 1 = valid bcd only
0000 = chk_a = 0 ; check accumulator
0000 = chk_n = 0 ; check sign (negative) flag
0000 = chk_v = 0 ; check overflow flag
0000 = chk_z = 0 ; check zero flag
0001 = chk_c = 1 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
0000 = org 0
; operands - register Y = carry in
0000 = N1 ds 1
0001 = N2 ds 1
; binary result
0002 = HA ds 1
0003 = HNVZC ds 1
;04
; decimal result
0004 = DA ds 1
0005 = DNVZC ds 1
; predicted results
0006 = AR ds 1
0007 = NF ds 1
;08
0008 = VF ds 1
0009 = ZF ds 1
000a = CF ds 1
000b = ERROR ds 1
;0C
; workspace
000c = N1L ds 1
000d = N1H ds 1
000e = N2L ds 1
000f = N2H ds 2
code
0200 = org $200
0200 : a001 TEST ldy #1 ; initialize Y (used to loop through carry flag values)
0202 : 840b sty ERROR ; store 1 in ERROR until the test passes
0204 : a900 lda #0 ; initialize N1 and N2
0206 : 8500 sta N1
0208 : 8501 sta N2
020a : a501 LOOP1 lda N2 ; N2L = N2 & $0F
020c : 290f and #$0F ; [1] see text
if vld_bcd = 1
020e : c90a cmp #$0a
0210 : b03e bcs NEXT2
endif
0212 : 850e sta N2L
0214 : a501 lda N2 ; N2H = N2 & $F0
0216 : 29f0 and #$F0 ; [2] see text
if vld_bcd = 1
0218 : c9a0 cmp #$a0
021a : b034 bcs NEXT2
endif
021c : 850f sta N2H
021e : 090f ora #$0F ; N2H+1 = (N2 & $F0) + $0F
0220 : 8510 sta N2H+1
0222 : a500 LOOP2 lda N1 ; N1L = N1 & $0F
0224 : 290f and #$0F ; [3] see text
if vld_bcd = 1
0226 : c90a cmp #$0a
0228 : b022 bcs NEXT1
endif
022a : 850c sta N1L
022c : a500 lda N1 ; N1H = N1 & $F0
022e : 29f0 and #$F0 ; [4] see text
if vld_bcd = 1
0230 : c9a0 cmp #$a0
0232 : b018 bcs NEXT1
endif
0234 : 850d sta N1H
0236 : 205c02 jsr ADD
0239 : 20e102 jsr A6502
023c : 20da02 jsr COMPARE
023f : d01a bne DONE
0241 : 20a002 jsr SUB
0244 : 20ea02 jsr S6502
0247 : 20da02 jsr COMPARE
024a : d00f bne DONE
024c : e600 NEXT1 inc N1 ; [5] see text
024e : d0d2 bne LOOP2 ; loop through all 256 values of N1
0250 : e601 NEXT2 inc N2 ; [6] see text
0252 : d0b6 bne LOOP1 ; loop through all 256 values of N2
0254 : 88 dey
0255 : 10b3 bpl LOOP1 ; loop through both values of the carry flag
0257 : a900 lda #0 ; test passed, so store 0 in ERROR
0259 : 850b sta ERROR
025b : DONE
end_of_test
025b : db > db $db ;execute 65C02 stop instruction
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
025c : f8 ADD sed ; decimal mode
025d : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
025f : a500 lda N1
0261 : 6501 adc N2
0263 : 8504 sta DA ; actual accumulator result in decimal mode
0265 : 08 php
0266 : 68 pla
0267 : 8505 sta DNVZC ; actual flags result in decimal mode
0269 : d8 cld ; binary mode
026a : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
026c : a500 lda N1
026e : 6501 adc N2
0270 : 8502 sta HA ; accumulator result of N1+N2 using binary arithmetic
0272 : 08 php
0273 : 68 pla
0274 : 8503 sta HNVZC ; flags result of N1+N2 using binary arithmetic
0276 : c001 cpy #1
0278 : a50c lda N1L
027a : 650e adc N2L
027c : c90a cmp #$0A
027e : a200 ldx #0
0280 : 9006 bcc A1
0282 : e8 inx
0283 : 6905 adc #5 ; add 6 (carry is set)
0285 : 290f and #$0F
0287 : 38 sec
0288 : 050d A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
028a : 750f adc N2H,x
028c : 08 php
028d : b004 bcs A2
028f : c9a0 cmp #$A0
0291 : 9003 bcc A3
0293 : 695f A2 adc #$5F ; add $60 (carry is set)
0295 : 38 sec
0296 : 8506 A3 sta AR ; predicted accumulator result
0298 : 08 php
0299 : 68 pla
029a : 850a sta CF ; predicted carry result
029c : 68 pla
;
; note that all 8 bits of the P register are stored in VF
;
029d : 8508 sta VF ; predicted V flags
029f : 60 rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
02a0 : f8 SUB sed ; decimal mode
02a1 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02a3 : a500 lda N1
02a5 : e501 sbc N2
02a7 : 8504 sta DA ; actual accumulator result in decimal mode
02a9 : 08 php
02aa : 68 pla
02ab : 8505 sta DNVZC ; actual flags result in decimal mode
02ad : d8 cld ; binary mode
02ae : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02b0 : a500 lda N1
02b2 : e501 sbc N2
02b4 : 8502 sta HA ; accumulator result of N1-N2 using binary arithmetic
02b6 : 08 php
02b7 : 68 pla
02b8 : 8503 sta HNVZC ; flags result of N1-N2 using binary arithmetic
02ba : 60 rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
02bb : c001 SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02bd : a50c lda N1L
02bf : e50e sbc N2L
02c1 : a200 ldx #0
02c3 : b004 bcs S21
02c5 : e8 inx
02c6 : 290f and #$0F
02c8 : 18 clc
02c9 : 050d S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
02cb : f50f sbc N2H,x
02cd : b002 bcs S22
02cf : e95f sbc #$5F ; subtract $60 (carry is clear)
02d1 : e000 S22 cpx #0
02d3 : f002 beq S23
02d5 : e906 sbc #6
02d7 : 8506 S23 sta AR ; predicted accumulator result
02d9 : 60 rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
02da : COMPARE
if chk_a = 1
lda DA
cmp AR
bne C1
endif
if chk_n = 1
lda DNVZC ; [7] see text
eor NF
and #$80 ; mask off N flag
bne C1
endif
if chk_v = 1
lda DNVZC ; [8] see text
eor VF
and #$40 ; mask off V flag
bne C1 ; [9] see text
endif
if chk_z = 1
lda DNVZC
eor ZF ; mask off Z flag
and #2
bne C1 ; [10] see text
endif
if chk_c = 1
02da : a505 lda DNVZC
02dc : 450a eor CF
02de : 2901 and #1 ; mask off C flag
endif
02e0 : 60 C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
02e1 : a506 A6502 lda AR ; 65C02
02e3 : 08 php
02e4 : 68 pla
02e5 : 8507 sta NF
02e7 : 8509 sta ZF
02e9 : 60 rts
02ea : 20bb02 S6502 jsr SUB2
02ed : a506 lda AR
02ef : 08 php
02f0 : 68 pla
02f1 : 8507 sta NF
02f3 : 8509 sta ZF
02f5 : a503 lda HNVZC
02f7 : 8508 sta VF
02f9 : 850a sta CF
02fb : 60 rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
02ea = end TEST
No errors in pass 2.

BIN
tests/65c02-vld-n.bin Normal file

Binary file not shown.

363
tests/65c02-vld-n.lst Normal file
View File

@ -0,0 +1,363 @@
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
----------------------------------------------------- 6502_decimal_test.a65 ------------------------------------------------------
355 lines read, no errors in pass 1.
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
0001 = cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
0001 = vld_bcd = 1 ; 0 = allow invalid bcd, 1 = valid bcd only
0001 = chk_a = 1 ; check accumulator
0000 = chk_n = 0 ; check sign (negative) flag
0000 = chk_v = 0 ; check overflow flag
0000 = chk_z = 0 ; check zero flag
0000 = chk_c = 0 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
0000 = org 0
; operands - register Y = carry in
0000 = N1 ds 1
0001 = N2 ds 1
; binary result
0002 = HA ds 1
0003 = HNVZC ds 1
;04
; decimal result
0004 = DA ds 1
0005 = DNVZC ds 1
; predicted results
0006 = AR ds 1
0007 = NF ds 1
;08
0008 = VF ds 1
0009 = ZF ds 1
000a = CF ds 1
000b = ERROR ds 1
;0C
; workspace
000c = N1L ds 1
000d = N1H ds 1
000e = N2L ds 1
000f = N2H ds 2
code
0200 = org $200
0200 : a001 TEST ldy #1 ; initialize Y (used to loop through carry flag values)
0202 : 840b sty ERROR ; store 1 in ERROR until the test passes
0204 : a900 lda #0 ; initialize N1 and N2
0206 : 8500 sta N1
0208 : 8501 sta N2
020a : a501 LOOP1 lda N2 ; N2L = N2 & $0F
020c : 290f and #$0F ; [1] see text
if vld_bcd = 1
020e : c90a cmp #$0a
0210 : b03e bcs NEXT2
endif
0212 : 850e sta N2L
0214 : a501 lda N2 ; N2H = N2 & $F0
0216 : 29f0 and #$F0 ; [2] see text
if vld_bcd = 1
0218 : c9a0 cmp #$a0
021a : b034 bcs NEXT2
endif
021c : 850f sta N2H
021e : 090f ora #$0F ; N2H+1 = (N2 & $F0) + $0F
0220 : 8510 sta N2H+1
0222 : a500 LOOP2 lda N1 ; N1L = N1 & $0F
0224 : 290f and #$0F ; [3] see text
if vld_bcd = 1
0226 : c90a cmp #$0a
0228 : b022 bcs NEXT1
endif
022a : 850c sta N1L
022c : a500 lda N1 ; N1H = N1 & $F0
022e : 29f0 and #$F0 ; [4] see text
if vld_bcd = 1
0230 : c9a0 cmp #$a0
0232 : b018 bcs NEXT1
endif
0234 : 850d sta N1H
0236 : 205c02 jsr ADD
0239 : 20e102 jsr A6502
023c : 20da02 jsr COMPARE
023f : d01a bne DONE
0241 : 20a002 jsr SUB
0244 : 20ea02 jsr S6502
0247 : 20da02 jsr COMPARE
024a : d00f bne DONE
024c : e600 NEXT1 inc N1 ; [5] see text
024e : d0d2 bne LOOP2 ; loop through all 256 values of N1
0250 : e601 NEXT2 inc N2 ; [6] see text
0252 : d0b6 bne LOOP1 ; loop through all 256 values of N2
0254 : 88 dey
0255 : 10b3 bpl LOOP1 ; loop through both values of the carry flag
0257 : a900 lda #0 ; test passed, so store 0 in ERROR
0259 : 850b sta ERROR
025b : DONE
end_of_test
025b : db > db $db ;execute 65C02 stop instruction
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
025c : f8 ADD sed ; decimal mode
025d : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
025f : a500 lda N1
0261 : 6501 adc N2
0263 : 8504 sta DA ; actual accumulator result in decimal mode
0265 : 08 php
0266 : 68 pla
0267 : 8505 sta DNVZC ; actual flags result in decimal mode
0269 : d8 cld ; binary mode
026a : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
026c : a500 lda N1
026e : 6501 adc N2
0270 : 8502 sta HA ; accumulator result of N1+N2 using binary arithmetic
0272 : 08 php
0273 : 68 pla
0274 : 8503 sta HNVZC ; flags result of N1+N2 using binary arithmetic
0276 : c001 cpy #1
0278 : a50c lda N1L
027a : 650e adc N2L
027c : c90a cmp #$0A
027e : a200 ldx #0
0280 : 9006 bcc A1
0282 : e8 inx
0283 : 6905 adc #5 ; add 6 (carry is set)
0285 : 290f and #$0F
0287 : 38 sec
0288 : 050d A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
028a : 750f adc N2H,x
028c : 08 php
028d : b004 bcs A2
028f : c9a0 cmp #$A0
0291 : 9003 bcc A3
0293 : 695f A2 adc #$5F ; add $60 (carry is set)
0295 : 38 sec
0296 : 8506 A3 sta AR ; predicted accumulator result
0298 : 08 php
0299 : 68 pla
029a : 850a sta CF ; predicted carry result
029c : 68 pla
;
; note that all 8 bits of the P register are stored in VF
;
029d : 8508 sta VF ; predicted V flags
029f : 60 rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
02a0 : f8 SUB sed ; decimal mode
02a1 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02a3 : a500 lda N1
02a5 : e501 sbc N2
02a7 : 8504 sta DA ; actual accumulator result in decimal mode
02a9 : 08 php
02aa : 68 pla
02ab : 8505 sta DNVZC ; actual flags result in decimal mode
02ad : d8 cld ; binary mode
02ae : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02b0 : a500 lda N1
02b2 : e501 sbc N2
02b4 : 8502 sta HA ; accumulator result of N1-N2 using binary arithmetic
02b6 : 08 php
02b7 : 68 pla
02b8 : 8503 sta HNVZC ; flags result of N1-N2 using binary arithmetic
02ba : 60 rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
02bb : c001 SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02bd : a50c lda N1L
02bf : e50e sbc N2L
02c1 : a200 ldx #0
02c3 : b004 bcs S21
02c5 : e8 inx
02c6 : 290f and #$0F
02c8 : 18 clc
02c9 : 050d S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
02cb : f50f sbc N2H,x
02cd : b002 bcs S22
02cf : e95f sbc #$5F ; subtract $60 (carry is clear)
02d1 : e000 S22 cpx #0
02d3 : f002 beq S23
02d5 : e906 sbc #6
02d7 : 8506 S23 sta AR ; predicted accumulator result
02d9 : 60 rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
02da : COMPARE
if chk_a = 1
02da : a504 lda DA
02dc : c506 cmp AR
02de : d000 bne C1
endif
if chk_n = 1
lda DNVZC ; [7] see text
eor NF
and #$80 ; mask off N flag
bne C1
endif
if chk_v = 1
lda DNVZC ; [8] see text
eor VF
and #$40 ; mask off V flag
bne C1 ; [9] see text
endif
if chk_z = 1
lda DNVZC
eor ZF ; mask off Z flag
and #2
bne C1 ; [10] see text
endif
if chk_c = 1
lda DNVZC
eor CF
and #1 ; mask off C flag
endif
02e0 : 60 C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
02e1 : a506 A6502 lda AR ; 65C02
02e3 : 08 php
02e4 : 68 pla
02e5 : 8507 sta NF
02e7 : 8509 sta ZF
02e9 : 60 rts
02ea : 20bb02 S6502 jsr SUB2
02ed : a506 lda AR
02ef : 08 php
02f0 : 68 pla
02f1 : 8507 sta NF
02f3 : 8509 sta ZF
02f5 : a503 lda HNVZC
02f7 : 8508 sta VF
02f9 : 850a sta CF
02fb : 60 rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
02ea = end TEST
No errors in pass 2.

BIN
tests/65c02-vld-v.bin Normal file

Binary file not shown.

363
tests/65c02-vld-v.lst Normal file
View File

@ -0,0 +1,363 @@
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
----------------------------------------------------- 6502_decimal_test.a65 ------------------------------------------------------
355 lines read, no errors in pass 1.
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
0001 = cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
0001 = vld_bcd = 1 ; 0 = allow invalid bcd, 1 = valid bcd only
0000 = chk_a = 0 ; check accumulator
0000 = chk_n = 0 ; check sign (negative) flag
0001 = chk_v = 1 ; check overflow flag
0000 = chk_z = 0 ; check zero flag
0000 = chk_c = 0 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
0000 = org 0
; operands - register Y = carry in
0000 = N1 ds 1
0001 = N2 ds 1
; binary result
0002 = HA ds 1
0003 = HNVZC ds 1
;04
; decimal result
0004 = DA ds 1
0005 = DNVZC ds 1
; predicted results
0006 = AR ds 1
0007 = NF ds 1
;08
0008 = VF ds 1
0009 = ZF ds 1
000a = CF ds 1
000b = ERROR ds 1
;0C
; workspace
000c = N1L ds 1
000d = N1H ds 1
000e = N2L ds 1
000f = N2H ds 2
code
0200 = org $200
0200 : a001 TEST ldy #1 ; initialize Y (used to loop through carry flag values)
0202 : 840b sty ERROR ; store 1 in ERROR until the test passes
0204 : a900 lda #0 ; initialize N1 and N2
0206 : 8500 sta N1
0208 : 8501 sta N2
020a : a501 LOOP1 lda N2 ; N2L = N2 & $0F
020c : 290f and #$0F ; [1] see text
if vld_bcd = 1
020e : c90a cmp #$0a
0210 : b03e bcs NEXT2
endif
0212 : 850e sta N2L
0214 : a501 lda N2 ; N2H = N2 & $F0
0216 : 29f0 and #$F0 ; [2] see text
if vld_bcd = 1
0218 : c9a0 cmp #$a0
021a : b034 bcs NEXT2
endif
021c : 850f sta N2H
021e : 090f ora #$0F ; N2H+1 = (N2 & $F0) + $0F
0220 : 8510 sta N2H+1
0222 : a500 LOOP2 lda N1 ; N1L = N1 & $0F
0224 : 290f and #$0F ; [3] see text
if vld_bcd = 1
0226 : c90a cmp #$0a
0228 : b022 bcs NEXT1
endif
022a : 850c sta N1L
022c : a500 lda N1 ; N1H = N1 & $F0
022e : 29f0 and #$F0 ; [4] see text
if vld_bcd = 1
0230 : c9a0 cmp #$a0
0232 : b018 bcs NEXT1
endif
0234 : 850d sta N1H
0236 : 205c02 jsr ADD
0239 : 20e302 jsr A6502
023c : 20da02 jsr COMPARE
023f : d01a bne DONE
0241 : 20a002 jsr SUB
0244 : 20ec02 jsr S6502
0247 : 20da02 jsr COMPARE
024a : d00f bne DONE
024c : e600 NEXT1 inc N1 ; [5] see text
024e : d0d2 bne LOOP2 ; loop through all 256 values of N1
0250 : e601 NEXT2 inc N2 ; [6] see text
0252 : d0b6 bne LOOP1 ; loop through all 256 values of N2
0254 : 88 dey
0255 : 10b3 bpl LOOP1 ; loop through both values of the carry flag
0257 : a900 lda #0 ; test passed, so store 0 in ERROR
0259 : 850b sta ERROR
025b : DONE
end_of_test
025b : db > db $db ;execute 65C02 stop instruction
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
025c : f8 ADD sed ; decimal mode
025d : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
025f : a500 lda N1
0261 : 6501 adc N2
0263 : 8504 sta DA ; actual accumulator result in decimal mode
0265 : 08 php
0266 : 68 pla
0267 : 8505 sta DNVZC ; actual flags result in decimal mode
0269 : d8 cld ; binary mode
026a : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
026c : a500 lda N1
026e : 6501 adc N2
0270 : 8502 sta HA ; accumulator result of N1+N2 using binary arithmetic
0272 : 08 php
0273 : 68 pla
0274 : 8503 sta HNVZC ; flags result of N1+N2 using binary arithmetic
0276 : c001 cpy #1
0278 : a50c lda N1L
027a : 650e adc N2L
027c : c90a cmp #$0A
027e : a200 ldx #0
0280 : 9006 bcc A1
0282 : e8 inx
0283 : 6905 adc #5 ; add 6 (carry is set)
0285 : 290f and #$0F
0287 : 38 sec
0288 : 050d A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
028a : 750f adc N2H,x
028c : 08 php
028d : b004 bcs A2
028f : c9a0 cmp #$A0
0291 : 9003 bcc A3
0293 : 695f A2 adc #$5F ; add $60 (carry is set)
0295 : 38 sec
0296 : 8506 A3 sta AR ; predicted accumulator result
0298 : 08 php
0299 : 68 pla
029a : 850a sta CF ; predicted carry result
029c : 68 pla
;
; note that all 8 bits of the P register are stored in VF
;
029d : 8508 sta VF ; predicted V flags
029f : 60 rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
02a0 : f8 SUB sed ; decimal mode
02a1 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02a3 : a500 lda N1
02a5 : e501 sbc N2
02a7 : 8504 sta DA ; actual accumulator result in decimal mode
02a9 : 08 php
02aa : 68 pla
02ab : 8505 sta DNVZC ; actual flags result in decimal mode
02ad : d8 cld ; binary mode
02ae : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02b0 : a500 lda N1
02b2 : e501 sbc N2
02b4 : 8502 sta HA ; accumulator result of N1-N2 using binary arithmetic
02b6 : 08 php
02b7 : 68 pla
02b8 : 8503 sta HNVZC ; flags result of N1-N2 using binary arithmetic
02ba : 60 rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
02bb : c001 SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02bd : a50c lda N1L
02bf : e50e sbc N2L
02c1 : a200 ldx #0
02c3 : b004 bcs S21
02c5 : e8 inx
02c6 : 290f and #$0F
02c8 : 18 clc
02c9 : 050d S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
02cb : f50f sbc N2H,x
02cd : b002 bcs S22
02cf : e95f sbc #$5F ; subtract $60 (carry is clear)
02d1 : e000 S22 cpx #0
02d3 : f002 beq S23
02d5 : e906 sbc #6
02d7 : 8506 S23 sta AR ; predicted accumulator result
02d9 : 60 rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
02da : COMPARE
if chk_a = 1
lda DA
cmp AR
bne C1
endif
if chk_n = 1
lda DNVZC ; [7] see text
eor NF
and #$80 ; mask off N flag
bne C1
endif
if chk_v = 1
02da : a505 lda DNVZC ; [8] see text
02dc : 4508 eor VF
02de : 2940 and #$40 ; mask off V flag
02e0 : d000 bne C1 ; [9] see text
endif
if chk_z = 1
lda DNVZC
eor ZF ; mask off Z flag
and #2
bne C1 ; [10] see text
endif
if chk_c = 1
lda DNVZC
eor CF
and #1 ; mask off C flag
endif
02e2 : 60 C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
02e3 : a506 A6502 lda AR ; 65C02
02e5 : 08 php
02e6 : 68 pla
02e7 : 8507 sta NF
02e9 : 8509 sta ZF
02eb : 60 rts
02ec : 20bb02 S6502 jsr SUB2
02ef : a506 lda AR
02f1 : 08 php
02f2 : 68 pla
02f3 : 8507 sta NF
02f5 : 8509 sta ZF
02f7 : a503 lda HNVZC
02f9 : 8508 sta VF
02fb : 850a sta CF
02fd : 60 rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
02ec = end TEST
No errors in pass 2.

BIN
tests/65c02-vld-z.bin Normal file

Binary file not shown.

363
tests/65c02-vld-z.lst Normal file
View File

@ -0,0 +1,363 @@
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
----------------------------------------------------- 6502_decimal_test.a65 ------------------------------------------------------
355 lines read, no errors in pass 1.
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
0001 = cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
0001 = vld_bcd = 1 ; 0 = allow invalid bcd, 1 = valid bcd only
0000 = chk_a = 0 ; check accumulator
0000 = chk_n = 0 ; check sign (negative) flag
0000 = chk_v = 0 ; check overflow flag
0001 = chk_z = 1 ; check zero flag
0000 = chk_c = 0 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
0000 = org 0
; operands - register Y = carry in
0000 = N1 ds 1
0001 = N2 ds 1
; binary result
0002 = HA ds 1
0003 = HNVZC ds 1
;04
; decimal result
0004 = DA ds 1
0005 = DNVZC ds 1
; predicted results
0006 = AR ds 1
0007 = NF ds 1
;08
0008 = VF ds 1
0009 = ZF ds 1
000a = CF ds 1
000b = ERROR ds 1
;0C
; workspace
000c = N1L ds 1
000d = N1H ds 1
000e = N2L ds 1
000f = N2H ds 2
code
0200 = org $200
0200 : a001 TEST ldy #1 ; initialize Y (used to loop through carry flag values)
0202 : 840b sty ERROR ; store 1 in ERROR until the test passes
0204 : a900 lda #0 ; initialize N1 and N2
0206 : 8500 sta N1
0208 : 8501 sta N2
020a : a501 LOOP1 lda N2 ; N2L = N2 & $0F
020c : 290f and #$0F ; [1] see text
if vld_bcd = 1
020e : c90a cmp #$0a
0210 : b03e bcs NEXT2
endif
0212 : 850e sta N2L
0214 : a501 lda N2 ; N2H = N2 & $F0
0216 : 29f0 and #$F0 ; [2] see text
if vld_bcd = 1
0218 : c9a0 cmp #$a0
021a : b034 bcs NEXT2
endif
021c : 850f sta N2H
021e : 090f ora #$0F ; N2H+1 = (N2 & $F0) + $0F
0220 : 8510 sta N2H+1
0222 : a500 LOOP2 lda N1 ; N1L = N1 & $0F
0224 : 290f and #$0F ; [3] see text
if vld_bcd = 1
0226 : c90a cmp #$0a
0228 : b022 bcs NEXT1
endif
022a : 850c sta N1L
022c : a500 lda N1 ; N1H = N1 & $F0
022e : 29f0 and #$F0 ; [4] see text
if vld_bcd = 1
0230 : c9a0 cmp #$a0
0232 : b018 bcs NEXT1
endif
0234 : 850d sta N1H
0236 : 205c02 jsr ADD
0239 : 20e302 jsr A6502
023c : 20da02 jsr COMPARE
023f : d01a bne DONE
0241 : 20a002 jsr SUB
0244 : 20ec02 jsr S6502
0247 : 20da02 jsr COMPARE
024a : d00f bne DONE
024c : e600 NEXT1 inc N1 ; [5] see text
024e : d0d2 bne LOOP2 ; loop through all 256 values of N1
0250 : e601 NEXT2 inc N2 ; [6] see text
0252 : d0b6 bne LOOP1 ; loop through all 256 values of N2
0254 : 88 dey
0255 : 10b3 bpl LOOP1 ; loop through both values of the carry flag
0257 : a900 lda #0 ; test passed, so store 0 in ERROR
0259 : 850b sta ERROR
025b : DONE
end_of_test
025b : db > db $db ;execute 65C02 stop instruction
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
025c : f8 ADD sed ; decimal mode
025d : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
025f : a500 lda N1
0261 : 6501 adc N2
0263 : 8504 sta DA ; actual accumulator result in decimal mode
0265 : 08 php
0266 : 68 pla
0267 : 8505 sta DNVZC ; actual flags result in decimal mode
0269 : d8 cld ; binary mode
026a : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
026c : a500 lda N1
026e : 6501 adc N2
0270 : 8502 sta HA ; accumulator result of N1+N2 using binary arithmetic
0272 : 08 php
0273 : 68 pla
0274 : 8503 sta HNVZC ; flags result of N1+N2 using binary arithmetic
0276 : c001 cpy #1
0278 : a50c lda N1L
027a : 650e adc N2L
027c : c90a cmp #$0A
027e : a200 ldx #0
0280 : 9006 bcc A1
0282 : e8 inx
0283 : 6905 adc #5 ; add 6 (carry is set)
0285 : 290f and #$0F
0287 : 38 sec
0288 : 050d A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
028a : 750f adc N2H,x
028c : 08 php
028d : b004 bcs A2
028f : c9a0 cmp #$A0
0291 : 9003 bcc A3
0293 : 695f A2 adc #$5F ; add $60 (carry is set)
0295 : 38 sec
0296 : 8506 A3 sta AR ; predicted accumulator result
0298 : 08 php
0299 : 68 pla
029a : 850a sta CF ; predicted carry result
029c : 68 pla
;
; note that all 8 bits of the P register are stored in VF
;
029d : 8508 sta VF ; predicted V flags
029f : 60 rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
02a0 : f8 SUB sed ; decimal mode
02a1 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02a3 : a500 lda N1
02a5 : e501 sbc N2
02a7 : 8504 sta DA ; actual accumulator result in decimal mode
02a9 : 08 php
02aa : 68 pla
02ab : 8505 sta DNVZC ; actual flags result in decimal mode
02ad : d8 cld ; binary mode
02ae : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02b0 : a500 lda N1
02b2 : e501 sbc N2
02b4 : 8502 sta HA ; accumulator result of N1-N2 using binary arithmetic
02b6 : 08 php
02b7 : 68 pla
02b8 : 8503 sta HNVZC ; flags result of N1-N2 using binary arithmetic
02ba : 60 rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
02bb : c001 SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02bd : a50c lda N1L
02bf : e50e sbc N2L
02c1 : a200 ldx #0
02c3 : b004 bcs S21
02c5 : e8 inx
02c6 : 290f and #$0F
02c8 : 18 clc
02c9 : 050d S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
02cb : f50f sbc N2H,x
02cd : b002 bcs S22
02cf : e95f sbc #$5F ; subtract $60 (carry is clear)
02d1 : e000 S22 cpx #0
02d3 : f002 beq S23
02d5 : e906 sbc #6
02d7 : 8506 S23 sta AR ; predicted accumulator result
02d9 : 60 rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
02da : COMPARE
if chk_a = 1
lda DA
cmp AR
bne C1
endif
if chk_n = 1
lda DNVZC ; [7] see text
eor NF
and #$80 ; mask off N flag
bne C1
endif
if chk_v = 1
lda DNVZC ; [8] see text
eor VF
and #$40 ; mask off V flag
bne C1 ; [9] see text
endif
if chk_z = 1
02da : a505 lda DNVZC
02dc : 4509 eor ZF ; mask off Z flag
02de : 2902 and #2
02e0 : d000 bne C1 ; [10] see text
endif
if chk_c = 1
lda DNVZC
eor CF
and #1 ; mask off C flag
endif
02e2 : 60 C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
02e3 : a506 A6502 lda AR ; 65C02
02e5 : 08 php
02e6 : 68 pla
02e7 : 8507 sta NF
02e9 : 8509 sta ZF
02eb : 60 rts
02ec : 20bb02 S6502 jsr SUB2
02ef : a506 lda AR
02f1 : 08 php
02f2 : 68 pla
02f3 : 8507 sta NF
02f5 : 8509 sta ZF
02f7 : a503 lda HNVZC
02f9 : 8508 sta VF
02fb : 850a sta CF
02fd : 60 rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
02ec = end TEST
No errors in pass 2.

BIN
tests/65c02-z.bin Normal file

Binary file not shown.

363
tests/65c02-z.lst Normal file
View File

@ -0,0 +1,363 @@
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
----------------------------------------------------- 6502_decimal_test.a65 ------------------------------------------------------
355 lines read, no errors in pass 1.
; Verify decimal mode behavior
; Written by Bruce Clark. This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
; modify the code at the DONE label for desired program end
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
; Configuration:
0001 = cputype = 1 ; 0 = 6502, 1 = 65C02, 2 = 65C816
0000 = vld_bcd = 0 ; 0 = allow invalid bcd, 1 = valid bcd only
0000 = chk_a = 0 ; check accumulator
0000 = chk_n = 0 ; check sign (negative) flag
0000 = chk_v = 0 ; check overflow flag
0001 = chk_z = 1 ; check zero flag
0000 = chk_c = 0 ; check carry flag
end_of_test macro
db $db ;execute 65C02 stop instruction
endm
bss
0000 = org 0
; operands - register Y = carry in
0000 = N1 ds 1
0001 = N2 ds 1
; binary result
0002 = HA ds 1
0003 = HNVZC ds 1
;04
; decimal result
0004 = DA ds 1
0005 = DNVZC ds 1
; predicted results
0006 = AR ds 1
0007 = NF ds 1
;08
0008 = VF ds 1
0009 = ZF ds 1
000a = CF ds 1
000b = ERROR ds 1
;0C
; workspace
000c = N1L ds 1
000d = N1H ds 1
000e = N2L ds 1
000f = N2H ds 2
code
0200 = org $200
0200 : a001 TEST ldy #1 ; initialize Y (used to loop through carry flag values)
0202 : 840b sty ERROR ; store 1 in ERROR until the test passes
0204 : a900 lda #0 ; initialize N1 and N2
0206 : 8500 sta N1
0208 : 8501 sta N2
020a : a501 LOOP1 lda N2 ; N2L = N2 & $0F
020c : 290f and #$0F ; [1] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT2
endif
020e : 850e sta N2L
0210 : a501 lda N2 ; N2H = N2 & $F0
0212 : 29f0 and #$F0 ; [2] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT2
endif
0214 : 850f sta N2H
0216 : 090f ora #$0F ; N2H+1 = (N2 & $F0) + $0F
0218 : 8510 sta N2H+1
021a : a500 LOOP2 lda N1 ; N1L = N1 & $0F
021c : 290f and #$0F ; [3] see text
if vld_bcd = 1
cmp #$0a
bcs NEXT1
endif
021e : 850c sta N1L
0220 : a500 lda N1 ; N1H = N1 & $F0
0222 : 29f0 and #$F0 ; [4] see text
if vld_bcd = 1
cmp #$a0
bcs NEXT1
endif
0224 : 850d sta N1H
0226 : 204c02 jsr ADD
0229 : 20d302 jsr A6502
022c : 20ca02 jsr COMPARE
022f : d01a bne DONE
0231 : 209002 jsr SUB
0234 : 20dc02 jsr S6502
0237 : 20ca02 jsr COMPARE
023a : d00f bne DONE
023c : e600 NEXT1 inc N1 ; [5] see text
023e : d0da bne LOOP2 ; loop through all 256 values of N1
0240 : e601 NEXT2 inc N2 ; [6] see text
0242 : d0c6 bne LOOP1 ; loop through all 256 values of N2
0244 : 88 dey
0245 : 10c3 bpl LOOP1 ; loop through both values of the carry flag
0247 : a900 lda #0 ; test passed, so store 0 in ERROR
0249 : 850b sta ERROR
024b : DONE
end_of_test
024b : db > db $db ;execute 65C02 stop instruction
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
024c : f8 ADD sed ; decimal mode
024d : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
024f : a500 lda N1
0251 : 6501 adc N2
0253 : 8504 sta DA ; actual accumulator result in decimal mode
0255 : 08 php
0256 : 68 pla
0257 : 8505 sta DNVZC ; actual flags result in decimal mode
0259 : d8 cld ; binary mode
025a : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
025c : a500 lda N1
025e : 6501 adc N2
0260 : 8502 sta HA ; accumulator result of N1+N2 using binary arithmetic
0262 : 08 php
0263 : 68 pla
0264 : 8503 sta HNVZC ; flags result of N1+N2 using binary arithmetic
0266 : c001 cpy #1
0268 : a50c lda N1L
026a : 650e adc N2L
026c : c90a cmp #$0A
026e : a200 ldx #0
0270 : 9006 bcc A1
0272 : e8 inx
0273 : 6905 adc #5 ; add 6 (carry is set)
0275 : 290f and #$0F
0277 : 38 sec
0278 : 050d A1 ora N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
027a : 750f adc N2H,x
027c : 08 php
027d : b004 bcs A2
027f : c9a0 cmp #$A0
0281 : 9003 bcc A3
0283 : 695f A2 adc #$5F ; add $60 (carry is set)
0285 : 38 sec
0286 : 8506 A3 sta AR ; predicted accumulator result
0288 : 08 php
0289 : 68 pla
028a : 850a sta CF ; predicted carry result
028c : 68 pla
;
; note that all 8 bits of the P register are stored in VF
;
028d : 8508 sta VF ; predicted V flags
028f : 60 rts
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
0290 : f8 SUB sed ; decimal mode
0291 : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
0293 : a500 lda N1
0295 : e501 sbc N2
0297 : 8504 sta DA ; actual accumulator result in decimal mode
0299 : 08 php
029a : 68 pla
029b : 8505 sta DNVZC ; actual flags result in decimal mode
029d : d8 cld ; binary mode
029e : c001 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02a0 : a500 lda N1
02a2 : e501 sbc N2
02a4 : 8502 sta HA ; accumulator result of N1-N2 using binary arithmetic
02a6 : 08 php
02a7 : 68 pla
02a8 : 8503 sta HNVZC ; flags result of N1-N2 using binary arithmetic
02aa : 60 rts
if cputype != 1
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
lda N1L
sbc N2L
ldx #0
bcs S11
inx
sbc #5 ; subtract 6 (carry is clear)
and #$0F
clc
S11 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
sbc N2H,x
bcs S12
sbc #$5F ; subtract $60 (carry is clear)
S12 sta AR
rts
endif
if cputype = 1
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
02ab : c001 SUB2 cpy #1 ; set carry if Y = 1, clear carry if Y = 0
02ad : a50c lda N1L
02af : e50e sbc N2L
02b1 : a200 ldx #0
02b3 : b004 bcs S21
02b5 : e8 inx
02b6 : 290f and #$0F
02b8 : 18 clc
02b9 : 050d S21 ora N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
02bb : f50f sbc N2H,x
02bd : b002 bcs S22
02bf : e95f sbc #$5F ; subtract $60 (carry is clear)
02c1 : e000 S22 cpx #0
02c3 : f002 beq S23
02c5 : e906 sbc #6
02c7 : 8506 S23 sta AR ; predicted accumulator result
02c9 : 60 rts
endif
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
02ca : COMPARE
if chk_a = 1
lda DA
cmp AR
bne C1
endif
if chk_n = 1
lda DNVZC ; [7] see text
eor NF
and #$80 ; mask off N flag
bne C1
endif
if chk_v = 1
lda DNVZC ; [8] see text
eor VF
and #$40 ; mask off V flag
bne C1 ; [9] see text
endif
if chk_z = 1
02ca : a505 lda DNVZC
02cc : 4509 eor ZF ; mask off Z flag
02ce : 2902 and #2
02d0 : d000 bne C1 ; [10] see text
endif
if chk_c = 1
lda DNVZC
eor CF
and #1 ; mask off C flag
endif
02d2 : 60 C1 rts
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
if cputype = 0
A6502 lda VF ; 6502
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
sta NF
lda HNVZC
sta ZF
rts
S6502 jsr SUB1
lda HNVZC
sta NF
sta VF
sta ZF
sta CF
rts
endif
if cputype = 1
02d3 : a506 A6502 lda AR ; 65C02
02d5 : 08 php
02d6 : 68 pla
02d7 : 8507 sta NF
02d9 : 8509 sta ZF
02db : 60 rts
02dc : 20ab02 S6502 jsr SUB2
02df : a506 lda AR
02e1 : 08 php
02e2 : 68 pla
02e3 : 8507 sta NF
02e5 : 8509 sta ZF
02e7 : a503 lda HNVZC
02e9 : 8508 sta VF
02eb : 850a sta CF
02ed : 60 rts
endif
if cputype = 2
A6502 lda AR ; 65C816
php
pla
sta NF
sta ZF
rts
S6502 jsr SUB1
lda AR
php
pla
sta NF
sta ZF
lda HNVZC
sta VF
sta CF
rts
endif
02dc = end TEST
No errors in pass 2.

View File

@ -1,19 +1,16 @@
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include "cpu.h"
#include "mmu.h"
#ifdef BASICTEST
#include "6502_functional_test.h"
#elif defined(VERBOSETEST)
#include "6502_functional_test_2.h"
#elif defined(EXTENDEDTEST)
#include "65C02_extended_opcodes_test.h"
#else
#error undefined test - specify one of BASICTEST, VERBOSETEST, or EXTENDEDTEST
#endif
bool running = true;
bool verbose = false;
unsigned long startpc = 0x400;
class TestMMU : public MMU {
public:
@ -22,43 +19,98 @@ public:
virtual void Reset() {}
virtual uint8_t read(uint16_t mem) { if (mem == 0xBFF0) { return 'R'; } return ram[mem];}
virtual uint8_t read(uint16_t mem) { if (mem == 0xBFF0 || mem == 0xF001) { return 'R'; } return ram[mem];}
virtual void write(uint16_t mem, uint8_t val) {
if (mem == 0xBFF0) {printf("%c", val); return;}
#if defined(EXTENDEDTEST)
if (mem == 0x202) {printf("Start test %d\n", val);}
#else
if (mem == 0x200) {printf("Start test %d\n", val);}
#endif
if (mem == 0xBFF0 || mem == 0xF001) {printf("%c", val); return;}
if (mem == 0x202 || mem == 0x200) {
if (val == 240) { printf("All tests successful!\n"); running = 0; }
printf("Start test %d\n", val);
}
ram[mem] = val;}
virtual uint8_t readDirect(uint16_t address, uint8_t fromPage) { return read(address);}
virtual bool Serialize(int8_t fd) { return false; }
virtual bool Deserialize(int8_t fd) { return false; }
uint8_t ram[65536];
};
class FileManager;
FileManager *g_filemanager = NULL;
Cpu cpu;
TestMMU mmu;
int main(int argc, char *argv[])
{
int ch;
int fd = -1;
while ((ch = getopt(argc, argv, "f:vs:")) != -1) {
switch (ch) {
case 's':
if (optarg[0] == '0' &&
optarg[1] == 'x') {
startpc = strtol(optarg+2, NULL, 16);
} else {
startpc = strtol(optarg, NULL, 10);
}
break;
case 'v':
verbose = true;
break;
case 'f':
{
if ((fd = open(optarg, O_RDONLY, 0)) < 0) {
fprintf(stderr, "%s: %s\n", optarg, strerror(errno));
exit(1);
}
}
break;
}
}
if (fd == -1) {
fprintf(stderr, "Missing '-f <filename>'\n");
exit(1);
}
cpu.SetMMU(&mmu);
cpu.rst();
// Load the 6502 functional test
memcpy(mmu.ram, functest, 0x10000);
cpu.pc = 0x400;
ssize_t s;
char c;
unsigned long pos = 0;
while ((s = read(fd, &c, 1)) == 1) {
mmu.ram[pos] = c;
pos ++;
}
cpu.pc = startpc;
// cpu.Reset();
time_t startTime = time(NULL);
// call cpu.Run() in the worst possible way (most overhead)
for (uint32_t i=0; i<1000000000; i++) {
for (uint32_t i=0; running && i<1000000000; i++) {
if (cpu.pc == 0x453a) {
printf("Somehow wound up at input routine; exiting\n");
exit(1);
}
int o = mmu.read(cpu.pc);
if (o == 0xDB) {
// end of the decimal mode tests
int result = mmu.read(0x0b);
printf("Test complete. Result: %s\n", result ? "failed" : "passed");
exit(1);
}
cpu.Run(1);
#if 0
if (cpu.pc < 0x477F) {
printf("%llu OP $%.2X #%d 0x%.2X X 0x%.2X Y 0x%.2X A 0x%.2X SP 0x%.2X S 0x%.2X\n", cpu.cycles, mmu.read(cpu.pc), mmu.read(0x200), cpu.pc, cpu.x, cpu.y, cpu.a, cpu.sp, cpu.flags);
if (verbose) {
printf("time %u PC $%.4X OP $%.2X mem200 #%d mem202 #%d X 0x%.2X Y 0x%.2X A 0x%.2X SP 0x%.2X Status 0x%.2X\n", cpu.cycles, cpu.pc, mmu.read(cpu.pc), mmu.read(0x200), mmu.read(0x202), cpu.x, cpu.y, cpu.a, cpu.sp, cpu.flags);
}
#endif
}
time_t endTime = time(NULL);