1 % Run some simple tests on DIVU (unsigned)
3 % This depends on working GETA, LDOU, PUT
8 Main GETA $255,Traphandler
10 PUT rT,$255 % We only try this in supervisor mode
13 Loop PUT rA,0 % clear current exception
14 LDOU $8,$0,0 % Upper quotient
15 LDOU $1,$0,8 % Quotient
16 LDOU $2,$0,16 % Divisor
17 LDOU $3,$0,24 % Expected result
18 LDOU $4,$0,32 % Expected remainder
19 LDOU $7,$0,40 % Expected exception
23 CMPU $6,$5,$3 % check result
26 GET $5,rR % check remainder
30 GET $5,rA % check current exception
31 AND $5,$5,(1<<6)|(1<<7) % keep only DV bits
35 ADDU $0,$0,48 % move to next data tuple
42 Done TRAP 0,Fputs,StdOut
45 PassMsg BYTE "Passed",#a,0
46 FailMsg BYTE "Failed!",#a,0
76 OCTA #FFFFFFFFFFFFFFFF
77 OCTA #FFFFFFFFFFFFFFFF
78 OCTA #FFFFFFFFFFFFFFFF
79 OCTA #FFFFFFFFFFFFFFFF
80 OCTA #FFFFFFFFFFFFFFFF
98 OCTA #8000000000000017
101 OCTA #8000000000000017
112 OCTA #8000000000000000
113 OCTA #FFFFFFFFFFFFFFFF
115 OCTA #8000000000000000
122 OCTA #fffffffffefb325a
144 % This has no impact on mmix simulation, but is for RTL
145 Traphandler GET $255,rBB