This commit is contained in:
folkert van heusden 2022-03-13 14:55:47 +01:00
parent f49cafd18c
commit 337bbc836d
2 changed files with 50 additions and 3 deletions

44
tester-adc-sbc.mac Normal file
View file

@ -0,0 +1,44 @@
.EXTERN ALL
test_adc:
; initial value
MOV #32769.,R0
; number of additions
MOV #257.,R1
test_adc_loop:
ADD #1003.,R0
ADC R0
DEC R1
TST R1
BNE test_adc_loop
CMP #28400.,R0
BNE test_adc_failed
; test 8 bit
MOV #32769.,R0
MOV #257.,R1
test_adc_loop8b:
ADD #13.,R0
ADCB R0
DEC R1
TST R1
BNE test_adc_loop8b
CMP #36110.,R0
BNE test_adc_failed
RET
test_adc_failed:
MOV #adc_fail_text,R0
CALL print_start
RET
adc_fail_text:
.ASCII "ADC handling FAIL\r\n\x00"
.EVEN

View file

@ -11,6 +11,7 @@ start: MOV #1000, R6
JMP go
.INCLUDE "tester-psw.mac"
.INCLUDE "tester-adc-sbc.mac"
go: MOV #textstart, R0
CALL print_start
@ -19,6 +20,8 @@ go: MOV #textstart, R0
CALL psw_flags_trigger
CALL test_adc
MOV #textfin, R0
CALL print_start
TRAP 7
@ -52,11 +55,11 @@ print_binary:
MFPS -(SP)
MOV R0,-(SP)
MOV R1,-(SP)
; 8 bits in a byte
MOV #8.,R1
; 16 bits in a word
MOV #16.,R1
print_bit:
ASLB R0
ASL R0
BCS print_1
waittx0:
TSTB @#TTYST