Db Directive

The DB directive is used to initialize storage as bytes. The argument is a comma-separated list of expressions, each of which will be assembled into one byte and assembled into consecutive memory locations.

Examples:

alabel: DB  ’X’,1,2,3,4,

If the size of an address unit in the program memory is 2 bytes, as it will be for baseline and mid-range devices (see Delta Flag), the DB pseudo-op will initialize a word with the upper byte set to zero. The above example will define bytes padded to the following words.

0058 0001 0002 0003 0004

However, on PIC18 devices (PSECT directive’s delta flag should be 1), no padding will occur and the following data will appear in the HEX file.

58 01 02 03 04