I'd like to ask you why in emu8086 I have some problems with the MOV
and LEA
instructions.
This is the code:
format MZ
entry code_seg:start ; set entry point
stack 256
segment data_seg
STR1 DB "INSERT NUMBER: ",10,13,'$'
STR2 DB "DIGITED NUMBER: "
NUM DB 0
segment code_seg
start:
; set segment registers:
mov ax, data_seg
mov ds, ax
;input number
MOV ah, 09h
MOV DX, STR1
INT 21H
MOV AH,01H
INT 21H
SUB AL,30H ;CONVERSIONE
MOV NUM,AL ;SAVING VALUE IN NUM VARIABLE
;PRINT NUMBER INSERTED IN INPUT
MOV AH, 09H
LEA DX, STR2
INT 21H
MOV AH,02H
MOV DL, NUM
ADD DL,30H
INT 21H
mov ax, 4c00h ; exit to operating system.
int 21h
Precisely, I have the "invalid operand" error with these 2 instructions: MOV NUM,AL
and all LEA
instructions. How can I solve it?