summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKathy Gray2015-06-16 17:05:16 +0100
committerKathy Gray2015-06-16 17:05:16 +0100
commite514087d97ec10618248f04ebc07be57d2d75acd (patch)
treef58f679fe748a9a16b36e8f3217f5af68a4b9946 /src
parent8e84dc526366d3db615d9f5e7e166ae59dd9ff80 (diff)
Incorporate comments from Peter.
Add a flag type for endian, not used yet
Diffstat (limited to 'src')
-rw-r--r--src/lem_interp/interp_interface.lem23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/lem_interp/interp_interface.lem b/src/lem_interp/interp_interface.lem
index d2684553..374f633e 100644
--- a/src/lem_interp/interp_interface.lem
+++ b/src/lem_interp/interp_interface.lem
@@ -53,6 +53,10 @@ type direction =
| D_increasing
| D_decreasing
+type end_flag =
+ | E_big_endian
+ | E_little_endian
+
type register_value = <|
rv_bits: list bit_lifted (* MSB first, smallest index number *);
rv_dir: direction;
@@ -62,17 +66,30 @@ type register_value = <|
Otherwise, tells interpreter how to reconstruct a proper decreasing value*)
|>
-type byte_lifted = Byte_lifted of list bit_lifted (* of length 8 *)
+type byte_lifted = Byte_lifted of list bit_lifted (* of length 8 *) (*MSB first everywhere*)
type instruction_field_value = list bit
-type byte = Byte of list bit (* of length 8 *) (*MSB first*)
+type byte = Byte of list bit (* of length 8 *) (*MSB first everywhere*)
type address_lifted = Address_lifted of list byte_lifted (* of length 8 for 64bit machines*) * maybe integer
type memory_byte = byte_lifted
-type memory_value = list memory_byte (* the head of the list, most-significant first, at the lowest address, of length >=1 *)
+type memory_value = list memory_byte
+(* the list is of length >=1 *)
+(* for both big-endian (Power) and little-endian (ARM), the head of the
+ list is the byte stored at the lowest address *)
+(* for big-endian Power the head of the list is the most-significant
+ byte, in both the interpreter and machineDef* code. *)
+(* For little-endian ARM, the head of the list is the
+ least-significant byte in machineDef* code and the
+ most-significant byte in interpreter code, with the switch over
+ (a list-reverse) being done just inside the interpreter interface*)
+(* In other words, in the machineDef* code the lowest-address byte is first,
+ and in the interpreter code the most-significant byte is first *)
+
+
(* not sure which of these is more handy yet *)
type address = Address of list byte (* of length 8 *) * integer