printing - Print Register in Assembly x86 -


followed couple of online documents , yet when try print number have stored in register %ecx nothing happens. because i'm performing calculations , trying print while in loop?

   mov     $48, %ecx  #convert ascii    mov     $1, %edx   #print byte    add     %eax, %ecx     mov     $4, %eax          #output console    mov     $1, %ebx          #file descriptor - standardout    int      $0x80            #call kernel 

the write system call expects pointer data printed. far can tell, have single digit. can temporarily store on stack printing follows:

mov     $48, %ecx  #convert ascii mov     $1, %edx   #print byte add     %eax, %ecx push    %ecx       # store on stack mov     %esp, %ecx # load address mov     $4, %eax   # output console mov     $1, %ebx   # file descriptor - standardout int     $0x80      # call kernel pop     %ecx       # clean stack 

remember need better conversion routine multi-digit numbers.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

netbeans - Remove indent guide lines -

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -