kvisc/vm/in/MISC

88 lines
1.5 KiB
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.
#---------------------------------------------------------------------------#
# Misc. instructions #
#---------------------------------------------------------------------------#
#
# Do nothing (NOOP)
#
# (nothing)
#
# Throws:
# (nothing)
#
# Preserves all flags
#
nop
#
# Pause the CPU for a very short amount of time (PAUSE)
# Used in spin-like loops
#
pause
#
# Pause the CPU for a relatively long time (XPAUSE)
#
# Throws:
# #SYS if not in supervisor mode
#
xpause
#
# Get timestamp in seconds
#
time r
#
# Get timestamp in µseconds
#
utime r
#
# CPU Identification Number
#
# Does nothing (for now)
#
cpuid
#---------------------------------------------------------------------------#
# Clean-up misc. instructions #
#---------------------------------------------------------------------------#
#
# Clear all GPR registers except RBP/RSP
#
cls
#
# Clear base registers except RBP/RSP (CLR)
#
clr
#
# Clear argument registers (CLA)
#
cla
#
# Clear nonvolatile registers (CLN)
#
cln
#---------------------------------------------------------------------------#
# Byte-wise / bit-wise manipulation instructions #
#---------------------------------------------------------------------------#
#
# Byte/word/dword swap (xSWAP)
#
# Change endianness
#
bswap r r
wswap r r
dswap r r