From: Siraaj Khandkar Date: Fri, 28 Sep 2018 14:00:28 +0000 (-0400) Subject: Define MIPS word size X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=68e4b4a947a95a965381457c2dc80bef05f8f58a;p=tiger.ml.git Define MIPS word size --- 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