Solved Assembler messages: number of operands mismatch for `mov'

Solved issue

Jiangzhenlang

New Member
Joined
Jan 22, 2024
Messages
10
Reaction score
2
Credits
68
I type a assembly program. When use 'as exit.s -o exit.o' command to assemble the program, it throws the error message. I can not solve this problem.
.section .data

.section .text

.globl _start

_start:
movl $1 %eax
movl $1 %ebx

int $0x80

The system infos:
Linux jzl-virtual-machine 4.15.0-45-generic #48~16.04.1-Ubuntu SMP Tue Jan 29 18:03:19 UTC 2019 i686 i686 i686 GNU/Linux
 


I think you're using movl incorrectly, the register should be specified first ex:
movl %eax $1

could be wrong, I'm not familiar with non-intel syntax.

edit:
Actually what you're missing is comma!
movl $1, %eax
 
I think you're using movl incorrectly, the register should be specified first ex:
movl %eax $1

could be wrong, I'm not familiar with non-intel syntax.

edit:
Actually what you're missing is comma!
movl $1, %eax
Thank you so much,the problem has been solved as you think.
 
Please mark your post as solved

Do this by scrolling up to the top of the page and selecting the drop down beside the 'support linux.org donation sign

That will open the small window headed More options

Click on Edit Thread ...and click on (no prefix) ....and then Solved
 
Please mark your post as solved

Do this by scrolling up to the top of the page and selecting the drop down beside the 'support linux.org donation sign

That will open the small window headed More options

Click on Edit Thread ...and click on (no prefix) ....and then Solved
Thank you ,because I use the platform at the first time,something I don’t do well.
 
You have done very well !!
 

Members online


Top