diff ppc/mach.ml @ 0:bfdcc3820b32

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 05 Oct 2017 08:04:15 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ppc/mach.ml	Thu Oct 05 08:04:15 2017 +0100
@@ -0,0 +1,35 @@
+(* ppc/mach.ml *)
+(* Copyright (c) 2017 J. M. Spivey *)
+
+(* |metrics| -- target representation of data object *)
+type metrics = 
+  { r_size: int;                (* Size of object *)
+    r_align: int }              (* Address must be multiple of this *)
+
+let int_rep = { r_size = 4; r_align = 4 }
+let char_rep = { r_size = 1; r_align = 1 }
+let bool_rep = { r_size = 1; r_align = 1 }
+let void_rep = { r_size = 0; r_align = 1 }
+let addr_rep = { r_size = 4; r_align = 4 }
+let proc_rep = { r_size = 8; r_align = 4 }
+let param_rep = { r_size = 4; r_align = 4 }
+let max_align = 4
+
+(* 
+Frame layout:
+
+        arg n
+        ...
++16     arg 1
++12     static link     }
+        context pointer }
+        return address  }
+bp:     dynamic link    }
+        local 1
+        ...
+        local m
+*)
+
+let param_base = 16
+let local_base = 0
+let stat_link = 12