Такой код у меня получился
#include "stdafx.h"
#include <cstdlib>
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int a = 0x04;
long b = 0x0E8;
short c = 0x14;
long d = 0;
long e = 0;
cout << hex << a << endl;
cout << hex << b << endl;
cout << hex << c << endl;
__asm {
mov ax, [c]
cwd
idiv word ptr[a]
imul [c]
add ax, word ptr[b]
adc dx, word ptr[b]+2
mov word ptr[d], ax
mov word ptr[d]+2, dx
}
__asm {
mov ax, word ptr[b]
mov dx, word ptr[b]+2
sub ax, [c]
sbb dx, 0
idiv word ptr[a]
imul[c]
mov word ptr[e], ax
mov word ptr[e]+2, dx
}
cout << hex << d << endl;
cout << hex << e << endl;
system("pause");
return 0;
}
Выводит
4
e8
14
14c
424
Для продолжения нажмите любую клавишу . . .