initial
[fpgammix.git] / regression-tests / test-div / test-mor-kernel.mms
blobcd7a2263b0349dca39f672cf9f45cbac166b1b5f
1 % Run some simple tests on MOR
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         MOR     $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    #7824317821437294
35         OCTA    #9812189744372983
36         OCTA    #797a79ff67ffb5fe
38         OCTA    #1234567890ABCDEF
39         OCTA    #0000000000000001
40         OCTA    #00000000000000EF
42         OCTA    #1234567890ABCDEF
43         OCTA    #0000000000000002
44         OCTA    #00000000000000CD
46         OCTA    #1234567890ABCDEF
47         OCTA    #0000000000000100
48         OCTA    #000000000000EF00
50         OCTA    20060917
51         OCTA        1646
52         OCTA    #3a3b
54         OCTA    #8000000000000000
55         OCTA    #FFFFFFFFFFFFFFFF
56         OCTA    #8080808080808080
58         OCTA    #8000000000000017
59         OCTA    #0
60         OCTA    #0
62         OCTA    -17092006
63         OCTA        -2020
64         OCTA    #ffffffffffffffff
66         OCTA    -17092006
67         OCTA         2020
68         OCTA    #fbff
70         OCTA     17092006
71         OCTA        -2020
72         OCTA    #efefefefefef0105
74         OCTA    #8000000000000017
75         OCTA    #0
76         OCTA    #0
78 End     OCTA           0
80 % XXX This should be a separate module prefixed to .txt files
81 % XXX I just need to pick a good address for the Traphandler
82 % This has no impact on mmix simulation, but is for RTL
83 Traphandler     GET     $255,rBB
84                 LDBU    $0,$255
85                 SETH    $1,1
86 1H              LDO     $2,$1
87                 PBOD    $2,1B
88                 STO     $0,$1
89                 PUT     255,255