1
0
mirror of https://gitlab.os-k.eu/os-k-team/kvisc.git synced 2023-08-25 14:05:46 +02:00
kvisc/ka/main.k
2019-06-13 15:00:48 +02:00

106 lines
1.3 KiB
Plaintext

; The OS/K Team licenses this file to you under the MIT license.
; See the LICENSE file in the project root for more information.
;
; Main function
;
main:
enter 1
mov q[rsp], 0xFABC1234CCCCDDDD
mov rax, b[rsp]
mov rbx, w[rsp]
mov rcx, l[rsp]
mov rdx, q[rsp]
movzx rsx, b[rsp]
movzx rbi, w[rsp]
movzx rdi, l[rsp]
movzx rsi, q[rsp]
leave
ret
itoa_test:
mov ax0, .buf
mov ax1, -9223372036854775807
mov ax2, 10
call itoa
mov ax0, rax
call print
prn 10
mov ax0, .buf
mov ax1, 0xfff85ffffffffff4
mov ax2, 16
call itoa
mov ax0, rax
call print
mov rsi, 0x10
mov rdi, 8
lea rbi, b[rdi + rsi * 2 + 1]
ret
.buf = [32]
devtest:
enter
mov ax0, .buf
devctl 0, 1
mov ax0, .buf
call print
iocall 0, 0
leave
ret
.buf = [32]
strtest:
enter
mov ax0, .msg
call print
mov ax0, .buf
mov ax1, .msg
mov ax2, 5
call strnzcpy
prn 10
mov ax0, .buf
mov ax1, 10
call print_n
mov ax0, .buf
mov ax1, .msg
call strcmp
leave
ret
.msg = "HelloWorld :)"
.buf = [32]
;
; Exit function
;
exit:
enter
mov ax0, .msg
call print
leave
ret
.msg = "Goodbye World :(\n"