06.02.2013 Views

C166/ST10 Cross-Assembler, Linker/Locator, Utilities ... - Tasking

C166/ST10 Cross-Assembler, Linker/Locator, Utilities ... - Tasking

C166/ST10 Cross-Assembler, Linker/Locator, Utilities ... - Tasking

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7−20<br />

DIRECTIVES<br />

DW CSEC1 ; Store the segment number<br />

; of CSEC1 section<br />

Chapter 7<br />

− Initializing with a string (DB only)<br />

With the DB directive you can define a string up to 200<br />

characters long. Each character is stored in a byte, where<br />

successive characters occupy successive bytes. The string<br />

must be enclosed within single or double quotes. If you want<br />

to include a single or double quote in a string, code it as two<br />

consecutive quotes, or use a single quote in a string enclosed<br />

within double quotes or vice versa.<br />

ALPHABET DB ’ABCDEFGHIJKLMNOPQRSTUVWXYZ’<br />

DIGITS DB ″0123456789″<br />

SINGLEQUOTE DB ″This isn’t hard″<br />

DOUBLEQUOTE DB ’This isn’’t hard also’<br />

number Is a constant expression which determines the number of<br />

bytes that must be reserved. No initialization is done.<br />

Examples:<br />

− Constant expression − a numeric value<br />

TEN DB 6+4 ; Initialize a byte: 0AH<br />

DW 10 ; Initialize a word: 000AH<br />

CONSTA DW ″?B″ ; Initialize a word: 3F42H<br />

; ^^ constant string of maximum 2 bytes,<br />

; evaluated to a number.<br />

LONG1 DDW 012345678h ; initialize a double word<br />

− Indeterminate initialization<br />

RESERVE DS 2 ; Reserve two bytes. This word<br />

; is not aligned.<br />

RESBYTES DSB 4 ; Reserve four bytes.<br />

RESWORDS DSW 2 ; Reserve four bytes.<br />

RESDWRD DSDW 1 ; reserve four bytes<br />

− An address expression − the offset or base part of a variable or label<br />

SEGBASE DW DSEC ; Store page number of DATA section<br />

COFFSET DW POF VAR ; Store offset value of VAR<br />

LBASE DW SEG LAB1 ; Store segment number of LAB1<br />

DBASE DW PAG VAR ; Store page number of VAR<br />

ADDR DDW VAR ; store full 32 bit address of VAR

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!