Assembly problem, during division.... please help !

timelapse

Senior member
Nov 7, 1999
401
0
0
Hello, I have an asignment and its pretty much done, except i have the following porblem...

info: I am operating in real mode with 8086 instruction only, so i only have the AX, BX, CX, DX registers, and not the Extended ones (EAX) :(

Problem: I have a "large" number stored in DX-AX after a multiplication, for example: 02AA-A800. In the past in order to obtain the value for this number in base 10 (0-9) i would divide by 10 and get the remainder which is stored in DX after a division and add to it 30H and print it. I would do this in a loop until AX was smaller than my base and all the numbers would print correctly. However i cant do that with these "large" numbers because when i divide DX-AX by my 10 (0Ah) i get an error. I am pretty sure its an overflow problem since the "quotient" of the division which normally is stored in AX after the division is too large to be in AX. the remainder would be sotred in DX.

Does anyone know how i could get around this, or divide the number in another way so that i could print it correctly? If you need more info, just ask. Thanks in advance!
 

Adul

Elite Member
Oct 9, 1999
32,999
44
91
danny.tangtam.com
the last time I did anything in assembly was on a motorola cpu and that was back in 95. sorry cant help but here is a bump.
 

ThaGrandCow

Diamond Member
Dec 27, 2001
7,956
2
0
I can see posting some basic computer tech support questions in OT for the larger group of people, but this definitely belongs in Programming.