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

213 lines
1.9 KiB
Plaintext
Raw Normal View History

2019-05-30 12:44:56 +02:00
# The OS/K Team licenses this file to you under the MIT license.
2019-05-15 21:56:42 +02:00
# See the LICENSE file in the project root for more information.
2019-05-15 21:47:08 +02:00
2019-05-22 18:39:46 +02:00
stop
2019-05-16 10:03:01 +02:00
nop
2019-05-16 18:45:00 +02:00
#
# Logical instructions
#
2019-06-02 16:33:28 +02:00
not rm
and rm rim
or rm rim
xor rm rim
shl rm rim
shr rm rim
cnotz rm
candz rm rim
corz rm rim
cxorz rm rim
cshlz rm rim
cshrz rm rim
cnotnz rm
candnz rm rim
cornz rm rim
cxornz rm rim
cshlnz rm rim
cshrnz rm rim
2019-05-30 20:27:11 +02:00
2019-05-16 18:45:00 +02:00
#
# Unsigned arithmetic instructions
#
2019-06-02 16:33:28 +02:00
# mul:
2019-05-16 18:45:00 +02:00
# rdx = hi(rax * $0)
# rax = lo(rax * $0)
2019-05-30 20:23:27 +02:00
2019-06-02 16:33:28 +02:00
# div:
2019-05-16 18:45:00 +02:00
# rdx = rax % $0
# rax = rax / $0
2019-06-02 16:33:28 +02:00
sgn rm rim
2019-06-05 22:11:45 +02:00
2019-06-02 16:33:28 +02:00
inc rm
dec rm
2019-06-05 22:11:45 +02:00
add rm rim
sub rm rim
mul rm rim
mul2 rim
div rm rim
div2 rim
mod rm rim
2019-06-02 16:33:28 +02:00
csgnz rm rim
caddz rm rim
csubz rm rim
cmulz rim
cdivz rim
cincz rm
cdecz rm
csgnnz rm rim
caddnz rm rim
csubnz rm rim
cmulnz rim
cdivnz rim
cincnz rm
cdecnz rm
2019-05-31 21:25:56 +02:00
2019-05-16 19:49:51 +02:00
#
# Comparison instruction
#
2019-06-02 16:33:28 +02:00
cmp rim rim
cmpb rim rim
cmpw rim rim
cmpl rim rim
cmpt rim rim
test rim rim
testb rim rim
testw rim rim
testl rim rim
testt rim rim
2019-05-16 19:49:51 +02:00
#
# Jump instructions
#
2019-06-02 16:33:28 +02:00
jmp ri
2019-05-16 19:49:51 +02:00
2019-06-02 16:33:28 +02:00
cjmpz ri
cjmpnz ri
2019-05-30 20:23:27 +02:00
2019-06-02 16:33:28 +02:00
cjmpa ri
cjmpae ri
2019-05-29 18:26:28 +02:00
2019-06-02 16:33:28 +02:00
cjmpb ri
cjmpbe ri
2019-05-16 19:49:51 +02:00
2019-06-02 16:33:28 +02:00
jcxz ri
jcxnz ri
2019-05-30 20:23:27 +02:00
2019-06-02 16:33:28 +02:00
loop ri
cloopz ri
cloopnz ri
2019-05-16 19:49:51 +02:00
2019-05-16 18:45:00 +02:00
#
# Movement instructions
#
2019-06-02 16:33:28 +02:00
lea rm m
mov rm rim
xchg rm rim
cmpxchg rm rim
cleaz rm m
cmovz rm rim
cxchgz rm rim
ccmpxchgz rm rim
cleanz rm m
cmovnz rm rim
cxchgnz rm rim
ccmpxchgnz rm rim
2019-06-04 19:28:34 +02:00
movb rm rim
movw rm rim
movl rm rim
movt rm rim
cmovbz rm rim
cmovwz rm rim
cmovlz rm rim
cmovtz rm rim
cmovbnz rm rim
cmovwnz rm rim
cmovlnz rm rim
cmovtnz rm rim
2019-05-30 20:23:27 +02:00
2019-05-16 18:45:00 +02:00
#
# Stack manipulation instructions
#
2019-05-16 16:48:45 +02:00
2019-06-02 16:33:28 +02:00
push rim
call rim
pop rm
2019-05-16 17:11:22 +02:00
ret
2019-06-02 16:33:28 +02:00
cpushz rim
ccallz rim
cpopz rm
2019-05-30 20:23:27 +02:00
cretz
2019-06-02 16:33:28 +02:00
cpushnz rim
ccallnz rim
cpopnz rm
2019-05-30 20:23:27 +02:00
cretnz
2019-05-16 17:11:22 +02:00
2019-05-29 22:27:49 +02:00
# push rbp
# mov rbp, rsp
2019-05-29 16:57:22 +02:00
enter
2019-05-29 22:27:49 +02:00
# add rsp, 8
2019-06-02 16:35:46 +02:00
# mov rbp, [rsp]
2019-05-29 16:57:22 +02:00
leave
2019-05-30 20:23:27 +02:00
cleavez
cleavenz
2019-05-29 16:57:22 +02:00
2019-05-16 19:49:51 +02:00
pushf
2019-05-16 18:45:00 +02:00
#
# Supervisor only instructions
#
2019-05-16 19:49:51 +02:00
popf
2019-05-16 16:48:45 +02:00
cli
sti
2019-05-15 21:47:08 +02:00
2019-06-05 19:31:48 +02:00
devctl rim rim
iocall rim rim
2019-05-30 13:25:30 +02:00
#
# Misc. instructions
#
2019-06-05 22:11:45 +02:00
# Clear rax...rsi
clr
# Clear ax0...ax7
cla
# Clear nx0...nx7
cln
# Print a character on the screen
2019-06-02 16:33:28 +02:00
prn rim
2019-05-29 16:57:22 +02:00
2019-05-30 13:25:30 +02:00
#
# Debugging instructions
#
break
2019-05-30 20:27:49 +02:00
cbreakz
cbreaknz
2019-05-30 13:25:30 +02:00