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-06 14:57:34 +02:00
|
|
|
!not rm
|
|
|
|
!or rm rim
|
2019-06-06 22:07:34 +02:00
|
|
|
!and rm rim
|
2019-06-06 14:57:34 +02:00
|
|
|
!xor rm rim
|
|
|
|
!shl rm rim
|
|
|
|
!shr rm rim
|
2019-05-30 20:27:11 +02:00
|
|
|
|
2019-05-16 18:45:00 +02:00
|
|
|
#
|
|
|
|
# Unsigned arithmetic instructions
|
|
|
|
#
|
|
|
|
|
2019-06-06 22:07:34 +02:00
|
|
|
!neg rm
|
2019-06-06 14:57:34 +02:00
|
|
|
!inc rm
|
|
|
|
!dec rm
|
|
|
|
!add rm rim
|
|
|
|
!sub rm rim
|
|
|
|
!mul rm rim
|
|
|
|
!div rm rim
|
|
|
|
!mod rm rim
|
|
|
|
!sgn rm rim
|
|
|
|
|
2019-05-16 18:45:00 +02:00
|
|
|
# rdx = hi(rax * $0)
|
|
|
|
# rax = lo(rax * $0)
|
2019-06-06 22:07:34 +02:00
|
|
|
mul2 rim
|
2019-05-30 20:23:27 +02:00
|
|
|
|
2019-05-16 18:45:00 +02:00
|
|
|
# rdx = rax % $0
|
|
|
|
# rax = rax / $0
|
2019-06-06 22:07:34 +02:00
|
|
|
div2 rim
|
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
|
2019-06-06 22:07:34 +02:00
|
|
|
#cmpb rim rim
|
|
|
|
#cmpw rim rim
|
|
|
|
#cmpl rim rim
|
|
|
|
#cmpt rim rim
|
2019-06-02 16:33:28 +02:00
|
|
|
|
|
|
|
test rim rim
|
2019-06-06 22:07:34 +02:00
|
|
|
#testb rim rim
|
|
|
|
#testw rim rim
|
|
|
|
#testl rim rim
|
|
|
|
#testt rim rim
|
2019-05-16 19:49:51 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Jump instructions
|
|
|
|
#
|
|
|
|
|
2019-06-06 22:07:34 +02:00
|
|
|
!j ri
|
2019-06-06 14:57:34 +02:00
|
|
|
!jmp ri
|
|
|
|
!loop ri
|
2019-05-16 19:49:51 +02:00
|
|
|
|
2019-05-16 18:45:00 +02:00
|
|
|
#
|
|
|
|
# Movement instructions
|
|
|
|
#
|
|
|
|
|
2019-06-06 14:57:34 +02:00
|
|
|
!lea rm m
|
|
|
|
!mov rm rim
|
|
|
|
!xchg rm rim
|
2019-06-06 22:07:34 +02:00
|
|
|
cmpxchg rm rim
|
2019-06-04 19:28:34 +02:00
|
|
|
|
2019-06-06 22:07:34 +02:00
|
|
|
movb rm rim
|
|
|
|
movw rm rim
|
|
|
|
movl rm rim
|
|
|
|
movt 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-06 14:57:34 +02:00
|
|
|
!push rim
|
|
|
|
!call rim
|
|
|
|
!pop rm
|
|
|
|
!ret
|
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-06-06 14:57:34 +02:00
|
|
|
!leave
|
2019-05-29 16:57:22 +02:00
|
|
|
|
2019-05-16 19:49:51 +02:00
|
|
|
pushf
|
2019-06-06 14:57:34 +02:00
|
|
|
popf
|
2019-05-16 19:49:51 +02:00
|
|
|
|
2019-05-16 18:45:00 +02:00
|
|
|
#
|
|
|
|
# Supervisor only instructions
|
|
|
|
#
|
|
|
|
|
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
|
|
|
|
#
|
2019-06-06 14:57:34 +02:00
|
|
|
!break
|
2019-05-30 13:25:30 +02:00
|
|
|
|
2019-06-05 22:59:32 +02:00
|
|
|
step rim
|
|
|
|
|