Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assembly: Invalid effective address

Tags:

assembly

I'm new to assembly (as you can plainly see) and I'm trying to compile the following:

hex_charmap db '0123456789ABCDE'
mov   al, [hex_charmap + ax]

However I get the following error on line 2:

error: invalid effective address

What does this mean and how can I fix it?

like image 864
Justin Avatar asked Nov 25 '09 15:11

Justin


1 Answers

My assembler's rusty. Can AX really be used as an indexing register?

Update:

Just found what I was looking for. Only BX can be used as an index register!

See this link for another similar questions and its similar explanation:

invalid effective address calculation

like image 81
Carl Smotricz Avatar answered Oct 05 '22 00:10

Carl Smotricz