KS57C2308/P2308/C2316/P2316 SAM47 INSTRUCTION SET
5-67
LDC Load Code Byte
LDC (Continued)
Examples: 2. The following instructions will load one of four values defined by the define byte (DB) directive
to the extended accumulator:
ORG 0500
DB 66H
DB 77H
DB 88H
DB 99H
DISPLAY LD WX,#00H
LDC EA,@WX ;EA address 0500H = 66H
RET
If the instruction “LD WX,#01H” is executed in place of “LD WX,#00H”, then
EA address 0501H = 77H.
If the instruction “LD WX,#02H” is executed in place of “LD WX,#00H”, then
EA address 0502H = 88H.
3. Normally, the LDC EA, @EA and the LDC EA, @WX instructions reference the table data
on the page on which the instruction is located. If, however, the instruction is located at
address xxFFH, it will reference table data on the next page. In this example, the upper 4 bits
of the address at location 0200H is loaded into register E and the lower 4 bits into register A:
ORG 01FDH
01FDH LD WX,#00H
01FFH LDC EA,@WX ;E upper 4 bits of 0200H address
;A lower 4 bits of 0200H address
4. Here is another example of page referencing with the LDC instruction:
ORG 0100
DB 67H
SMB 0
LD HL,#30H ;Even number
LD WX,#00H
LDC EA,@WX ;E upper 4 bits of 0100H address
;A lower 4 bits of 0100H address
LD @HL,EA ;RAM (30H) 7, RAM (31H) 6