First page Back Continue Last page Overview Graphics
Assembler Directives Examples
- Offset: dc.b 6
- Count: dc.b $45
- Scales: dc.b 6,8,30
- Msg: dc.b “FEED PART”
How many bytes total are reserved above? 1+1+3+9 = 14
Assuming Offset starts at $800, what is the value of “Msg” 0x0800 + 1 + 1 + 3 = 0x0805
The location counter is incremented by one with each (comma-separated) expression following the dc.b directive. The maximum value of an expression is 255 since the instruction allocates only a single byte for each expression.
When a series of characters is placed between quotes (either single or double) the characters inside the quotes are converted to ASCII. Each character is converted to one ASCII byte. One byte of memory is reserved for each ASCII character.
The following code will place a zero terminator after the ASCII string.
Msg: dc.b ‘FEED PART’,0