TASM:乘法后屏幕斧:如何打印输出寄存器对DX? [英] TASM:How to printout a register pair dx:ax on screen after multiply?

查看:153
本文介绍了TASM:乘法后屏幕斧:如何打印输出寄存器对DX?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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,lf,0
prp3    db  'The result:',cr,lf,0
numA    dw  ?
numB    dw  ?
sum     dw  20 dup(?),0
entersim    db  cr,lf

datasg ends
codesg segment
start:
assume cs:codesg,ds:datasg
mov ax,datasg
mov ds,ax
output prp1
inputs numA,10
atoi numA
mov numA,ax
output prp2
inputs numB,10
atoi numB
mov bx,ax
mov ax,numA
mul bx
itoa sum,ax
output entersim
output  prp3
output sum
output entersim


mov al,0
    mov ah,4ch
int 21h

codesg ends
end start   

我不能的情况下显示整个结果相乘的结果比16位更大的答案存储在DX:AX对寄存器,我怎么能dispaly屏幕操作的正确答案?
如果有样品code为这种情况写出来...
TNX朋友

i can not show the whole result in cases that the result of multiply is bigger than 16bit and the answer is stored on dx:ax pair register,how can i dispaly the correct answer of the operation in the screen? if have sample code for this situation write it out... tnx friends

推荐答案

您将需要不同版本的 itoa 以显示来自寄存器对DX 32位号码:AX为无符号数十进制。这种数量的最大值为4294967295。
由10亿AX,给人商4。这是第一次输出位数:鸿沟DX的数量。
减去4 * 1000000000,所以现在DX:AX = 294967295。由亿分裂,使2。
减去2 * 100000000,所以现在DX:AX = 94967295。重复,直到所有十位数字进行处理。

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.

20年前,我写了一个名为 StoDD 宏这一点,可于的 http://vitsoft.info/vsasmlib.zip
也许它可以帮助你。

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.

这篇关于TASM:乘法后屏幕斧:如何打印输出寄存器对DX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆