I wrote this code to compare two strings and print string2
, if the code strings are the same:
enter:
pusha
mov ah, 0x0e
mov al, 0x0a
int 0x10
mov al, 0x0d
int 0x10
popa
mov di, reserved_string
mov bx, string2
jmp loop1
loop1:
cmp di, si
je middle_loop1
cmp [di], [bx] ; error: invalid combination of opcode and operands
jne go_back_loop1
inc di
inc bx
jmp loop1
go_back_loop1:
mov si, reserved_string
jmp key_press
middle_loop1:
mov bx, string2
pusha
jmp print_ping
print_ping:
cmp [bx], 0 ; error: operation size not specified
je go_back_print_ping
mov ah, 0x0e
mov al, [bx]
int 0x10
inc bx
jmp print_ping
go_back_print_ping:
popa
jmp key_press
It does not compile and I get errors about two of the lines. I don't know how to fix the first problem, as I should be able to compare the two values.