Closed breakintoprogram closed 8 months ago
Example test:
10 DIM CODE% 16
20 PROCasm("LD A,5","3E05")
30 PROCasm("RET","C9")
40 PROCasm("LDIR","42"): REM A deliberate error
980 :
990 STOP
1000 DEF PROCasm(asm$,output$)
1010 P%=CODE%
1020 OSCLI("ASM "+asm$)
1025 P%=CODE%
1030 FOR I%=1 TO LEN(output$) STEP 2
1040 H$=MID$(output$,I%,2)
1050 B%=EVAL("&"+H$)
1060 IF B%<>?P% THEN PRINT "ERROR! EXPECTED "+output$:STOP
1070 P%=P%+1
1080 NEXT
1090 ENDPROC
Output:
>RUN
044F2E 3E 05 LD A,5
044F2E C9 RET
044F2E ED B0 LDIR
ERROR! EXPECTED 42
STOP at line 1060
As a developer I want to be able to write assembly language tests So that I can quickly validate all instruction sets
Requirements:
Idea: