Assembly instruction mov register,[register][regis

2019-07-16 12:05发布

I'm studying ASM 8086 theoretically on highschool (MASM, x86).

.data
var  dd   421,422, 443, 442, 444, 217, 432

.code
; some code
mov  esi, (OFFSET var)+4
mov  ebx, 4
mov  edx, [ebx][esi]   ; that's the line I don't uderstand

I ran that program and after that EDX == 000001BBh == 443 What's the meaning of last line in that code? What does it do?

1条回答
The star\"
2楼-- · 2019-07-16 12:44

esi points 4 bytes after var, which is 422. ebx is 4.

[ebx][esi] is something which denotes [ebx+esi] and the [] is a pointer operator.

All this together will make [ebx][esi] point yet 4 bytes farther than 422 and obviously 443 can be found there.

查看更多
登录 后发表回答