天天看點

十進制轉換成字元串

;
; 
;十進制轉換成字元串
; author:  wangguolaing
; date:  revised 4/14

.386
.MODEL FLAT

INCLUDE io.h
includelib Kernel32.lib
ExitProcess PROTO NEAR32 stdcall, dwExitCode:DWORD

cr          EQU    0dh  
Lf          EQU    0ah      

.STACK      4096

.DATA
Array    DWORD  4 DUP (?)
.CODE
_start:
      mov eax,1324
      lea ebx,Array
      mov ecx,10
whileup  :      
      cmp eax,0
      je  endwhile
      cdq
      idiv ecx
      add edx,30H
      mov [ebx],edx
      add ebx,4
      jmp  whileup 
endwhile   : 
      sub ebx,4
uptake   : 
      output [ebx]
      sub ebx,4
      loop uptake
                             
quit:       INVOKE ExitProcess, 0   ; exit with return code 0

PUBLIC _start                       ; make entry point public
            END                     ; end of source code  
           

繼續閱讀