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/MISC

99 lines
2.0 KiB
Plaintext
Raw Normal View History

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.
2019-07-17 20:26:03 +02:00
#---------------------------------------------------------------------------#
# Debugging instructions #
#---------------------------------------------------------------------------#
#
# Breakpoint instruction (BREAK)
#
# (cause register dump on standard error)
# (wait for user input before proceeeding)
#
break
#
2019-07-17 22:40:13 +02:00
# Toggles instruction dumping (DUMP)
2019-07-17 20:26:03 +02:00
#
2019-07-17 22:40:13 +02:00
# (toggles instruction dumping)
2019-07-17 20:26:03 +02:00
#
2019-07-17 22:40:13 +02:00
dump
2019-07-17 20:26:03 +02:00
2019-06-23 12:40:18 +02:00
#---------------------------------------------------------------------------#
# Misc. instructions #
#---------------------------------------------------------------------------#
#
# Pause the CPU for a very short amount of time (PAUSE)
2019-07-18 22:49:31 +02:00
# Used in spin-type loops
2019-06-23 12:40:18 +02:00
#
pause
#
2019-07-18 22:49:31 +02:00
# Throw #OVF when RFX.OF=1 (INTO)
2019-06-23 12:40:18 +02:00
#
2019-07-18 22:49:31 +02:00
into
2019-06-23 12:40:18 +02:00
#
2019-07-18 22:49:31 +02:00
# Get timestamp in µseconds
2019-06-23 12:40:18 +02:00
#
2019-07-18 22:49:31 +02:00
utime r r
2019-06-23 12:40:18 +02:00
2019-07-11 18:34:21 +02:00
#
# $1 = seconds since start of month
# $2 = current month
# $3 = current year
#
ytime r r r
2019-06-23 12:40:18 +02:00
#
2019-07-10 17:17:45 +02:00
# Clear all GPR registers except RBP/RSP
2019-06-23 12:40:18 +02:00
#
2019-07-10 17:17:45 +02:00
cls
2019-06-23 12:40:18 +02:00
#---------------------------------------------------------------------------#
# Byte-wise / bit-wise manipulation instructions #
#---------------------------------------------------------------------------#
#
# Byte/word/dword swap (xSWAP)
#
# Change endianness
#
2019-07-04 20:33:49 +02:00
bswap r r
wswap r r
dswap r r
2019-06-23 12:40:18 +02:00
2019-07-17 20:26:03 +02:00
#---------------------------------------------------------------------------#
# I/O instructions #
#---------------------------------------------------------------------------#
#
# Send a character to standard output (PRN)
#
2019-07-18 22:49:31 +02:00
prn ri
2019-07-17 20:26:03 +02:00
#
# Print a string to standard output (PRN)
#
# COMPARE([%1], 0)
#
# IF (ZF == 0) THEN
# PRN([%1])
# IF (DF == 0) THEN
# %1 = %1 + 1
# ELSE
# %1 = %1 - 1
# FI
# FI
#
#
prns r
#
# Scan a character from standard input (SCAN)
#
scan r