[Bits 16]

[ORG 0x7E00]

jmp 0x0000:stage2

column dw 0
row dw 0
string db "Hello, World!", 0
string2 db "Next test in progress...",0
done db "All test sucessfull!",0


stage2:
	mov ax, 0x0000
	mov ds, ax
	mov es, ax
	mov fs, ax
	mov gs, ax
	cli
	mov ss,ax
	mov sp,0x9000
	sti

mov ax,0x0002	; Clear the screen
int 0x10	

mov si,string 
call printk
mov si,string2
call printk
mov si,done
call printk
cli
hlt

printk:
	mov ax,0xb800
	mov es,ax
	call printchar
	ret

printchar:
	mov di,[row]
	mov al,[si]
	cmp al,0
	jz finished
	mov [es:di],al
	mov bx,[row]
	inc bx
	inc bx
	mov [row],bx
	inc si
	jmp printchar

finished:
	call nextline
	ret

nextline:
	xor ax,ax
	mov ax,[column]
	inc ax
	mov [column],ax
	mov bx,[row]
	xor bx,bx
	mov cx,160
	mul cx
	mov [row],ax
	ret
	
	
