0

if you have

numArray BYTE 10h, 20h, 30h, 40h, 50h

mov al, numArray       = AL = 10h;
mov al, [numArray + 1] = AL = 20h;
mov al, [numArray + 2] = AL = 30h; 

Why do we not need the brackets to access the first index? If we dont use the brackets, arent we just storing the address instead of the actual value?

tagog97383
  • 19
  • 5
  • This looks like it might just be MASM/TASM from the `BYTE` to me, it might be MASM acting weird with its "variables". Please add a tag for which assembler you are using. – mediocrevegetable1 May 01 '21 at 04:55
  • MASM @mediocrevegetable1 – tagog97383 May 01 '21 at 05:19
  • 1
    You don't need `[]` in the other two, either. If you find MASM syntax weird, use NASM where memory operands *always* need `[]`, and bare stuff symbols are always immediates (the address), exactly like you expected. i.e. you don't need to look somewhere else to see if something was a label or an `equ` to see how a certain line is going to assemble (load or mov-immediate). – Peter Cordes May 01 '21 at 06:23

0 Answers0