Learning Assembly with NASM, Ubuntu, 32 bits.

My array in `.data`:

```
ary db 1,2,2,4,5 ; Five elements of one byte each

```

And some number:

```
tmp db 2   ; Holds the number 2

```

Let's say I want to print the element at index 4 in the array (so it would be `5`).

I know I could do this:

```
mov EAX,4
mov EBX,0
mov ECX,ary          ; Put the array's address in ECX
add ECX,4            ; Move address four bytes to the right
add byte [ECX],'0'   ; The value at this address to ASCII
mov EDX,1
int 0x80

```

However, for whatever reasons, I decided that instead of writing the constant number `4`, I want to do it by multiplying my variable (which is `2`) by `2`.

This is the updated code:

```
mov EAX,[tmp]   ; Put the number 2 in EAX
mov ECX,ary     ; Put the array's address in ECX
add ECX,EAX * 2 ; Move (2 * 2) = 4 bytes to the right
add byte [ECX],'0' ; Decimal to ASCII
mov EAX,4
mov EBX,0
mov EDX,1
int 0x80

```

This doesn't work at `add ECX,EAX * 2`:

```
invalid operand type

```

But why? Doesn't `ECX` evaluate to `2`? Being equivalent to

```
add ECX,2 * 2

```

Curiously, these do work:

```
add ECX,EAX * 1   ; Moves by 2
add ECX,EAX * 0   ; Moves by 0

```

The above suggests me that the answer is no. And the reason that multiplying by `1` or `0` works is because the assembler doesn't actually need to do any multiplication to know the answer in the first place.

Does this mean that to achieve what I want, I do have to use the `mul` instruction?