; =======================================
;
; LINKED PROGRAM EXAMPLE FOR SIMPLE OS...
;
; Author: Matthew W. Coan
; Date: Thu Dec 12 00:41:11 EST 2013
;
; =======================================

[BITS 16]
[ORG 0]

fun_size:	dw 1
name_size:	dw 7
name:		db 'printf',0
entry_point:	dw 0
fun_addr:	dw 0
reloc_size:	dw 1 
addr: 		dw _printf - _main
reloc_size2:	dw 1
addr0:		dw _message - _main
addr1: 		dw message - _main
code_size: 	dw end2 - _main

_main:
	push bp
	mov bp,sp
	mov bx,[bp+4]
	push word [bx+_message]
	call [bx+_printf]
	add sp,2
	mov ax,0
	leave
	ret

reloc:
	_message:	dw 0
	_printf:	dw 0

end:

message: db 'HELLO, WORLD!',13,10,0

end2:

