From a65bba32a023a6e06b8cd698021a8d104efb8193 Mon Sep 17 00:00:00 2001 From: thomas374b Date: Thu, 15 Oct 2020 17:59:14 +0200 Subject: [PATCH] clean-up overall mnemonic-testcase, missing opcodes added (cherry picked from commit db418823a7c0f201e21889e3a60b4b30f3204b8a) --- test/suite68hc908.asm | 129 +++++++++++++++++++++----------------- test/suite68hc908.bin.ref | Bin 601 -> 642 bytes test/suite68hc908.hex.ref | 74 +++++++++++----------- 3 files changed, 111 insertions(+), 92 deletions(-) diff --git a/test/suite68hc908.asm b/test/suite68hc908.asm index 3ba451b..dcdca68 100644 --- a/test/suite68hc908.asm +++ b/test/suite68hc908.asm @@ -14,6 +14,7 @@ .PROCESSOR 68hc908 PTB .EQU 1 +PTC .EQU 2 DDRB .EQU 5 FIVE .EQU 5 @@ -26,102 +27,116 @@ RAM_START .EQU 0x40 .byte 0xba,0xdc,0x0d,0xe0 adc #6 - adc.b RAM_START + adc RAM_START adc [X+7] adc constant0 adc [X+0x300] adc ,X adc [SP+5] adc [SP+500] -; adc.w [SP+500] ; doesnt work -; adc.w 500,SP add #6 - add.b RAM_START + add RAM_START add 7,X add constant0 add 0x300,X add ,X add FIVE,SP - add.w [SP+FIVE_HUNDRED] + add [SP+FIVE_HUNDRED] aiS #5 aiX #6 and #6 - and.b RAM_START + and RAM_START and 7,X and constant0 -; and.w [X+0x300] ; doesnt work and [X+0x300] and ,X and 5,SP - and FIVE_HUNDRED,SP ; doesnt work -; and.w FIVE_HUNDRED,SP ; must force addressing mode + and FIVE_HUNDRED,SP asl RAM_START asl 3,X asl ,X asl 5,SP - aslA + aslA aslX asr RAM_START asr 3,X asr ,X asr 5,SP - asrA - asrX + asrA + asrX - bcc frontLoop + bcc frontLoop bcs frontLoop - beq frontLoop - bhcc frontLoop - bhcs frontLoop + beq frontLoop + bhcc frontLoop + bhcs frontLoop bhi frontLoop - bhs frontLoop - bih frontLoop - bil frontLoop + bhs frontLoop + bih frontLoop + bil frontLoop bit #6 - bit.b RAM_START + bit RAM_START bit 7,X bit constant0 bit 0x300,X bit ,X bit 5,SP - bit.w 500,SP + bit 500,SP - blo frontLoop + blo frontLoop bls frontLoop - bmc frontLoop - bmi frontLoop - bms frontLoop - bne frontLoop - bpl frontLoop - bra frontLoop - brn frontLoop + bmc frontLoop + bmi frontLoop + bms frontLoop + bne frontLoop + bpl frontLoop + bra frontLoop + brn frontLoop subRoutine: rts brset 0,PTB,frontLoop + brclr 0,PTC,subRoutine brset 1,PTB,frontLoop + brclr 1,PTC,subRoutine brset 2,PTB,frontLoop + brclr 2,PTC,subRoutine brset 3,PTB,frontLoop + brclr 3,PTC,subRoutine brset 4,PTB,frontLoop + brclr 4,PTC,subRoutine brset 5,PTB,frontLoop + brclr 5,PTC,subRoutine brset 6,PTB,frontLoop + brclr 6,PTC,subRoutine brset 7,PTB,frontLoop + brclr 7,PTC,subRoutine + +frontLoop: bset 0,PTB + bclr 0,PTC bset 1,PTB + bclr 1,PTC bset 2,PTB + bclr 2,PTC bset 3,PTB + bclr 3,PTC bset 4,PTB + bclr 4,PTC bset 5,PTB + bclr 5,PTC bset 6,PTB + bclr 6,PTC bset 7,PTB + bclr 7,PTC bsr subRoutine @@ -134,7 +149,7 @@ subRoutine: clc cli -frontLoop: +;frontLoop: clr RAM_START clr 3,X @@ -145,13 +160,13 @@ frontLoop: clrX cmp #6 - cmp.b RAM_START + cmp RAM_START cmp 7,X cmp constant0 cmp 0x300,X cmp ,X cmp 5,SP - cmp.w 500,SP + cmp 500,SP com RAM_START com 3,X @@ -164,26 +179,28 @@ frontLoop: cpHX #constant0 cpX #6 - cpX.b RAM_START + cpX RAM_START cpX 7,X cpX constant0 cpX 0x300,X cpX ,X cpX 5,SP - cpX.w FIVE_HUNDRED,SP - + cpX FIVE_HUNDRED,SP + + daa ; decimal adjust after BCD calculation + backLoop: dbnzA backLoop dbnz 4,backLoop dbnz [X+5],backLoop dbnz [SP+6],backLoop dbnz.ix 0,backLoop ; must add forced-address-mode extension and dummy 0 to get opcode 0x7B - dbnzX backLoop + dbnzX backLoop dec RAM_START dec 3,X dec ,X - dec 5,SP + dec 5,SP decA decX @@ -199,13 +216,13 @@ backLoop: stop eor #6 - eor.b RAM_START + eor RAM_START eor 7,X eor constant0 eor 0x300,X eor ,X eor 5,SP - eor.w 500,SP + eor 500,SP inc RAM_START inc 3,X @@ -214,38 +231,38 @@ backLoop: incA incX - jmp.8 RAM_START + jmp RAM_START jmp vector0 jmp 3,X jmp $300,X jmp ,X - jsr.8 RAM_START + jsr RAM_START jsr vector0 jsr 3,X jsr 0x300,X jsr ,X ldA #6 - ldA.b RAM_START + ldA RAM_START ldA 7,X ldA constant0 ldA 0x300,X ldA ,X ldA 5,SP - ldA.w 500,SP + ldA 500,SP ldHX #500 ldHX RAM_START ldX #55 - ldX.b RAM_START + ldX RAM_START ldX 7,X ldX constant0 ldX 0x300,X ldX ,X ldX 5,SP - ldX.w 500,SP + ldX 500,SP lsl RAM_START lsl 3,X @@ -277,13 +294,13 @@ backLoop: nop orA #6 - orA.b RAM_START + orA RAM_START orA 7,X orA constant0 orA 0x300,X orA ,X orA 5,SP - orA.w 500,SP + orA 500,SP pshA pshH @@ -312,43 +329,43 @@ dummyISR: rti sbc #6 - sbc.b RAM_START + sbc RAM_START sbc 7,X sbc constant0 sbc 0x300,X sbc ,X sbc 5,SP - sbc.w 500,SP + sbc 500,SP sec sei - stA.b RAM_START + stA RAM_START stA 7,X stA constant0 stA 0x300,X stA ,X stA 5,SP - stA.w 500,SP + stA 500,SP stHX RAM_START - stX.b RAM_START + stX RAM_START stX 7,X stX constant0 stX 0x300,X stX ,X stX 5,SP - stX.w 500,SP + stX 500,SP sub #6 - sub.b RAM_START + sub RAM_START sub 7,X sub constant0 sub 0x300,X sub ,X sub 5,SP - sub.w 500,SP + sub 500,SP swi tAP @@ -357,7 +374,7 @@ dummyISR: tPA tSHX - tst.8 RAM_START + tst RAM_START tst 3,X tst ,X tst 4,SP diff --git a/test/suite68hc908.bin.ref b/test/suite68hc908.bin.ref index eac55f52291d135def7880b6f0530c0e7410d10c..b70d6e510eb8e6220f1d48ee89853228f59eeaef 100644 GIT binary patch delta 425 zcmWN`+e_3z6ae5k=QuO1W@g*3i>9rb+08bQ5Lu&<=q-YX2+5FTkzRbM=xs3SFG%(& zfZE~}`SnwUj7MPftwy?(iZ^D-tDp9~j|-BgdwjDGKJj>H1b zNX~(~rJkBu{lVKjiAA23oCkM9-ceW8ee+qr_O>S$IeVhEvo5hEzO|$J_@-mgww*_> zsRw3KzwtIh;ulX!&VZ|Jt=YR{&-Pe-^X8^)yCaQN4d(>Z11=!c5zZGtmBcv(#+>VD{uo;U?ptC-rm+oz9E#2 z7iKtKls=g{Wcqqi!7iI7@q@=Dr@=Lv1fAxD+;{kl>GbxBx@RWzD{lu$%=3igL2##% zVTc~ISrUKvi{vc07SlzRyX1lPXQt10f2Cm(f1jIv-#teoB>Z*t&`jyK-VTxY%~O(x z!0iWj#N2LrVZP~)-X?wI0raZ|yFlv)%l%W^0|5J; z>jj?M0raN@uLh(Bv_Rws#Qjr|J0O2`C37cnC~qlkB5NdRFJ~@gr3SS?LB~K$wEK4g%Ek`CrDnlSaAwPit0XqT#I0OMT1_3e%0WS&xEDQlD4gn?* z0TKZe0Tuxm0U7}u0UiOZ)j=Q;F$oS~3JacL3kPupQ9uHinm<5q1Am@x1y2i%U!exE zK;Z|${Zo?-0T~rjqXx4;;|Ih2Q_}+g^Pb}cp3?#JlRN=00aKG~0T~-r>;v2b0Q|i` z&HYvF1Kk4v{iX)CK;{R={Zo^m0T=;Oleqyr0aKIq0WV!s(gOhUp5g_b(gF0Do3}vc z2gm(W*8>3ep63Og*8%i3K)*om2haUe-va>up6>;o-vRWX2CzWj2f+PP&;tPQp5O(Z b&;j&=gqM_sl|4Xh1AU%t1WjF^008{)EZ>$4 diff --git a/test/suite68hc908.hex.ref b/test/suite68hc908.hex.ref index 9aa21f5..860477d 100644 --- a/test/suite68hc908.hex.ref +++ b/test/suite68hc908.hex.ref @@ -1,39 +1,41 @@ -:10FB0000BADC0DE0A906B940E907C9FD53D90300E5 +:10FB0000BADC0DE0A906B940E907C9FD7CD90300BC :10FB1000F99EE9059ED901F4AB06BB40EB07CBFD8E -:10FB200053DB0300FB9EEB059EDB01F4A705AF064C -:10FB3000A406B440E407C4FD53D40300F49EE405D6 +:10FB20007CDB0300FB9EEB059EDB01F4A705AF0623 +:10FB3000A406B440E407C4FD7CD40300F49EE405AD :10FB40009ED401F438406803789E680548583740D1 -:10FB50006703779E67054757247525732771286FBC -:10FB6000296D226B24692F672E65A506B540E50730 -:10FB7000C5FD53D50300F59EE5059ED501F4254F3F -:10FB8000234D2C4B2B492D4726452A432041213F0D -:10FB90008100013B02013804013506013208012FC2 -:10FBA0000A012C0C01290E01261001120114011664 -:10FBB0000118011A011C011E01ADD54120113109A6 -:10FBC0000E610A0B9E610B077105514002989A3F26 -:10FBD000406F037F9E6F054F8C5FA106B140E10728 -:10FBE000C1FD53D10300F19EE1059ED101F43340E4 -:10FBF0006303739E63054353754065FD53A306B3CA -:10FC000040E307C3FD53D30300F39EE3059ED301F6 -:10FC1000F44BFE3B04FB6B05F89E6B06F47BF25B3A -:10FC2000F03A406A037A9E6A054A5A52426293E168 -:10FC300092DF91DD90DB8F8EA806B840E807C8FD03 -:10FC400053D80300F89EE8059ED801F43C406C03AD -:10FC50007C9E6C054C5CBC40CCFD55EC03DC030089 -:10FC6000FCBD40CDFD55ED03DD0300FDA606B6400D -:10FC7000E607C6FD53D60300F69EE6059ED601F4C0 -:10FC80004501F45540AE37BE40EE07CEFD53DE03CE -:10FC900000FE9EEE059EDE01F438406803789E6803 -:10FCA00005485834406403749E640544546E05400E -:10FCB0005E404E0A407E4030406003709E600540CA -:10FCC000509DAA06BA40EA07CAFD53DA0300FA9E1D -:10FCD000EA059EDA01F4878B89868A8839406903B0 -:10FCE000799E6905495936406603769E66054656F3 -:10FCF0009C80A206B240E207C2FD53D20300F29EEE -:10FD0000E2059ED201F4999BB740E707C7FD53D7A0 -:10FD10000300F79EE7059ED701F43540BF40EF078B -:10FD2000CFFD53DF0300FF9EEF059EDF01F4A00629 -:10FD3000B040E007C0FD53D00300F09EE0059ED028 -:10FD400001F48384979485953D406D037D9E6D04F9 -:07FD50004D5D9F0000FCF176 +:10FB50006703779E670547572467256527632861F4 +:10FB6000295F225D245B2F592E57A506B540E50776 +:10FB7000C5FD7CD50300F59EE5059ED501F4254124 +:10FB8000233F2C3D2B3B2D3926372A35203321317D +:10FB90008100012D0102F90201270302F304012172 +:10FBA0000502ED06011B0702E70801150902E10A3B +:10FBB000010F0B02DB0C01090D02D50E01030F0230 +:10FBC000CF100111021201130214011502160117C0 +:10FBD00002180119021A011B021C011D021E011F3D +:10FBE00002ADAD4120DB3109D8610AD59E610BD150 +:10FBF00071CF5140CC989A3F406F037F9E6F054F65 +:10FC00008C5FA106B140E107C1FD7CD10300F19EEC +:10FC1000E1059ED101F433406303739E63054353B2 +:10FC2000754065FD7CA306B340E307C3FD7CD303A9 +:10FC300000F39EE3059ED301F4724BFE3B04FB6B85 +:10FC400005F89E6B06F47BF25BF03A406A037A9EFD +:10FC50006A054A5A52426293E192DF91DD90DB8F4E +:10FC60008EA806B840E807C8FD7CD80300F89EE8D7 +:10FC7000059ED801F43C406C037C9E6C054C5CBC3A +:10FC800040CCFD7EEC03DC0300FCBD40CDFD7EEDF1 +:10FC900003DD0300FDA606B640E607C6FD7CD603DD +:10FCA00000F69EE6059ED601F44501F45540AE37B8 +:10FCB000BE40EE07CEFD7CDE0300FE9EEE059EDE1E +:10FCC00001F438406803789E68054858344064035E +:10FCD000749E640544546E05405E404E0A407E406A +:10FCE00030406003709E600540509DAA06BA40EA0D +:10FCF00007CAFD7CDA0300FA9EEA059EDA01F48762 +:10FD00008B89868A8839406903799E690549593605 +:10FD1000406603769E660546569C80A206B240E287 +:10FD200007C2FD7CD20300F29EE2059ED201F49947 +:10FD30009BB740E707C7FD7CD70300F79EE7059E0A +:10FD4000D701F43540BF40EF07CFFD7CDF0300FF54 +:10FD50009EEF059EDF01F4A006B040E007C0FD7CE9 +:10FD6000D00300F09EE0059ED001F4838497948533 +:10FD7000953D406D037D9E6D044D5D9F0000FD1A15 :00000001FF