I keep getting operand size conflict errors when I run this program I cant seem to get it right!
Write an assembly language program that will use multiple precision arithmetic to add the following defined word (dw) numbers in defined 16-bit registers (like ax, bx, cx and dx). (hint: use immediate addressing – and don't forget to account for the carry information).
A8Eeh
6789h
CABBh
7777h
//
// Matthew Tye 101 36 654
// Multiple Precision Arithmetic with DW's
// 252A9
#include "stdafx.h"
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
// your properly formatted assembly language data here
unsigned short int loword = 0;
unsigned short int hiword = 0;
unsigned short int ans1 = 0;
__asm {
// your syntatically correct assembly language code here
// column alignment markers below (to guide you)
// | | |
sub eax,eax ;zero out eax register
sub edx,edx ;zero out edx register
mov ax,A8EE ;move A8Ee into ax
add ax,6789 ;add 6789 to ax
add ax,CABB ;add CABB to ax
add ax,7777 ;add 7777 to ax
adc dx,00 ;accumulate in dx any carries
mov loword,ax ;move ax into loword
mov hiword,dx ;move dx into hiword
}
return(0);
}