]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/contribs/assembly/parser/test1.cm
- Added new output in standard C.
[helm.git] / helm / software / matita / contribs / assembly / parser / test1.cm
diff --git a/helm/software/matita/contribs/assembly/parser/test1.cm b/helm/software/matita/contribs/assembly/parser/test1.cm
new file mode 100644 (file)
index 0000000..a53a879
--- /dev/null
@@ -0,0 +1,42 @@
+#define u1 struct { byte; word; }\r
+#define u2 struct { word; byte; }\r
+#define u3 struct { array[2] of u1; array[3] of u2; }\r
+#define u4 struct { array[3] of u1; array[2] of u2; }\r
+#define u5 struct { dword; u3; u4; array[5] of word; }\r
+\r
+{\r
+       u5 var5;\r
+       byte index=0x00;\r
+\r
+       while(index<0x02)\r
+               {\r
+               const array[4] of u1 const1=[{0x00,0x0000},{0x01,0x0001},{0x02,0x0002},{0x03,0x0003}];\r
+               const array[4] of u2 const2=[{0x0000,0x00},{0x0001,0x01},{0x0002,0x02},{0x0003,0x03}];\r
+\r
+               var5.1.0[index].0=const1[index].0+(index*0x03);\r
+               var5.1.0[index].1=const1[index].1*(b2w(index)-0x1234);\r
+               var5.2.1[index].0=const1[index].1&(b2w(index)/0xABCD);\r
+               var5.2.1[index].1=const1[index].0^(!index);\r
+\r
+               if(index!=0x00)\r
+                       {\r
+                       dword tmp=0x1234FEDC;\r
+\r
+                       var5.0=tmp;\r
+                       }\r
+               elsif(index==0x01)\r
+                       {\r
+                       array[7] of array[8] of array [9] of byte tmp;\r
+\r
+                       tmp[0x02][0x01][0x00]=index;\r
+                       }\r
+               else\r
+                       {\r
+                       array[10] of u5 tmp;\r
+\r
+                       tmp[0x00].0=var5.0;\r
+                       }\r
+\r
+               index=index+0x01;\r
+               }\r
+}\r