]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/assembly/parser/test1.cm
Preparing for 0.5.9 release.
[helm.git] / helm / software / matita / contribs / assembly / parser / test1.cm
1 #define u1 struct { byte; word; }\r
2 #define u2 struct { word; byte; }\r
3 #define u3 struct { array[2] of u1; array[3] of u2; }\r
4 #define u4 struct { array[3] of u1; array[2] of u2; }\r
5 #define u5 struct { dword; u3; u4; array[5] of word; }\r
6 \r
7 {\r
8         u5 var5;\r
9         byte index=0x00;\r
10 \r
11         while(index<0x02)\r
12                 {\r
13                 const array[4] of u1 const1=[{0x00,0x0000},{0x01,0x0001},{0x02,0x0002},{0x03,0x0003}];\r
14                 const array[4] of u2 const2=[{0x0000,0x00},{0x0001,0x01},{0x0002,0x02},{0x0003,0x03}];\r
15 \r
16                 var5.1.0[index].0=const1[index].0+(index*0x03);\r
17                 var5.1.0[index].1=const1[index].1*(b2w(index)-0x1234);\r
18                 var5.2.1[index].0=const1[index].1&(b2w(index)/0xABCD);\r
19                 var5.2.1[index].1=const1[index].0^(!index);\r
20 \r
21                 if(index!=0x00)\r
22                         {\r
23                         dword tmp=0x1234FEDC;\r
24 \r
25                         var5.0=tmp;\r
26                         }\r
27                 elsif(index==0x01)\r
28                         {\r
29                         array[7] of array[8] of array [9] of byte tmp;\r
30 \r
31                         tmp[0x02][0x01][0x00]=index;\r
32                         }\r
33                 else\r
34                         {\r
35                         array[10] of u5 tmp;\r
36 \r
37                         tmp[0x00].0=var5.0;\r
38                         }\r
39 \r
40                 index=index+0x01;\r
41                 }\r
42 }\r