I don't have any errors, I have everything I need except the output which I want it to show on certain row and column. My prompt displays on row 7, column 33 and I want the output to be on on row 9, column 33. So right now instead of having the output on row 9 , column 33 it gives me to type a value on row 9 , column 33...I have called Gotoxy before calls to WriteString so I am not sure what I am doing wrong, and I have also tried to do mov dh, 9 mov dl, 33 before each Gotoxy but it gives me an output for 3 results on the same exact row and col and creates a mess out of an output ...How could I display output to be on on row 9 and column 33 ?

INCLUDE Irvine32.inc
.data

vPrompt BYTE "Enter the Value:",0


vArray BYTE "January ",0," "
BYTE "February ",0," "
BYTE "March ",0," "
BYTE "April ",0," "
BYTE "May ",0," "
BYTE "June ",0," "
BYTE "July ",0," "
BYTE "August ",0," "
BYTE "September ",0," "
BYTE "October ",0," "
BYTE "November ",0," "
BYTE "December ",0," "

vTh BYTE "th, ",0
vSt BYTE "st, ",0
vNd BYTE "nd, ",0
vRd BYTE "rd, ",0

vDay BYTE "--",0
vYear BYTE "----",0


.code
main PROC
;--------- Enter Code Below Here



mov dh, 7 ; row 0
mov dl, 33 ; col 0
call Gotoxy
mov edx, offset vPrompt
call WriteString
;--------------------------------------


mov dh, 9 ; row 0
mov dl, 33 ; col 0
call Gotoxy



;--------------------------------------

call ReadHex
ror ax, 8
mov ebx, eax

;----------------------------------------

and ax, 0000000111100000b
shr ax, 5

mov edx, offset [vArray]
sub eax, 1
mov cl, 12
mul cl
add edx, eax


call Gotoxy
call WriteString
;------------------------------------------


mov eax, ebx
and ax, 0000000000011111b
mov ch, 10
div ch
add ax, 3030h


mov word ptr [vDay], ax
mov edx, OFFSET vDay
call WriteString

cmp ah,0
jz TheEnd

cmp ah,1
jz dSt

cmp ah,2
jz dNd

cmp ah,3
jz dRd

cmp ah,21
jz dSt

cmp ah,22
jz dNd

cmp ah,23
jz dRd

cmp ah,31
jz dSt

mov edx, offset [vTh]
jmp Display

dSt:
mov edx, offset [vSt]
jmp Display

dNd:
mov edx, offset [vNd]
jmp Display

dRd:
mov edx, offset [vRd]
jmp Display


Display:
call Gotoxy
call WriteString


;---------------------------------------------------


mov eax, ebx
and ax, 1111111000000000b
shr ax, 9
add ax, 1980
cmp eax, 0
jz TheEnd
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
xor dx, dx
mov bl, 10
div bl
add ax, 3030h
mov word ptr [vYear+2],ax
mov edx, offset [vYear]


call Gotoxy
call WriteString
xor ecx, ecx
call ReadChar

TheEnd:
exit

main ENDP
END main

now I have a cursor that is supposed to show the results on row 9, column 33 but it doesnt display the results

INCLUDE Irvine32.inc
.data

vPrompt BYTE "Enter the Value:",0

vArray BYTE "January ",0," "
BYTE "February ",0," "
BYTE "March ",0," "
BYTE "April ",0," "
BYTE "May ",0," "
BYTE "June ",0," "
BYTE "July ",0," "
BYTE "August ",0," "
BYTE "September ",0," "
BYTE "October ",0," "
BYTE "November ",0," "
BYTE "December ",0," "

vTh BYTE "th, ",0
vSt BYTE "st, ",0
vNd BYTE "nd, ",0
vRd BYTE "rd, ",0

vDay BYTE "--",0
vYear BYTE "----",0

.code
main PROC
;--------- Enter Code Below Here

mov dh, 7 ; row 0
mov dl, 33 ; col 0
call Gotoxy
mov edx, offset vPrompt
call WriteString
;--------------------------------------

;--------------------------------------

call ReadHex
ror ax, 8
mov ebx, eax

;----------------------------------------

and ax, 0000000111100000b
shr ax, 5

mov edx, offset [vArray]
sub eax, 1
mov cl, 12
mul cl
add edx, eax

mov dh, 9 ; row 0
mov dl, 33 ; col 0
call Gotoxy
call WriteString
;------------------------------------------

mov eax, ebx
and ax, 0000000000011111b
mov ch, 10
div ch
add ax, 3030h

mov word ptr [vDay], ax
mov edx, OFFSET vDay
mov dh, 9 ; row 0
mov dl, 33 ; col 0
call Gotoxy
call WriteString

cmp ah,0
jz TheEnd

cmp ah,1
jz dSt

cmp ah,2
jz dNd

cmp ah,3
jz dRd

cmp ah,21
jz dSt

cmp ah,22
jz dNd

cmp ah,23
jz dRd

cmp ah,31
jz dSt

mov edx, offset [vTh]
jmp Display

dSt:
mov edx, offset [vSt]
jmp Display

dNd:
mov edx, offset [vNd]
jmp Display

dRd:
mov edx, offset [vRd]
jmp Display

Display:
mov dh, 9 ; row 0
mov dl, 33 ; col 0
call Gotoxy
call WriteString

;---------------------------------------------------

mov eax, ebx
and ax, 1111111000000000b
shr ax, 9
add ax, 1980
cmp eax, 0
jz TheEnd
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
xor dx, dx
mov bl, 10
div bl
add ax, 3030h
mov word ptr [vYear+2],ax
mov edx, offset [vYear]

mov dh, 9 ; row 0
mov dl, 33 ; col 0
call Gotoxy
call WriteString
xor ecx, ecx
call ReadChar

TheEnd:
exit

main ENDP
END main

Edited 3 Years Ago by stephanie904

This article has been dead for over six months. Start a new discussion instead.