initial
[fpgammix.git] / regression-tests / test-div / test-mxor-kernel.mms
blob28b6a530b5d71490578d632a9912a5e1e6e9ecf1
1 % Run some simple tests on MXOR
3 % This depends on working GETA, LDOU, PUT
4 % TRAP, SETL, CMP, BZ
6         LOC     #80000000
8 Main    GETA    $255,Traphandler
9         BNN     $255,1F
10         PUT     rT,$255                 % We only try this in supervisor mode
11 1H      GETA    $255,FailMsg
12         GETA    $0,Numbers
13 Loop    LDOU    $1,$0,0                 % Y
14         LDOU    $2,$0,8                 % Z
15         LDOU    $3,$0,16                % Expected result
17         MXOR    $5,$1,$2                % check result
18         CMPU    $6,$5,$3
19         BNZ     $6,Done
21         ADDU    $0,$0,24                % move to next data tuple
22         GETA    $1,End
23         CMP     $1,$0,$1
24         BNZ     $1,Loop
26         GETA    $255,PassMsg
28 Done    TRAP    0,Fputs,StdOut
29         TRAP    0,Halt,0
31 PassMsg BYTE    "Passed",#a,0
32 FailMsg BYTE    "Failed!",#a,0
34 Numbers OCTA    #1234567890ABCDEF
35         OCTA    #0000000000000001
36         OCTA    #00000000000000EF
38         OCTA    #1234567890ABCDEF
39         OCTA    #0000000000000002
40         OCTA    #00000000000000CD
42         OCTA    #1234567890ABCDEF
43         OCTA    #0000000000000100
44         OCTA    #000000000000EF00
46         OCTA    20060917
47         OCTA        1646
48         OCTA    #2829
50         OCTA    #8000000000000000
51         OCTA    #FFFFFFFFFFFFFFFF
52         OCTA    #8080808080808080
54         OCTA    #8000000000000017
55         OCTA    #0
56         OCTA    #0
58         OCTA    -17092006
59         OCTA        -2020
60         OCTA    #6d6d6d6d6d6dfefa
62         OCTA    -17092006
63         OCTA         2020
64         OCTA    #9304
66         OCTA     17092006
67         OCTA        -2020
68         OCTA    #6e6e6e6e6e6e0105
70         OCTA    #8000000000000017
71         OCTA    #0
72         OCTA    #0
74 End     OCTA           0
76 % XXX This should be a separate module prefixed to .txt files
77 % XXX I just need to pick a good address for the Traphandler
78 % This has no impact on mmix simulation, but is for RTL
79 Traphandler     GET     $255,rBB
80                 LDBU    $0,$255
81                 SETH    $1,1
82 1H              LDO     $2,$1
83                 PBOD    $2,1B
84                 STO     $0,$1
85                 PUT     255,255