ORIGIN (ORG)
The directive ORG lets the programmer place programs anywhere in memory. Typical ORG statements are
ORG $7000
M0VE.W D0,Dl
Most assemblers assign a value of zero to the starting address of a program if the programmer does not define this by means of an ORG.
Equate (EQU)
The EQU assigns a value in its operand field to an address in its label field. This allows the user to assign a numerical value to a symbolic name. The user can then use the symbolic name in the program instead of its numerical value. Atypical example of EQU is START EQU $0200, which assigns the value 0200 in hexadecimal to the label START. Typical assemblers, such as the ide68k2 1, require hexadecimal numbers to start with a digit when the EQU directive is used. A 0 is used if the first digit of the hexadecimal number is a letter; otherwise, an error will be generated by the assembler. This is done to distinguish between numbers and labels. For example, TEST EQU $OA5 will assign A5 in hex to the label TEST.
MOVE Instructions
The format for the basic MOVE instruction is M0VE.S (EA),(EA), where S = B, W, or L. (EA) can be a register or memory location, depending on the addressing mode used. Consider M0VE.B D3,D1, which uses the data register direct mode for both the source and the destination. If [D3.B] = $05 and [Dl.B] = $01, then after execution of this MOVE instruction, [Dl .B] = $05 and [D3.B] = $05 (unchanged).
There are several variations of the MOVE instruction. For example, M0VE.W CCR,(EA) moves the contents of the low-order byte of SR (16-bit status register) to the low-order byte of the destination operand; the upper byte of SR is considered to be zero. Note that CCR (condition code register) is the low byte of SR, containing the flags X,N, Z, V, and C. The source operand is a word. Similarly, M0VE.W (EA),CCR moves an 8-bit immediate number, or low-order 8-bit data, from a memory location or register into the condition code register; the upper byte is ignored. The source operand is a word. Datacan also be transferred between (EA) and SR or USP (A7) using the following privileged
instructions:
M0VE.W (EA),SR
M0VE.W SR,(EA)
M0VEA.L A7,An
Tiada ulasan:
Catat Ulasan