Quantcast
Viewing all articles
Browse latest Browse all 2703

Assembly language: invalid combination of opcode and operands!!!?

Assembly language: invalid combination of opcode and operands!!!?
I'm pretty new in assembly language, writing partial code of mine
I'm keep getting the error message saying toupper.asm:108: error: invalid combination of opcode and operands
here are the lines i keep getting error messages on add t4, al
cmp t4, 11
add sum4,t4
cmp sum4,11
sub t4,11
sub sum4,11


and here is my code partially

start: ;address for gdb

;prompt user for input
;
mov eax, SYSCALL_WRITE ; write function
mov ebx, STDOUT ; Arg1: file descriptor
mov ecx, msg1 ; Arg2: addr of message
mov edx, len1 ; Arg3: length of message
int 080h ; ask kernel to write

; read user input
;
mov eax, SYSCALL_READ ; read function
mov ebx, STDIN ; Arg 1: file descriptor
mov esi, buf ; Arg 2: address of buffer
mov edx, BUFLEN ; Arg 3: buffer length
int 080h


; error check
;
mov [rlen], eax ; save length of string read
cmp eax, 0 ; check if any chars read
jg read_OK ; >0 chars read = OK
mov eax, SYSCALL_WRITE ; ow print error mesg
mov ebx, STDOUT
mov esi, msg4
mov edx, len4
int 080h
jmp exit ; skip over rest
read_OK:

L1_init:

mov ch, 10 ;initialize count
mov esi, buf ;point to start of buffer
sum4 db 0
t4 db 0
; mov ah, sum4 ;initialize sum
; mov bh, t4 ;initialize t4

L1_top:
; mov al, [cl]
mov al, [esi]
add t4, al
inc cl
cmp t4, 11
ja L1_part1

L1_cont:
add sum4,t4
cmp sum4,11
ja L1_part2

L1_part1:
sub t4,11
jmp L1_cont
L1_part2:
sub sum4,11
jmp L1_cont2
L1_cont2:
dec ch
jnz L1_top
L1_end:

Viewing all articles
Browse latest Browse all 2703

Trending Articles