; ; group m, test 1 ; ; cmp.8 ; m4_include(..\tmacros.h) INIT_TEST(m,0x01) ; declare symbols here SYM(hop) SYM(d1) SYM(d2) SYM(d3) SYM(d4) SYM(d5) SYM(d6) SYM(d7) SYM(next0) SYM(next1) SYM(next2) SYM(next3) SYM(next4) SYM(next5) SYM(next6) SYM(next7) SYM(next8) SYM(next9) SYM(next10) SYM(next11) SYM(next12) SYM(next13) SYM(next14) SYM(next15) br hop ; Declare data here. Format is: ; op1 ; op2 ; expected a result ; expected flags result V S C Z d1: defb 0xff defb 0x01 defb 0xfe defb 0x06 d2: defb 0x00 defb 0x00 defb 0x00 defb 0x01 d3: defb 0xf0 defb 0x0f defb 0xe1 defb 0x06 d4: defb 0x80 defb 0x01 defb 0x7f defb 0x0a hop: ; Begin test here SUBTEST(1) ; .8 a,u16(dp) ld.16 a,d1 lea a,-555(a) copy dp,a ld.8 a,555(dp) cmp.8 a,555+1(dp) push msw cmpb.eq.8 a,555(dp),next0 FAIL next0: pop a and.8 a,0xf cmpb.eq.8 a,555+3(dp),next1 FAIL next1: SUBTEST(2) ; .8 a,u8(sp) # Don't forget to reset SP! ld.16 a,d2 lea a,-55(a) copy sp,a ld.8 a,55(sp) cmp.8 a,55+1(sp) cmpb.eq.8 a,55(sp),next2 FAIL next2: next3: ld.16 a,0x7000 copy sp,a SUBTEST(3) ; .8 a,u8(b) ld.16 a,d3 lea b,-5(a) ld.8 a,5(b) cmp.8 a,5+1(b) push msw cmpb.eq.8 a,5(b),next4 FAIL next4: pop a and.8 a,0xf cmpb.eq.8 a,5+3(b),next5 FAIL next5: SUBTEST(4) ; .8 a,u8 ld.16 a,d4 lea b,-15(a) ld.8 a,15(b) cmp.8 a,0x01 push msw cmpb.eq.8 a,15(b),next6 FAIL next6: pop a and.8 a,0xf cmpb.eq.8 a,15+3(b),next7 FAIL next7: SUBTEST(6) ; .8 a,1 ld.8 a,0 cmp.8 a,1 push msw cmpb.eq.8 a,0x0,next10 FAIL next10: pop a and.8 a,0xf cmpb.eq.8 a,4,next11 FAIL next11: SUBTEST(7) ; .8 a,b ld.8 a,-5 ld.8 b,-5 cmp.8 a,b push msw cmpb.eq.8 a,-5,next12 FAIL next12: pop a and.8 a,0xf cmpb.eq.8 a,3,next13 FAIL next13: SUBTEST(8) ; .8 a,b ld.8 a,-6 ld.8 b,10 cmp.8 a,b push msw cmpb.eq.8 a,-6,next14 FAIL next14: pop a and.8 a,0xf cmpb.eq.8 a,6,next15 FAIL next15: ; Finally, when done branch to pass END_TEST