selects the current segment.
cseg for code and constants
dseg for data.
cseg is active by default
sets the value of the current segments location. If cseg is active, then code will be placed at address number after the org directive
Location counter for each segment defaults to 0
signals the end of the source file.
TEN equ 10
Whenever the symbol TEN occurs in the text it will be replaced by 10
X data 34h
PSW data 0d0h
single byte data held in RAM or SFR can be given a name
X is the byte at location 34h in RAM
PSW is the name of the SFR register at 0d0h
b bit 7
CF bit 0d7h
single bit data held in RAM or SFR can be given a name
b is the bit at location 7 in bit addressable RAM
CF is the name of the bit at 0d7h - the carry flag
l1: mov a,#34
only contain letters, numbers _ and ?
start with a letter or _?
be unique within the first 32 characters
not be a reserved word
All symbols are translated to uppercase by the assembler.
Labels are symbols with a trailing colon. They represent the location of the instruction or assembler directive.
db ‘(c) Copyright, 1996’
allocates space for initialised data in the cseg a byte at a time. Can only be used when cseg is active
buffer: ds 16
reserves so many bytes (16) of data in RAM for variable data. The dseg must be active.
io_map: dbit 12
reserves so many bits (12) of data in bit addressable RAM for variable data. The bseg must be active.
The file mod2051 contains many of these directives.
Assembler 4 -