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.

• • • • • • • •<br />

Assembly Language 4−11<br />

Using non−sequential instructions (branches) within extend blocks can<br />

cause unexpected results. Branching from extend blocks, causes the block<br />

to be continued at the target address of the branch. Such a continued<br />

block is called a ’virtual extend block’.<br />

The assembler issues a warning when a branch instruction occurs in an<br />

extend block and the branch instruction was not the final instruction in<br />

that block.<br />

Example:<br />

CMP R0, #value<br />

EXTR #4<br />

JMP cc_EQ, VirtualEXTRBlock<br />

MOV PT0, #value0 ; Extended SFR<br />

MOV PT1, #value1 ; Extended SFR<br />

MOV PT2, #value2 ; Extended SFR<br />

MOV P3, #value3 ; Standard SFR<br />

JMP cc_UC, Continue<br />

VirtualEXTRBlock:<br />

EXTRV#3 ; Virtual extend<br />

ADD PT0, #1 ; Extended SFR<br />

ADD PT1, #1 ; Extended SFR<br />

ADD PT2, #1 ; Extended SFR<br />

ADD<br />

Continue:<br />

P3, #1 ; Standard SFR<br />

4.5.2 NESTING EXTEND BLOCKS<br />

If an extend instruction occurs within an extend block the assembler issues<br />

a warning, unless the instruction is the final instruction of the extend block<br />

and it has the same type as the previous extend instruction. If an extend<br />

instruction is the last instruction in an extend block and it has the same<br />

type as the previous extend instruction, the extend block is expanded with<br />

the new block.<br />

Example:<br />

ATOMIC #4<br />

NOP<br />

NOP<br />

NOP<br />

ATOMIC #2<br />

NOP<br />

NOP

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

Saved successfully!

Ooh no, something went wrong!