• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

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

timelapse

Senior member
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!
 
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.
 
Wish I could, just barely starting to teach myself assembly though. Did you try in HT or Programming?
 
I can see posting some basic computer tech support questions in OT for the larger group of people, but this definitely belongs in Programming.
 
Back
Top