Gunner,
Nice job on the new tutorial. But I have to ask. Did you modify the above example before publishing? I'm bad about doing that as well (Frank usually calls me on it though
) Line 57 in the above example uses "sys_stat" but it's not defined, it should probably be changed to "sys_newstat". It's actually correct in the file_read.tar.gz, just not the post.
Tip:Since you're using the sizeof(x) macro, when creating string length equates like:
orgbreak db "Original break = "
orglen equ $-orgbreak
newbreak db "New break = "
newlen equ $-newbreak
filesize db "Filesize = "
filelen equ $-filesize
diff db "Difference = "
difflen equ $-diff
Try to name them with a _size suffix for consistency.
orgbreak db "Original break = "
orgbreak_size equ $-orgbreak
newbreak db "New break = "
newbreak_size equ $-newbreak
filesize db "Filesize = "
filesize_size equ $-filesize
diff db "Difference = "
diff_size equ $-diff
This way, later on when you use sys_write, you can do so like:
mov ebx, stdout
mov ecx, diff
mov edx, sizeof(diff)
mov eax, sys_write
int 80h
More of a coding style thing, but it provides a nice bit of consistency.
Regards,
Bryant Keller