2019-06-23 12:40:18 +02:00
|
|
|
# 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)
|
|
|
|
#
|
2019-07-04 20:33:49 +02:00
|
|
|
call ri
|
2019-06-23 12:40:18 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
#
|
2019-07-04 20:33:49 +02:00
|
|
|
push ri
|
2019-06-23 12:40:18 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# POP value from stack
|
|
|
|
#
|
|
|
|
# $1 = *RSP
|
|
|
|
# RSP = RSP + 8
|
|
|
|
#
|
2019-07-04 20:33:49 +02:00
|
|
|
pop r
|
2019-06-23 12:40:18 +02:00
|
|
|
|