I don't think I was clear enough what I was referring to..
I'm talking about integer division for example does not verify the calculation afterwards. Generally the program would crash if the CPU was screwing up badly. But a couple of bad bits here and there would not cause that to happen.
Code: Select all
div_32_16_test:
*-----------------------------------------------------------------------------*
move.l arguments(pc),a6
move.l arg_0(a6),d2 ; first argument is count
subq.l #1,d2
bmi.s .err
moveq #3,d7
move.l #$0001FFFF,d6
.div_outer_loop:
move.l d6,d3
moveq #(1024/16)-1,d1 ; 1024 loops
.div_loop:
;
rept 16
divu.w d7,d3
endr
;
dbra d1,.div_loop
dbra d2,.div_outer_loop
.err: rts
The loop count is set by GB6/7 which is 2000 loops, of it seems 1024 loops. Inner and outer loops I presume.
So I assume it does 1024 loops, 2000 times.
The idea being it would do those 1024 loops, and compare the result to whatever the result is supposed to be, and give it a "pass or fail bit", then onto the next loop until it has done 2000 loops in total. This bit will be transferred back to GB7 which is the code
@dml Helped me fix up last week.
So basically I think it would be something like this, in basic analogy..
Code: Select all
FOR OUTER =1 TO 2000
FOR INNER =1 TO 1024
*DIVISION LOOP*
NEXT INNER
*CHECK DIVISION RESULT IS CORRECT AND SET 'BAD BIT' IF FAILED*
NEXT OUTER
The return code to pass data back to GB7 is this.
Code: Select all
*-----------------------------------------------------------------------------*
EXXOS_Test:
*-----------------------------------------------------------------------------*
; EXPECTS: 3 values (2 varptrs, 1 constant)
; RETURNS: 2 values (via 2 varptrs)
;
; call loc testcode&,EXXOS_Test,varptr(X&),varptr(Y&),56789
move.l arguments(pc),a6 ; a6 = BASIC argument table
;
; read input arguments into registers
;
move.l arg_0(a6),a0 ; a0 = BASIC variable ptr (X&)
move.l (a0),d0 ; load value d0 (unused) from X&
;
move.l arg_1(a6),a1 ; a1 = BASIC variable ptr (Y&)
move.l (a1),d1 ; load value d1 (unused) from Y&
;
move.l arg_2(a6),d2 ; d2 = BASIC constant value (56789)
;
; ...now do some work... (modify arg_2 constant)
;
add.l #1,d2 ; d2 = (constant+1)
;
; return values to BASIC via X&, Y& var ptrs:
; a0 = BASIC variable ptr (X&)
; a1 = BASIC variable ptr (Y&)
;
move.l #1234,(a0) ; store value #1234 to X&
move.l d2,(a1) ; store modified value (constant+1) to Y&
;
rts
I forgot where I got up to with it all but I do know the example routine we did does work. I should be able to figure that out anyway. But the integer division loop needs to set a register bit somewhere to default as zero, then set to 1 if a loop failed. I can then read that value in GB7 and flag up that the test failed somehow.