Syntax

THIS
$

The THIS operator returns an expression which denotes the location counter at the start of the assembler line.

Important notes

The location counter returned by THIS does not change even if code is emitted.

Example

A typical use of THIS is to compute the size of a string or block of memory:

MyString     DB   "Why would you count the number of characters"

             DB   "in a string when the assembler can do it?"

MyStringLen  EQU  THIS-MyString