From 68e4b4a947a95a965381457c2dc80bef05f8f58a Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Fri, 28 Sep 2018 10:00:28 -0400 Subject: [PATCH] Define MIPS word size --- compiler/src/lib/tiger/tiger_frame_sig.ml | 2 ++ compiler/src/lib/tiger/tiger_mips_frame.ml | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/compiler/src/lib/tiger/tiger_frame_sig.ml b/compiler/src/lib/tiger/tiger_frame_sig.ml index b9b3c77..2da5d57 100644 --- a/compiler/src/lib/tiger/tiger_frame_sig.ml +++ b/compiler/src/lib/tiger/tiger_frame_sig.ml @@ -3,6 +3,8 @@ module type S = sig type access + val word_size : int + val make : name:Tiger_temp.Label.t -> formals:bool list -> t diff --git a/compiler/src/lib/tiger/tiger_mips_frame.ml b/compiler/src/lib/tiger/tiger_mips_frame.ml index 99918d5..4131702 100644 --- a/compiler/src/lib/tiger/tiger_mips_frame.ml +++ b/compiler/src/lib/tiger/tiger_mips_frame.ml @@ -19,6 +19,10 @@ type t = ; instructions : unit (* TODO: instructions for view shift *) } +let word_size_bits = 32 +let word_size_bytes = word_size_bits / 8 +let word_size = word_size_bytes + let name {name; _} = name -- 2.20.1