汇编语言部门 - 剩余DX寄存器

use*_*717 -1 c x86 assembly division inline-assembly

我的程序差不多完成了.我试图将CBA0123h除以B000h.商出来了.但是,应该在dx寄存器中的余数应该是:EA61(http://www.miniwebtool.com/hex-calculator/?number1=CBA0123&operate=4&number2=B000),而不是它的A123.我认为这与小端或其他东西有关.但我需要解决这个问题.我怎么能够?我旋转位?我以前从未见过如何做到这一点.如何从这个除法问题中得到正确的余数?

int main(int argc, char* argv[])
{
unsigned short int IDQUO = 0x0;
unsigned short int IDREM = 0x0;

    mov     dx, 0CBAh       
    mov     ax, 0123h       
    mov     bx, 0B000h      
    div     bx              
    mov     IDQUO, ax       
    mov     IDREM, dx       
return(0);
}
Run Code Online (Sandbox Code Playgroud)

MSa*_*ers 7

CBA0123h = B000h*1282 + A123h.DX值是正确的.