Member Avatar for zmem32

I'm not sure what the the code is addressing in each of these
addressing modes. I know that the opcode is moving data, but
where is the code addressing the code at in each addressing
modes:

register addressing

mov ax, bx

immediate

mov ax, 1

or

mov ax, 0x010C

direct memory addressing

mov ax, [102h]

direct offset addressing

byte_tab db 12, 15, 22
mov al, [byte_tab+2]
mov al, byte_tab[2]

register indirect

mov ax,[di]

base index

mov ax,[bx+di]

base index with displacement

mov ax, [bx + di + 10]

All that code does is illustrate how to copy data into register ax from somewhere. For example: mov ax,bx just copies the value of bx into ax register. In another case, mov ax,[bx+di] it assumes the data is in the segment pointed to by the ds register. It could also have been written like this: mov ax,ds:[bx+di]

Member Avatar for zmem32

Yeah, It's just an illustration. I just want to know how each of the addressing modes work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.