Question: I'm trying to write a program in Assembler that prompts the user for a FAT16 file date and then converts it to a date in
I'm trying to write a program in Assembler that prompts the user for a
FAT16 file date and then converts it to a date in the following format: "October 1st, 2011"
When I enter "4423" it returns the date "October 04th, 0017"
That is correct except for the year. I need to add 1980 to the 0017 to get the correct
year of 1997. Somewhere in the "years" section of my code I need to add 1980.
I was thinking something like 'add ax, 1980', but I can't figure out where it needs to go.
Hoping you can help!
Here is my code from the "Year" section:
mov ax, cx
AND ax, 1111111000000000b
ROR ax, 9
xor dx,dx
mov bx, 1000
div bx
add al, 30h
mov byte ptr vYear,al
mov ax,dx
xor dx,dx
mov bx,100
div bx
add al,30h
mov byte ptr [vYear +1],al
mov ax,dx
mov bl, 10
div bl
add ax,3030h
mov word ptr[vYear +2],ax
mov edx, offset vYear
call writeString
------------------------------------------------------------------------------------------------------------------------
Any idea where and how I might add the 1980 to get the correct year?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
