I am trying to perform a division by multiple subtraction in assembly code and am getting the following errors:
subtract.nasm:19: error: invalid combination of opcode and operands
subtract.nasm:20: error: invalid combination of opcode and operands
subtract.nasm:24: error: invalid combination of opcode and operands
subtract.nasm:25: error: invalid combination of opcode and operands
I cannot figure this out, any ideas on what it could be?
section .data
VAL1: db 10
VAL2: db 2
section.text
global _start
_start:
mov eax, VAL1
mov ecx, VAL2
mov ebx, 0
sub_loop:
sub eax,eax,ebx
add ebx,ebx,1
test eax,eax
jnz sub_loop
add edx,eax,ecx
sub ebx,ebx,1
mov eax,1
mov ebx,0
int 80h