I made a very simple OS in Assembly. But my code is too long. I want to make my code shorter.
Here is my code:
BITS 16
start:
mov ax, 07C0h
add ax, 288
mov ss, ax
mov sp, 4096
mov ax, 07C0h
mov ds, ax
mov si, text_string
call print_string
jmp $
text_string db 'OS', 0
print_string:
mov ah, 0Eh
.repeat:
lodsb
cmp al, 0
je .done
int 10h
jmp .repeat
.done:
ret
times 510-($-$$) db 0
dw 0xAA55
Makefile:
DIR=build build
$(shell mkdir -p $(DIR))
$(shell nasm -f bin OS1.asm -o build/OS1.flp)
$(shell mkisofs -no-emul-boot -o build/OS1.iso -b OS1.flp build)
Can I make this code shorter? Is it possible to do? If it is, how?
(This code may be updated in my GitHub account.)