O.K. the code above you got posted is a little difficult to convert to NASM and would than be code of
(I guess) 600 lines.
And yes, you have to convert the value to ascii-numbers you can read.
In assembler you have all to do on your own in assembler there are no were lying
headers and libraries around like with c++.
Now here a procedure to convert the value of eax
from my homepage: beckware.de - INFO - software - NASM - examples
or direct:
http://people.freenet.de/beckware/na...xtostdout.html
there are also other useful things.
Have also a look to the NASM forum:
http://sourceforge.net/forum/?group_id=6208
Code:
;
-------------------------------------------------
;Writes the value of eax to the standard output as decimal.
;-------------------------------------------------
stdout:
section .data
.buf db '0000000000',10,0
section .text
pushad
mov ebx,.buf+9
mov ecx,10
mov edi,10
.a:
mov edx,0
div edi
add edx,48
mov [ebx],dl
dec ebx
loop .a
mov eax,4 ;schreibe
mov ebx,1 ;auf Terminal
mov ecx,.buf
mov edx,11 ;11 Bytes
int $80
popad
ret
What happens here:
With div edi, eax is divided by 10 and edx holds the rest. Ascii ´0´ is decimal 48 and that is added to edx and stored into .buf back-wards. Now .buf is written to STDOUT that´s all.