second_binary.asm 798 Bytes
[BITS 16]
[org 0x8000]

JMP	short Start

print_string:   ; Expects null terminated message in si
	for_print_string_0:
		MOV 	al,[si]
		OR 		al,al
		JZ  	end_for_print_string_0
		INC 	si
		CALL 	print_char
		JMP 	for_print_string_0
	end_for_print_string_0:
	RETN

print_char:
	MOV 	ah,0x0E         ; Specifies that we want to write a character to the screen
	MOV 	bl,0x02         ; Specifies output text color.  Not required, but useful to know
	MOV 	bh,0x00         ; Page number.  Leave this alone.
	INT 	0x10            ; Signal video interrupt to BIOS
	RETN

Start:
XOR 	ax, ax
MOV 	ds, ax
MOV		ax, 0x1000
MOV 	es, ax
XOR		bx, bx
for_start_0:
	MOV 	si, str
	CALL 	print_string
	;JMP 	for_start_0
	JMP	$

str: 	db 'Hi! I',0x27,'m the second binary!',0x0A,0x0D,0x00

TIMES 	510 - ($ - $$) db 0