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

308 lines
2.4 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
and r r
and r i
and r m
and m r
and m i
and m m
or r r
or r i
or r m
or m r
or m i
or m m
xor r r
xor r i
xor r m
xor m r
xor m i
xor m m
# shift left logical
shl r r
shl r i
shl r m
shl m r
shl m i
shl m m
# shift right logical
shr r r
shr r i
shr r m
shr m r
shr m i
shr m m
#
# 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-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-16 16:48:45 +02:00
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-16 16:57:59 +02:00
pop r
2019-05-29 16:57:22 +02:00
pop m
2019-05-16 16:57:59 +02:00
2019-05-16 17:11:22 +02:00
call r
call i
call m
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