[bits 16]
[org 0]
start:
	mov ax,cs
	mov ds,ax
	mov es,ax
	pusha
	push sp
	push word 0
[bits 32]
	pop dword esp
	mov ebp,esp

	mov edx,dword 0
again:
	call function
	add edx,dword 1
	mov eax,edx
	cmp eax,dword 0xFFFFFFFFFFFFFFFF 
	je the_end
	jmp again

the_end:
[bits 16]
	popa
	jmp 0x1000:0

[bits 32]
function:
	push ebp
	mov ebp,esp
	pusha

[bits 16]
        mov ah,03
        mov bh,0
        int 10h

	call print

[bits 32]
	popa 
	mov esp,ebp
	leave
	ret

[bits 16]

print:
        push bp
        mov bp,sp
        mov si,msg
        again2:
        mov al,[si]
        mov ah,0eh
        int 10h
        inc si
        mov al,[si]
        cmp al,0
        je endit
        jmp again2
        endit:
        mov sp,bp
        pop bp
        ret

msg db "Hello, World!",10,13

