1
0
mirror of https://gitlab.os-k.eu/os-k-team/kvisc.git synced 2023-08-25 14:05:46 +02:00
kvisc/pc/instrs/INSTRS

405 lines
3.3 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
#
not r
not m
2019-05-30 20:27:11 +02:00
cnotz r
cnotz m
cnotnz r
cnotnz m
2019-05-16 18:45:00 +02:00
and r r
and r i
and r m
and m r
and m i
and m m
2019-05-30 20:27:11 +02:00
candz r r
candz r i
candz r m
candz m r
candz m i
candz m m
candnz r r
candnz r i
candnz r m
candnz m r
candnz m i
candnz m m
2019-05-16 18:45:00 +02:00
or r r
or r i
or r m
or m r
or m i
or m m
2019-05-30 20:27:11 +02:00
corz r r
corz r i
corz r m
corz m r
corz m i
corz m m
cornz r r
cornz r i
cornz r m
cornz m r
cornz m i
cornz m m
2019-05-16 18:45:00 +02:00
xor r r
xor r i
xor r m
xor m r
xor m i
xor m m
2019-05-30 20:27:11 +02:00
cxorz r r
cxorz r i
cxorz r m
cxorz m r
cxorz m i
cxorz m m
cxornz r r
cxornz r i
cxornz r m
cxornz m r
cxornz m i
cxornz m m
2019-05-16 18:45:00 +02:00
# shift left logical
shl r r
shl r i
shl r m
shl m r
shl m i
shl m m
2019-05-30 20:27:11 +02:00
cshlz r r
cshlz r i
cshlz r m
cshlz m r
cshlz m i
cshlz m m
cshlnz r r
cshlnz r i
cshlnz r m
cshlnz m r
cshlnz m i
cshlnz m m
2019-05-16 18:45:00 +02:00
# shift right logical
shr r r
shr r i
shr r m
shr m r
shr m i
shr m m
2019-05-30 20:27:11 +02:00
cshrz r r
cshrz r i
cshrz r m
cshrz m r
cshrz m i
cshrz m m
cshrnz r r
cshrnz r i
cshrnz r m
cshrnz m r
cshrnz m i
cshrnz m m
2019-05-16 18:45:00 +02:00
#
# Unsigned arithmetic instructions
#
2019-05-15 21:47:08 +02:00
add r r
add r i
add r m
add m r
add m i
add m m
2019-05-30 20:23:27 +02:00
caddz r r
caddz r i
caddz r m
caddz m r
caddz m i
caddz m m
caddnz r r
caddnz r i
caddnz r m
caddnz m r
caddnz m i
caddnz m m
2019-05-15 21:47:08 +02:00
sub r r
sub r i
sub r m
sub m r
sub m i
sub m m
2019-05-30 20:23:27 +02:00
csubz r r
csubz r i
csubz r m
csubz m r
csubz m i
csubz m m
csubnz r r
csubnz r i
csubnz r m
csubnz m r
csubnz m i
csubnz m m
2019-05-16 18:45:00 +02:00
# rdx = hi(rax * $0)
# rax = lo(rax * $0)
2019-05-15 21:47:08 +02:00
mul r
mul i
2019-05-30 20:23:27 +02:00
cmulz r
cmulz i
cmulnz r
cmulnz i
2019-05-16 18:45:00 +02:00
# rdx = rax % $0
# rax = rax / $0
2019-05-15 21:47:08 +02:00
div r
div i
2019-05-30 20:23:27 +02:00
cdivz r
cdivz i
cdivnz r
cdivnz i
2019-05-15 21:47:08 +02:00
inc r
inc m
2019-05-30 20:23:27 +02:00
cincz r
cincz m
cincnz r
cincnz m
2019-05-15 21:47:08 +02:00
dec r
dec m
2019-05-30 20:23:27 +02:00
cdecz r
cdecz m
cdecnz r
cdecnz m
2019-05-31 21:25:56 +02:00
sgn r r
sgn r i
sgn r m
sgn m r
sgn m i
sgn m m
csgnz r r
csgnz r i
csgnz r m
csgnz m r
csgnz m i
csgnz m m
csgnnz r r
csgnnz r i
csgnnz r m
csgnnz m r
csgnnz m i
csgnnz m m
2019-05-16 19:49:51 +02:00
#
# Comparison instruction
#
# Affects ZF and CF
cmp r r
cmp r i
cmp r m
cmp i r
cmp i i
cmp i m
cmp m r
cmp m i
cmp m m
# Only affects ZF
test r r
test r i
test r m
test i r
test i i
test i m
test m r
test m i
test m m
#
# Jump instructions
#
jmp r
jmp i
2019-05-30 20:23:27 +02:00
cjmpz r
cjmpz i
cjmpnz r
cjmpnz i
cjmpa r
cjmpa i
cjmpae r
cjmpae i
2019-05-29 18:26:28 +02:00
2019-05-30 20:23:27 +02:00
cjmpb r
cjmpb i
cjmpbe r
cjmpbe i
2019-05-16 19:49:51 +02:00
2019-05-30 18:31:50 +02:00
jcxz r
jcxz i
2019-05-30 20:23:27 +02:00
jcxnz r
jcxnz i
loop r
loop i
cloopz r
cloopz i
cloopnz r
cloopnz i
2019-05-16 19:49:51 +02:00
2019-05-16 18:45:00 +02:00
#
# Movement instructions
#
2019-05-15 21:47:08 +02:00
mov r r
mov r i
mov r m
mov m r
mov m i
2019-05-16 18:45:00 +02:00
mov m m
2019-05-30 18:31:50 +02:00
cmovz r r
cmovz r i
cmovz r m
cmovz m r
cmovz m i
cmovz m m
cmovnz r r
cmovnz r i
cmovnz r m
cmovnz m r
cmovnz m i
cmovnz m m
2019-05-30 20:23:27 +02:00
xchg r r
xchg r i
xchg r m
xchg m r
xchg m i
xchg m m
cxchgz r r
cxchgz r i
cxchgz r m
cxchgz m r
cxchgz m i
cxchgz m m
cxchgnz r r
cxchgnz r i
cxchgnz r m
cxchgnz m r
cxchgnz m i
cxchgnz m m
lea r m
lea m m
cleaz r m
cleaz m m
cleanz r m
cleanz m m
2019-05-16 18:45:00 +02:00
#
# Stack manipulation instructions
#
2019-05-16 16:48:45 +02:00
2019-05-16 16:57:59 +02:00
push i
push r
2019-05-29 16:57:22 +02:00
push m
2019-05-30 20:32:52 +02:00
cpushz i
cpushz r
cpushz m
cpushnz i
cpushnz r
cpushnz m
2019-05-16 16:57:59 +02:00
pop r
2019-05-29 16:57:22 +02:00
pop m
2019-05-30 20:32:52 +02:00
cpopz r
cpopz m
cpopnz r
cpopnz m
2019-05-16 16:57:59 +02:00
2019-05-16 17:11:22 +02:00
call r
call i
call m
2019-05-30 20:32:52 +02:00
ccallz r
ccallz i
ccallz m
ccallnz r
ccallnz i
ccallnz m
2019-05-16 17:11:22 +02:00
ret
2019-05-30 20:23:27 +02:00
cretz
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
# mov rbp, [rsp+8]
# add rsp, 8
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-05-30 13:25:30 +02:00
#
# Misc. instructions
#
2019-05-29 16:57:22 +02:00
# Prints a character on the screen
prn r
prn i
prn m
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