1
0
mirror of https://gitlab.os-k.eu/os-k-team/kvisc.git synced 2023-08-25 14:05:46 +02:00
kvisc/vm/in/STACK
julianb0 a42786831f
vm
2019-07-04 20:33:49 +02:00

56 lines
854 B
Plaintext

# The OS/K Team licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
#---------------------------------------------------------------------------#
# Stack manipulation instructions #
#---------------------------------------------------------------------------#
#
# Unconditional jump with possible return (CALL)
#
# PUSH(RIP)
# JMP(RIP)
#
call ri
#
# Return to caller (RET)
#
# POP(RIP)
#
ret
#
# Make new stack frame (ENTER)
#
# PUSH(RBP)
# RBP = RSP
# RSP = RSP - $1
#
enter i
#
# Leave stack frame (LEAVE)
#
# RSP = RBP
# POP(RBP)
#
leave
#
# PUSH value onto stack
#
# RSP = RSP - 8
# *RSP = $1
#
push ri
#
# POP value from stack
#
# $1 = *RSP
# RSP = RSP + 8
#
pop r