Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
A
asmc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Giovanni Mascellani
asmc
Commits
ce21c72e
Unverified
Commit
ce21c72e
authored
Mar 10, 2019
by
Giovanni Mascellani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrite pop_var and pop_temps.
parent
d1cf23ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
17 deletions
+12
-17
asmg/asmg.asm
asmg/asmg.asm
+12
-17
No files found.
asmg/asmg.asm
View file @
ce21c72e
...
...
@@ -140,6 +140,7 @@ push_var_non_temp:
ret
;; Input in EAX (is temporary)
pop_var:
;; Check stack depth is positive and decrement it
cmp
DWORD
[
stack_depth
],
0
...
...
@@ -147,7 +148,7 @@ pop_var:
dec
DWORD
[
stack_depth
]
;; If this is a temp var...
cmp
DWORD
[
esp
+
4
]
,
0
cmp
eax
,
0
jne
pop_var_temp
ret
...
...
@@ -159,16 +160,16 @@ pop_var_temp:
ret
;; No input
;; Destroys: EAX
pop_temps:
;; Check for termination
mov
eax
,
temp_depth
cmp
DWORD
[
eax
],
0
cmp
DWORD
[
temp_depth
],
0
jna
pop_temps_ret
;; Call pop_var
push
1
mov
eax
,
1
call
pop_var
add
esp
,
4
jmp
pop_temps
...
...
@@ -610,9 +611,8 @@ push_expr_symbol_loop:
je
push_expr_symbol_loop_end
;; Call pop_var
push
1
mov
eax
,
1
call
pop_var
add
esp
,
4
;; Decrement arity and reloop
sub
esi
,
1
...
...
@@ -837,9 +837,8 @@ parse_block_ret:
jna
parse_block_ret_emit
mov
cl
,
0x58
; pop eax
call
emit
push
1
mov
eax
,
1
call
pop_var
add
esp
,
4
parse_block_ret_emit:
;; Emit code to unwind stack end return
...
...
@@ -862,9 +861,8 @@ parse_block_if:
mov
ebx
,
eax
;; Emit code to pop and possibly jump to else label
push
1
mov
eax
,
1
call
pop_var
add
esp
,
4
mov
ecx
,
0x00f88358
; pop eax; cmp eax, 0
call
emit32
mov
ecx
,
0x840f
; je ??
...
...
@@ -941,9 +939,8 @@ parse_block_while:
call
push_expr_until_brace
;; Emit code to pop and possibly jump to end label
push
1
mov
eax
,
1
call
pop_var
add
esp
,
4
mov
ecx
,
0x00f88358
; pop eax; cmp eax, 0
call
emit32
mov
ecx
,
0x840f
; je ??
...
...
@@ -1002,9 +999,8 @@ parse_block_call:
mov
ebx
,
eax
;; Call pop_var
push
1
mov
eax
,
1
call
pop_var
add
esp
,
4
;; Emit code to do the indirect call
mov
ecx
,
0xd0ff58
; pop eax; call eax
...
...
@@ -1024,9 +1020,8 @@ parse_block_call_loop:
je
parse_block_call_end
;; Pop a var
push
1
mov
eax
,
1
call
pop_var
add
esp
,
4
;; Decrement counter and reloop
sub
ebx
,
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment