Cool!
One more thing to thing about is - how to define and access function arguments, like:
section .data
messageformat: db "%s: %s",0
section .text
printmessage title, message {
call _printf messageformat, title, message
}
OR
printmessage(title, message) {
call _printf messageformat, title, message
}
Well, I don't know. You are the artist of this and you should know, how to define and pass function arguments!
Did you knew that there is also such thing as NASMX, it already does what you are trying to do?
+ One more thing: You are using "LEAVE" instruction, so, there is also "ENTER" instruction.
I don't know how that "ENTER" instruction works, but it saves bytes and it works nearly like this:
section .data
message: db "Hello, world! %d", 10, 0
variable: db 0
section .text
main:
enter 0,0
push variable
push message
call _printf
leave
ret
I have never used "ENTER" instruction, so, that means,
above example needs adjusted before compilation,
basically it is built in instruction that does multiple things in one, like "push ebp" and "mov ebp,esp".
Bye.