a better write procedure (nasm)
Posted: Fri Dec 28, 2007 10:38 am
hello, thanks for reading my topic. Yesterday i was playing with my bootsector and i noticed that i had to use a label for each string i wanted to write, so i decide to do this:
I posted this info because i think it is very helpful.
Code: Select all
call writethis ;PUSH IP
db "Hello", 10, 13, 0
call writethis
db "Hello again", 0
jmp $
writethis:
pop si ;POP IP
call write
push si ;PUSH IP
ret
write:
mov ah, 0eh
.a:
mov al, [si]
inc si
cmp al, 0
je .b
int 10h
jmp .a
.b:
ret