This commit is contained in:
folkert van heusden 2022-03-14 20:08:36 +01:00
parent 9ebb1aa0c9
commit 62d2971860
2 changed files with 53 additions and 0 deletions

50
tester-bge.mac Normal file
View file

@ -0,0 +1,50 @@
.EXTERN ALL
test_bge:
MOV #what_bge,R0
CALL print_start
test_bge_1:
; initialize flags
MOV #8.,R0
MTPS R0
; should not jump
BGE test_bge_1_fail
JMP test_bge_2
test_bge_1_fail:
MOV #1.,R0
JMP test_bge_fail
test_bge_2:
MOV #10.,R0
MTPS R0
BGE test_bge_2_ok
MOV #2.,R0
JMP test_bge_fail
test_bge_2_ok:
RET
test_bge_fail:
; print test number
CALL print_binary
; flags are always (for this tester) in R2
MOV R2,R0
CALL print_binary
MOV #test_bge_fail_txt,R0
CALL print_start
RET
test_bge_fail_txt:
.ASCII "BGE handling FAIL\r\n\x00"
what_bge:
.ASCII "BGE test\r\n\x00"
.EVEN

View file

@ -15,6 +15,7 @@ start: MOV #1000, R6
.INCLUDE "tester-addressing.mac"
.INCLUDE "tester-mov.mac"
.INCLUDE "tester-tst.mac"
.INCLUDE "tester-bge.mac"
go: MOV #textstart, R0
CALL print_start
@ -33,6 +34,8 @@ go: MOV #textstart, R0
CALL test_tst
CALL test_bge
MOV #textfin, R0
CALL print_start
TRAP 7