kvisc/os/dos.k

57 lines
665 B
Plaintext

; The OS/K Team licences this file to you under the MIT license.
; See the LICENSE file in the project root for more information.
hw = "Hello World\n:)"
;
; Entry point
;
main:
; Initializes the stack
mov rbp, 0x200000
mov rsp, rbp
mov ax0, hw
call print
stop
;
; Max amount of characters that print() will print
;
v_print_max := 0xFF
;
; Print a string
;
print:
enter
mov rcx, v_print_max
.1:
test b[ax0], b[ax0]
jz .2
prn b[ax0]
inc ax0
loop .1
.2:
leave
ret
;
; Print exactly ax1 characters
;
print_n:
enter
mov rcx, ax1
.1:
prn b[ax0]
inc ax0
loop .1
leave
ret