From f84fca3b169d808943b5f329c177870dc87c1d51 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sat, 28 Jan 2023 12:48:43 +0100 Subject: Add stack simulator for compilation --- snug-clean/src/Snug/Compile/ABI.dcl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 snug-clean/src/Snug/Compile/ABI.dcl (limited to 'snug-clean/src/Snug/Compile/ABI.dcl') diff --git a/snug-clean/src/Snug/Compile/ABI.dcl b/snug-clean/src/Snug/Compile/ABI.dcl new file mode 100644 index 0000000..938a65e --- /dev/null +++ b/snug-clean/src/Snug/Compile/ABI.dcl @@ -0,0 +1,21 @@ +definition module Snug.Compile.ABI + +from MIPS.MIPS32 import :: Label, :: Register(GP,S,T) +from Snug.Compile import :: Namespace +from Snug.Syntax import :: ConstructorIdent, :: SymbolIdent + +:: EntryPoint + = NodeEntry + +BackPrintPtr :== S 0 +FrontPrintPtr :== S 1 + +BackEvalPtr :== S 2 +FrontEvalPtr :== S 3 + +HeapPtr :== GP + +TempImm :== T 0 + +constructorLabel :: !Namespace !ConstructorIdent -> Label +functionLabel :: !Namespace !EntryPoint !SymbolIdent -> Label -- cgit v1.2.3