TASM:How to printout a register pair dx:ax on screen after multiply?

后端 未结 1 436
南笙
南笙 2021-01-29 11:02
include io.h
cr  equ 0dh
lf  equ 0ah
stacksg segment stack
dw  100 dup(?)
stacksg ends
datasg segment
prp1    db  \'1st Number:\',cr,lf,0
prp2    db  \'2nd Number:\',cr,         


        
相关标签:
1条回答
  • 2021-01-29 11:21

    You will need different version of itoa to display 32bit number from register pair DX:AX as unsigned decadic number. Maximum value of such number is 4294967295. Divide the number in DX:AX by 1000000000, giving the quotient 4. This is the 1st output digit. Subtract 4*1000000000, so now DX:AX=294967295. Divide by 100000000, giving 2. Subtract 2*100000000, so now DX:AX=94967295. Repeat until all ten digits are processed.

    Twenty years ago I wrote a macro called StoDD for this, it is available for download in the file CPU.MAC at http://vitsoft.info/vsasmlib.zip Maybe it could help you.

    0 讨论(0)
提交回复
热议问题