开发者

Assembly: Invalid effective address [duplicate]

开发者 https://www.devze.com 2022-12-12 17:55 出处:网络
This question already has answers here: 开发者_StackOverflow Differences between general purpose registers in 8086: [bx] works, [cx] doesn't?
This question already has answers here: 开发者_StackOverflow Differences between general purpose registers in 8086: [bx] works, [cx] doesn't? (3 answers) Closed last month.

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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号