Question: I have this code for my assembley language class and keep getting an error on line 33 and 37 (mov dh, eax) & (mov dl,

I have this code for my assembley language class and keep getting an error on line 33 and 37 (mov dh, eax) & (mov dl, eax). The error is "invalid instruction operands"

If someone could help me figure out what I am doing wrong, I would really appreciate it.

TITLE NOname (noName.asm)

INCLUDE Irvine32.inc

.data ;data section

rowNumber BYTE ?

columnNumber BYTE ?

.code ;code section

main PROC

call Clrscr ;call to clear the screen

mov ecx, 100 ;used to find the required 100 screen locations

Label1:

call GenerateLocation ;creates random loacation

mov eax, 100

call Delay ;delays for the required 100 milliseconds

loop Label1

exit

main ENDP

GenerateLocation PROC

call GetMaxXY ;uses required GetMaxXY to get size of window

mov rowNumber, al ;stores max number of rows

mov columnNumber, dl ;stores max number of columns

movzx eax, rowNumber ;moves the rowNumber to eax

call RandomRange

mov dh, eax ;moves random row number to dh register

movzx eax, columnNumber ;moves the column number to eax

call RandomRange

mov dl, eax ;moves random column number to dl register

call Gotoxy ;used to locate curser on the screen

;write the character

mov al, 'A' ;writes character A

call WriteChar

ret

GenerateLocation ENDP

END main

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!