在除法运算中提取剩余和商数:NASM 16位 [英] Extract Remainder and Quotient in Division Operation: NASM 16-Bit

查看:135
本文介绍了在除法运算中提取剩余和商数:NASM 16位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



你能否帮助我在nasm执行除法操作。



注:16位除法



问候,

Kiran

Hi,
Could you please help me in performing the division operation in nasm.

Note: 16-bit division

Regards,
Kiran

推荐答案

Dpbends你想要做什么:使用NASM除法和模数运算符(只能在装配时使用常量)或实际的微处理器在运行时处理变量值。



如果是前者,请参阅此处: http://cs.nyu。 edu / courses / fall02 / V22.0201-001 / nasm_doc_html / nasmdoc3.html#section-3.5.6 [ ^ ]



如果后者,请参见此处: http:// cs。 nyu.edu/courses/fall02/V22.0201- 001 / nasm_doc_html / nasmdocb.html#section-B.4.59 [ ^ ]



是的...我推荐了手册中的但仍然存在查找操作的问题。

你能不能用一个例子来帮我提一下鼻子16位以下的值?



64/16

余数= 0

商= 4



请...




这不是火箭科学......:笑:

Dpbends on what you are trying to do: use the NASM division and modulus operators (which only work on constants at assembly time) or the actual microprocessor to work on variable values at run time.

If the former, see here: http://cs.nyu.edu/courses/fall02/V22.0201-001/nasm_doc_html/nasmdoc3.html#section-3.5.6[^]

If the latter, see here: http://cs.nyu.edu/courses/fall02/V22.0201-001/nasm_doc_html/nasmdocb.html#section-B.4.59[^]

"yes...i have referred to the manuals but still had problems in figuring out the operation.
Could you please help me with an example probably with the below values in terms of nasm 16-bit?

64/16
remainder=0
quotient=4

please..."


This is not rocket science...:laugh:
mov dx, 0
mov ax, 64
mov bx, 16
div bx

AX == 4,DX == 0

AX == 4, DX == 0


这篇关于在除法运算中提取剩余和商数:NASM 16位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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