Addressing modes

There are three addressing modes for instruction parameters in NoSense (see memory description for details):

  1. Direct value
  2. Address of memory cells that contain needed value
  3. Pointer - address of memory cells that contain address of memory cells that contain neede value

Default addressing mode for for direct values is 1. Default addressing mode for labels is 2. Example below writes 123 (direct value - addressing mode 1) under address named as label sth (addressing mode 2):

MOV4i 123 sth
sth:
  DATA4i 0

You can force desired addressing mode preceding parameter by symbol:

  1. &
  2. ^
  3. *

When many addressing mode symbols precedes one parameter, only first has meaning. AX register is defined as an address with second addressing mode:

define AX ^0x7FFFFC00

When you want to use it as a pointer, you can write:

MOV1u 'X' *AX

Line above will be expanded by the preprocessor into:

MOV1u "X" *^0x7FFFFC00

That will cause using second parameter in third addressing mode. Thus X letter will be written under address that 0x7FFFFC00 memory cell is pointing to.

Addressing modes are allowed only in instruction parameters. They are not allowed in parameters of preprocessor directives or compiler commands. However checking of addressing modes in that lines isn't warranted.