[BITS 16]
[org 0]
[section .text]

start:
	mov ax,cs
	mov ds,ax
	mov es,ax

	mov ah,03
	mov bh,0
	int 10h

	call _main

	jmp 0x1000:0

global _main
global _printf

[segment .text]

%include "io.asm"



_main:
	push bp
	mov bp,sp
	mov ax,word 1
	cmp ax,word 0
	je .L1
	push C0
	call _printf
	add sp,word 2
	jmp .L0
.L1:	
	mov ax,word 0
	cmp ax,word 0
	je .L2
	push C1
	call _printf
	add sp,word 2
	jmp .L0
.L2:	
	push C2
	call _printf
	add sp,word 2
.L0:	
	mov ax,word 0
	cmp ax,word 0
	je .L4
	push C0
	call _printf
	add sp,word 2
	jmp .L3
.L4:	
	mov ax,word 1
	cmp ax,word 0
	je .L5
	push C1
	call _printf
	add sp,word 2
	jmp .L3
.L5:	
	push C2
	call _printf
	add sp,word 2
.L3:	
	mov ax,word 0
	cmp ax,word 0
	je .L7
	push C0
	call _printf
	add sp,word 2
	jmp .L6
.L7:	
	mov ax,word 0
	cmp ax,word 0
	je .L8
	push C1
	call _printf
	add sp,word 2
	jmp .L6
.L8:	
	push C2
	call _printf
	add sp,word 2
.L6:	
	mov ax,word 0
	leave
	ret



[section .data]

C0: db 'IF: Hello, Wordl!',10,0
C1: db 'ELSE IF: Hello, World!',10,0
C2: db 'ELSE: Hello, World!',10,0

[section .bss]

answer: resb 20
