Hi I'm new at Assembly language, and I tried to make a random integer from 65 to 69 ('A' to 'E') and store it to AL register. This is my code.
;------------------------------------------------------------
GetChFromABCDE PROC USES eax
;
; Generates a char randomly from 'A','B','C','D','E'
; Receives: Nothing
; Returns: The char ASCII code in AL
;------------------------------------------------------------
mov eax, 5 ; get random 0 to 4
call RandomRange ;
mov eax, 41h ; make range 65 to 69
mov value1, eax
mov al, BYTE PTR value1
GetChFromABCDE ENDP
END main
Whenever I try to figure out what a problem is in this code, a debugger says 'Source not available' and 'Source information is missing from the debug information for this module'. I guess the problem part is this.
mov value1, eax
mov al, BYTE PTR value1
My professor says try to use registers instead of memories as possible as I can, but this time I have no idea to fix this problem..
I realized I forgot to put ret
in the GetChFromABCDE PROC!
Here is the final answer.
GetChFromABCDE PROC
mov eax, 5 ; get random 0 to 4
call RandomRange ;
add eax, 41h ; make range 65 to 69
ret
GetChFromABCDE ENDP