2010-09-05 31 views
0

Je le fichier ASM suivant généré par un compilateur j'écris:Pourquoi est-ce un opérande invalide?

; This code has been generated by the 7Basic 
; compiler <http://launchpad.net/7basic> 

; Uninitialized data 

     SECTION .bss 
v_0 resb 4 
v_4 resb 4 
v_8 resb 4 

; Code 

     SECTION .text 
push 1 
pop eax 
mov v_0, eax 
push 2 
pop eax 
mov v_4, eax 
mov eax, v_0 
push eax 
mov eax, v_4 
push eax 
pop ebx 
pop eax 
imul eax,ebx 
push eax 
pop eax 
mov v_8, eax 

Lorsque je tente de le compiler, je reçois les erreurs suivantes:

test.asm:16: error: invalid combination of opcode and operands
test.asm:19: error: invalid combination of opcode and operands
test.asm:29: error: invalid combination of opcode and operands

Cela ne fait pas vraiment sens parce que selon les documents MSNA, je suis autorisé à:

MOV    mem_offs, reg_eax    386

Pourquoi ne puis-je effectuer cette opération?

Répondre

2

Vous devez crochets à déréférencer les pointeurs:

mov [v_0], eax 
+0

Merci! C'était le problème, d'accord. –