Very insightful explaination.I noticed too the number is convert

But I don't know why until you explain it to me.
yesternday, i let i=90 (so 90 is stored in writebuffer), then I got its corresponding ascii char 'Z' printed on the console. But when i=5, the
output is not readable at all..

It now becomes clear that I should not never use a buffer declared in .bss section to hold the variable value I intend to output, because the standard output is a character device, and it will always convert the value store there into ascii. So, to use system call to output an integer is not trivial task; at least, most of the assembly programming book never touch it. Fortunately, there is a simple way to get around system call, write, that is what i putting in with my code generator: C function printf. I am putting in scanf for read() as well, so far they worked well.
Anyway, thanks for the insightful tips. Otherwise, it would perhaps take me several weeks to find out what went wrong.

请您先登陆,再发跟帖!