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

104 lines
2.1 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 #
#---------------------------------------------------------------------------#
2019-08-06 22:47:39 +02:00
#
# Throws #UDF ("undefined behaviour")
#
udf
2019-06-23 12:40:18 +02:00
#
# 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-08-03 17:41:44 +02:00
utime 2
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
#
2019-08-03 17:41:44 +02:00
ytime 3
2019-07-11 18:34:21 +02:00
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-08-03 17:41:44 +02:00
bswap 2
wswap 2
dswap 2
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-08-03 17:41:44 +02:00
prn 1
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
#
#
2019-08-03 17:41:44 +02:00
prns 1
2019-07-17 20:26:03 +02:00
#
# Scan a character from standard input (SCAN)
#
2019-08-03 17:41:44 +02:00
scan 1
2019-07-17 20:26:03 +02:00