aboutsummaryrefslogtreecommitdiff
path: root/compiler/elymasGlobalSys.ey
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2013-08-28 14:29:13 +0200
committerDrahflow <drahflow@gmx.de>2013-08-28 14:29:13 +0200
commitfdd6dbf870747bd02f3a3ce6523dcc2c32880acb (patch)
tree80ed68cb37e61bd2d123c61f2f20f6d41ae63e22 /compiler/elymasGlobalSys.ey
parent4ed0f87a556e13d9394345727700e6440bd3b6f4 (diff)
More functions in the library
Diffstat (limited to 'compiler/elymasGlobalSys.ey')
-rw-r--r--compiler/elymasGlobalSys.ey16
1 files changed, 15 insertions, 1 deletions
diff --git a/compiler/elymasGlobalSys.ey b/compiler/elymasGlobalSys.ey
index 01ca564..2f2b763 100644
--- a/compiler/elymasGlobalSys.ey
+++ b/compiler/elymasGlobalSys.ey
@@ -3,14 +3,28 @@
<
# handle an identifier in the current scope according to current quote level
- # 0 -> identifier to handle
+ # 0 -> scope to execute identifier in
+ # 1 -> identifier to handle
+ # 0 <- scope after execution
[[
8 /r15 :subqImm8Reg
/r15 :popqMem
+
+ ::currentScope /rax :movqImmReg
+ 8 /r15 :subqImm8Reg
+ /rax /rcx :movqMemReg
+ /rcx /r15 :movqRegMem
+ /rax :popqMem # load scope from argument
internalExecuteIdentifier /rax :movqImmReg
/rax :callqReg
+ ::currentScope /rax :movqImmReg
+ /rax :pushqMem
+ /r15 /rcx :movqMemReg
+ /rcx /rax :movqRegMem # restore old scope
+ 8 /r15 :addqImm8Reg
+
/r15 :pushqMem
8 /r15 :addqImm8Reg
:retn