- #1
dohsan
- 7
- 0
Homework Statement
I'm writing a program to calculate the number of days. I'm really confused on how divisions or modulus works in assembly... but I tried =/
Given that the day, month, and year value of a particular date are d, m, y. The day number of that date is calculated:
m = (m + 9) % 12
y = y - m/10
day_num = 365*y + y/4 - y/100 + y/400 + (m*306 + 5)/10 + ( d - 1 )
Homework Equations
The Attempt at a Solution
;month 1
mov eax, m1
add eax, 9
mov edx,0
mov ecx,12
div ecx
mov eax, 0
mov m1,edx
;month 2
mov eax, m2
add eax, 9
mov edx,0
mov ecx,12
div ecx
mov eax, 0
mov m2,edx