aboutsummaryrefslogtreecommitdiff
path: root/compiler/elymasGlobalSysAsm.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/elymasGlobalSysAsm.ey
parent4ed0f87a556e13d9394345727700e6440bd3b6f4 (diff)
More functions in the library
Diffstat (limited to 'compiler/elymasGlobalSysAsm.ey')
-rw-r--r--compiler/elymasGlobalSysAsm.ey17
1 files changed, 17 insertions, 0 deletions
diff --git a/compiler/elymasGlobalSysAsm.ey b/compiler/elymasGlobalSysAsm.ey
index 425bada..8a5499c 100644
--- a/compiler/elymasGlobalSysAsm.ey
+++ b/compiler/elymasGlobalSysAsm.ey
@@ -183,6 +183,23 @@
:retn
]] /eyglobalAllocSize defv
+ # get raw object address from object
+ # 0 -> object
+ # 0 <- address of the object
+ [[
+ /rbx :popqReg
+
+ # allocate return integer
+ ::internalAllocateInteger /rax :movqImmReg
+ /rax :callqReg
+
+ 8 /rax :popqMemDisp8
+ /rax :pushqReg
+
+ /rbx :pushqReg
+ :retn
+ ]] /eyrawAddress defv
+
# get raw code execution address from function object
# 0 -> function object
# 0 <- address of first instruction