flags tests
This commit is contained in:
parent
c8364052e0
commit
05a55123ac
2 changed files with 82 additions and 3 deletions
|
@ -24,7 +24,7 @@ psw_store_retrieve_fail:
|
|||
MOV R2,R0
|
||||
CALL print_binary
|
||||
|
||||
MOV #psw_fail_text, R0
|
||||
MOV #psw_store_retrieve_fail_text, R0
|
||||
CALL print_start
|
||||
RET
|
||||
|
||||
|
@ -34,8 +34,86 @@ psw_flags_trigger:
|
|||
CLZ
|
||||
CLN
|
||||
|
||||
; TODO
|
||||
; test zero bit
|
||||
MOV #0,R1
|
||||
TST R1
|
||||
BEQ psw_trigger_1_next
|
||||
; store test number
|
||||
MOV #1.,R2
|
||||
JMP psw_trigger_fail
|
||||
|
||||
psw_trigger_1_next:
|
||||
MOV #128.,R1
|
||||
TST R1
|
||||
BNE psw_trigger_2_next
|
||||
MOV #2.,R2
|
||||
JMP psw_trigger_fail
|
||||
|
||||
psw_trigger_2_next:
|
||||
|
||||
; test overflow bit (overflow)
|
||||
MOV #127.,R1
|
||||
INCB R1
|
||||
BVS psw_trigger_3_next
|
||||
MOV #3.,R2
|
||||
JMP psw_trigger_fail
|
||||
|
||||
; test overflow bit (underflow)
|
||||
psw_trigger_3_next:
|
||||
MOV #-128.,R1
|
||||
DECB R1
|
||||
BVS psw_trigger_4_next
|
||||
MOV #4.,R2
|
||||
JMP psw_trigger_fail
|
||||
|
||||
psw_trigger_4_next:
|
||||
; test minus bit
|
||||
MOV #127.,R1
|
||||
INCB R1
|
||||
BMI psw_trigger_5_next
|
||||
MOV #5.,R2
|
||||
JMP psw_trigger_fail
|
||||
|
||||
psw_trigger_5_next:
|
||||
MOV #128.,R1
|
||||
DECB R1
|
||||
BPL psw_trigger_6_next
|
||||
MOV #6.,R2
|
||||
JMP psw_trigger_fail
|
||||
|
||||
psw_trigger_6_next:
|
||||
; carry flag test
|
||||
MOV #128.,R1
|
||||
ASLB R1
|
||||
BCS psw_trigger_7_next
|
||||
MOV #7.,R2
|
||||
JMP psw_trigger_fail
|
||||
|
||||
psw_trigger_7_next:
|
||||
MOV #64.,R1
|
||||
ASLB R1
|
||||
BCC psw_trigger_8_next
|
||||
MOV #8.,R2
|
||||
JMP psw_trigger_fail
|
||||
|
||||
psw_trigger_8_next:
|
||||
RET
|
||||
|
||||
psw_fail_text: .ASCII "MFPS / MTPS handling FAIL\r\n\x00"
|
||||
psw_trigger_fail:
|
||||
; emit test number
|
||||
MOV R2,R0
|
||||
CALL print_binary
|
||||
; emit flags
|
||||
MFPS R0
|
||||
CALL print_binary
|
||||
; emit text
|
||||
MOV #psw_trigger_fail_text,R0
|
||||
CALL print_start
|
||||
RET
|
||||
|
||||
psw_store_retrieve_fail_text:
|
||||
.ASCII "MFPS / MTPS handling FAIL\r\n\x00"
|
||||
|
||||
psw_trigger_fail_text:
|
||||
.ASCII "PSW trigger fail\r\n\x00"
|
||||
.EVEN
|
||||
|
|
|
@ -96,6 +96,7 @@ bit_seperator2:
|
|||
|
||||
textstart: .ASCII "tester running...\r\n\x00"
|
||||
textfin: .ASCII "tester finished\r\n\x00"
|
||||
.EVEN
|
||||
|
||||
textbuffer: .BLKB 256.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue