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

202 lines
1.5 KiB
Plaintext
Raw Normal View History

2019-05-15 21:47:08 +02:00
# The OS/K Team licences 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
sub r r
sub r i
sub r m
sub m r
sub m i
sub 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-16 18:45:00 +02:00
# rdx = rax % $0
# rax = rax / $0
2019-05-15 21:47:08 +02:00
div r
div i
inc r
inc m
dec r
dec 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-29 18:26:28 +02:00
loop r
loop i
2019-05-16 19:49:51 +02:00
jz r
jz i
jnz r
jnz i
je r
je i
jne r
jne i
ja r
ja i
jae r
jae i
jb r
jb i
jbe r
jbe i
2019-05-16 20:11:17 +02:00
jcxz
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
xchg r r
xchg r i
xchg r m
xchg m r
xchg m i
2019-05-16 18:45:00 +02:00
xchg m m
2019-05-16 19:49:51 +02:00
lea r m
lea m m
2019-05-29 16:57:22 +02:00
# get code segment
gcs r 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-29 16:57:22 +02:00
enter
leave
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-29 16:57:22 +02:00
# Prints a character on the screen
prn r
prn i
prn m