关于汇编的一个把老师难主的问题!求久经编程沙场的高手来帮忙!

来源:百度知道 编辑:UC知道 时间:2024/06/28 11:46:10
近日小弟学编程!遇到了一个比较棘手的问题!
在汇编中的乘法指令 MUL 如何实现从键盘输入一位任意的十进制数
在经过汇编处理后 用十进制的形式表示出来 即1~9的代码减30H
A~F的代码减37H
假如要输入54321
如何实现(((((((5×10)+4)×10)+3)×10)+2)×10)+1
最好能够用循环来实现
就是这个形式 最好能够达到通用的程序
小弟的困惑是 在MUL指令中如何判断是用AL乘呢 还是用AX乘呢!
这结果是越乘越大
乘完12次之后该如何继续下去呢
小弟知道自己叙述的不是太好
望高手大哥能够指点一下
小弟敬候佳音!
谢谢回复!!

Usage: MUL src
Modifies flags: CF OF (AF,PF,SF,ZF undefined)

Unsigned multiply of the accumulator by the source. If "src" is
a byte value, then AL is used as the other multiplicand and the
result is placed in AX. If "src" is a word value, then AX is
multiplied by "src" and DX:AX receives the result. If "src" is
a double word value, then EAX is multiplied by "src" and EDX:EAX
receives the result. The 386 uses an early out algorithm which
makes multiplying any size value in EAX as fast as in the 8 or 16
bit registers.

MUL 会根据你的src 来自动判断