
ARCHITECTURE AND INSTRUCTIONS
loaded into memory at the indicated addresses and then executed.
At the time the instructions are loaded, initial values for data items could also be loaded into memory. This means that the object code, besides containing instructions and their addresses, may also contain initial values for data items and their addresses. These initial values are specified to the assembler in the data definition statements.
The following statement will cause the assembler to produce object code that, when loaded into memory, will result in a 25 being placed in the memory address allocated to
THING;
THING DB 25 :byte initially contains 25
A question mark in place of an initial value means that we do not choose to specify an initial value for that data item; we will be satisfied with whatever initially appears in the corresponding memory location.
When the assembler sees the question mark, it still allocates memory for the data item, but does not produce object code to initialize the memory location (although it could).
In general, the initial value could be specified by an expression, since expressions are eval- uated at assembly time. So we can write statements like:
IN_PORT DB PORT_VAL
OUT_PORT DB PORT_VAL+1
what about a
The initialization of LITTLE_CYCLE per- mits an indirect intrasegment jump or call to use the date item named LITTLE,CYCLE to transfer control to the label na~eq CYCLE. Similarly, an intersegment jump or call transfers control to CYCLE by using the data item named BIG_CYCLE.
Tables
So far we have used
A table is defined by placing several initial values on a
DB 1,2,4,8,16
Recall that expressions come in two varieties - numeric and memory address. It is mean- ingful to initialize either a byte, or a word, or a
The byte at the memory address correspond- ing to POWERS_2 will be initialized to 1 (whenthe object code is loaded into memory).
LITTLE_CYCLE | DW | CYCLE | ;offset of CYCLE |
BIG_CYCLE | DO | CYCLE | ;offset and segment of CYCLE |
CYCLE | MOV BX,AX |