19.08.2013 Views

uPSD3434EB40U6

uPSD3434EB40U6

uPSD3434EB40U6

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

8032 addressing modes uPSD34xx<br />

40/293<br />

adding either the 16-bit PC or DPTR value to the contents of the accumulator. The value in<br />

the accumulator is referred to as an index. The data fetched from the final location in<br />

program memory is stored into the accumulator, overwriting the index value that was<br />

previously stored there. For example:<br />

MOVC A, @A+DPTR ; Move code byte relative to<br />

; DPTR into accumulator<br />

MOVC A, @A+PC ; Move code byte relative to PC<br />

; into accumulator<br />

9.8 Relative Addressing<br />

This mode will add the two’s-compliment number stored in the second byte of the instruction<br />

to the program counter for short jumps within +128 or –127 addresses relative to the<br />

program counter. This is commonly used for looping and is very efficient since no additional<br />

bus cycle is needed to fetch the jump destination address. For example:<br />

SJMP 34h ; Jump 34h bytes ahead (in program<br />

; memory) of the address at which<br />

; the SJMP instruction is stored. If<br />

; SJMP is at 1000h, program<br />

; execution jumps to 1034h.<br />

9.9 Absolute Addressing<br />

This mode will append the 5 high-order bits of the address of the next instruction to the 11<br />

low-order bits of an ACALL or AJUMP instruction to produce a 16-bit jump address. The<br />

jump will be within the same 2K byte page of program memory as the first byte of the<br />

following instruction. For example:<br />

AJMP 0500h ; If next instruction is located at<br />

; address 4000h, the resulting jump<br />

; will be made to 4500h.<br />

9.10 Long Addressing<br />

This mode will use the 16-bits contained in the two bytes following the instruction byte as a<br />

jump destination address for LCALL and LJMP instructions. For example:<br />

LJMP 0500h ; Unconditionally jump to address<br />

; 0500h in program memory<br />

9.11 Bit Addressing<br />

This mode allows setting or clearing an individual bit without disturbing the other bits within<br />

an 8-bit value of internal SRAM. Bit Addressing is only available for certain locations in 8032<br />

DATA and SFR memory. Valid locations are DATA addresses 20h - 2Fh and for SFR<br />

addresses whose base address ends with 0h or 8h. (Example: The SFR, IE, has a base

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

Saved successfully!

Ooh no, something went wrong!