Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Assembly 英特尔x86汇编-收集分区的剩余部分_Assembly_X86_Intel_Division_Masm - Fatal编程技术网

Assembly 英特尔x86汇编-收集分区的剩余部分

Assembly 英特尔x86汇编-收集分区的剩余部分,assembly,x86,intel,division,masm,Assembly,X86,Intel,Division,Masm,如何将div指令的剩余部分收集到寄存器中,以便将其转换为字符串并显示在控制台上。例如: .386 .model flat, stdcall option casemap :none include \masm32\include\windows.inc include \masm32\include\kernel32.inc include \masm32\include\masm32.inc includelib \masm32\lib\kernel32.lib includelib \mas

如何将
div
指令的剩余部分收集到寄存器中,以便将其转换为字符串并显示在控制台上。例如:

.386
.model flat, stdcall
option casemap :none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\masm32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib
.data
  adrs1 dd 0
  adrs2 dd 0
.code
start:
  mov eax, 6        ; add 6 to eax
  mov ebx, 7        ; add 7 to ebx
  imul eax, ebx     ; multiply both numbers, result is in eax
  mov ecx, 10       ; add 10 to ecx
  idiv eax:ecx, edx ; divide eax (result of mul) by 10 so that I can separate the              digits into single characters so  I can display them.
                    ; Numbers will be 4 and 2. Is the result of the division stored in EDX?
  mov adrs1, eax      ; mov the '4' from the '42' result of the multiplication into 'adrs'
  mov adrs2, edx      ; mov the remainder of the division to adrs2
  add adrs1, 50       ; make the result the correct ASCII character for the result
  add adrs2, 50       ; " "
  invoke StdOut, addr adrs1 ; display adrs1
  invoke StdOut, addr adrs2 ; display adrs2
  invoke ExitProcess, 0 ; exit
end start
我需要展示师的剩余人员。任何帮助都将不胜感激

提前感谢,


Progrmr

可能重复感谢,但该代码可在MASM中实现吗?执行IDIV会在寄存器中留下商和余数。。。因此,您不必“做”任何事情来将剩余部分放入寄存器。你的问题的来源是什么?我正试图将一个数字(例如1405)分成不同的数字(这就是为什么我想要余数,因为我用10除以小数点后的数字),这样我就可以将它们打印到控制台。@Progrmr
div
指令的余数进入
edx
。顺便说一句,你为什么不使用这个?