Jump to content

80x86 Assembly Language div instruction integer overflow?

Hey guys, don't really post much on the forum(Or at all... :x) but linus is our friend and his friends are my friends so friends help me if you may please.

 

Objective is to display the the result of a div instruction where the dividend is stored in register EAX. The problem I'm having is that the displayed result stored in EAX comes out wrong.

 

I have my .asm file in the link below I'd appreciate it if anyone could help me out.

Also we were supposed to display it onto a single window on two lines.

 

pastebin.com/1Lsu6brs

 

Comments:(Already in the pastebin file but I'll post here as well)

Objective:      Prompt and allocate DWORD(32 bits) size labels for Grade1-Grade4 and Weight1-Weight4.
                        Solve for WeightedSum = G1*W1 + G2*W2 + G3*W3 + G4*W4
                        Solve for SumOfWeights = W1 + W2 + W3 + W4
                        Solve for WeightedAverage = (WeightedSum/SumOfWeights)
                        Display WeightedAverage & WeightedSum
 
Grades:         Weights:
88              1
77              2
94              1
85              3
SumOfWeight = 7
WeightedSum = 591
WeightedAvg = 81        ;Displays 1792
 
 
And as always please and thank you!
Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×