[bits 16]
org 0x100
section .text
mov di, hello$  
mov al, 0x00
stosb
mov di, $intb2n$
mov al, 0x00
stosb
mov di, $intb2n$
mov al,0x00
stosb
mov si, $intb2n$
call strlen
mov di, $intb2n$
add di,cx
mov si, L1
L2:
lodsb
cmp al, 0x00
je L3
stosb
jmp L2
L3:
mov al,0x00
stosb
mov di, hello$
mov si, $intb2n$
L4:
lodsb
cmp al, 0x00
je L5
stosb
jmp L4
L5:
mov al,0x00
stosb
mov di, a$      
mov al, 0x00
stosb
mov di, $intb2n$
mov al,0x00
stosb
mov si, $intb2n$
call strlen
mov di, $intb2n$
add di,cx
mov si, hello$
L6:
lodsb
cmp al, 0x00
je L7
stosb
jmp L6
L7:
mov al,0x00
stosb
mov di, a$
mov si, $intb2n$
L8:
lodsb
cmp al, 0x00
je L9
stosb
jmp L8
L9:
mov al,0x00
stosb
mov di, b$      
mov al, 0x00
stosb
mov di, $intb2n$
mov al,0x00
stosb
mov si, $intb2n$
call strlen
mov di, $intb2n$
add di,cx
mov si, L10
L11:
lodsb
cmp al, 0x00
je L12
stosb
jmp L11
L12:
mov al,0x00
stosb
mov di, b$
mov si, $intb2n$
L13:
lodsb
cmp al, 0x00
je L14
stosb
jmp L13
L14:
mov al,0x00
stosb
mov di, b1$     
mov al, 0x00
stosb
mov di, $intb2n$
mov al,0x00
stosb
mov si, $intb2n$
call strlen
mov di, $intb2n$
add di,cx
mov si, L15
L16:
lodsb
cmp al, 0x00
je L17
stosb
jmp L16
L17:
mov al,0x00
stosb
mov di, b1$
mov si, $intb2n$
L18:
lodsb
cmp al, 0x00
je L19
stosb
jmp L18
L19:
mov al,0x00
stosb
mov di, $intb2n$
mov al,0x00
stosb
mov si, $intb2n$
call strlen
mov di, $intb2n$
add di,cx
mov si, a$
L20:
lodsb
cmp al, 0x00
je L21
stosb
jmp L20
L21:
mov al,0x00
stosb
mov si, $intb2n$
call strlen
mov di, $intb2n$
add di,cx
mov si, b1$
L22:
lodsb
cmp al, 0x00
je L23
stosb
jmp L22
L23:
mov al,0x00
stosb
mov si, $intb2n$
call strlen
mov di, $intb2n$
add di,cx
mov si, b$
L24:
lodsb
cmp al, 0x00
je L25
stosb
jmp L24
L25:
mov al,0x00
stosb
mov di, a$
mov si, $intb2n$
L26:
lodsb
cmp al, 0x00
je L27
stosb
jmp L26
L27:
mov al,0x00
stosb
mov si, a$
call putstr
mov ax,0x4c00
int 0x21
;B2Nasm - Basic to Nasm compiler
;Copyright (C) 2003  Nicholas Dark
;For more information, see license.txt
strlen: 
    xor cx,cx
.lenctr:
    lodsb
    cmp al,0
    je .lxit
    inc cx
    jmp .lenctr
.lxit:
    ret
;char added to end of this file as well˙
;B2Nasm - Basic to Nasm compiler
;Copyright (C) 2003  Nicholas Dark
;For more information, see license.txt
putc:
    mov ah,0x0e
    int 0x10
ret
;B2Nasm - Basic to Nasm compiler
;Copyright (C) 2003  Nicholas Dark
;For more information, see license.txt
putstr:
    lodsb
    cmp al,0x00
    je .end
    call putc
    jmp putstr
.end
    mov al,0x0a
    call putc
    ret
; for some reason an extra char is added to this specific inc file, so we make the last line a comment˙
[section .data]
L1 db 'hello',0x00
L10 db 'world!',0x00
L15 db ' ',0x00
[section .bss]
hello$ resb 30
$intb2n$ resb 30
a$ resb 30
b$ resb 30
b1$ resb 30
