Quoting constructs: Difference between revisions

m
Line 914:
TileGfx:
incbin "Z:\game\gfx\tilemap.bmp" ;a file containing bitmap graphics data</lang>
 
For most Z80 assemblers, the following are standard:
* A value with no prefix is interpreted as a base 10 (decimal) number. $ or & represents hexadecimal and % represents binary. Single or double quotes represent ASCII.
Multiple values can be put on the same line, separated by commas. DB only needs to be before the first data value on that line. Or, you can put each value on its own line. Both are valid and have the same end result when the code is assembled.
 
Z80 Assembly uses db or byte for 8-bit data and dw or word for 16-bit data. 16-bit values are written by the programmer in big-endian, but stored little-endian. For example, the following two data blocks are equivalent. You can write it either way, but the end result is the same.
<lang z80>word $ABCD
word $CD,$AB</lang>
 
Most assemblers support "C-like" operators, and there are a few additional ones:
 
* < or LOW() means "The low byte of." For example, <$3456 evaluates to 56.
* > or HIGH() means "The high byte of." For example, <$78AB evaluates to 78.
These two operators are most frequently used with labeled memory addresses, like so:
<lang z80>lookup_table_lo:
byte <Table00,<Table01,<Table02
lookup_table_hi:
byte >Table00,>Table01,>Table02</lang>
 
The <code>incbin</code> directive can be used for embedding raw graphics data, text, or music.
 
=={{header|zkl}}==
1,489

edits