Addressing modes distinguish a value from the address where a value is stored. In ivss, $ requests an immediate value or symbol address, while brackets dereference a register-based address:
ld $values, %r1 # address of values ld $7, %r2 # immediate value st %r2, [%r1 + 4] # store into the second word ld [%r1 + 4], %r3 # r3 = 7 ld values, %r4 # r4 = first word, 11 .section my_data values: .word 11, 0
The code belongs in an executable section; the .section directive switches to data for the final declaration. Each word occupies four bytes, so offset four selects the second entry.
ld $values loads an address, whereas ld values loads memory at that address. Confusing these forms can produce a valid program that reads the wrong location.
Register-plus-displacement operands combine a base register with an offset. Symbol references can require relocation, and large values or complex forms may expand into multiple instructions using assembler helpers. The source operand describes the requested access, not necessarily one directly encoded machine instruction.
Source: asembler.c.