Texas Instruments 990 Operation Manual page 112

Prototyping system
Hide thumbs Also See for 990:
Table of Contents

Advertisement

~
_____ 9_45_2_5_5-_9_70_1 ____________________________
~
__________________ __
The source address is equal to the instruction address+2, which is 1 FE 16 +2 16
=
200 16 , The
sum of the target location plus 10000 16 , minus the source address, is 1017A 16 -200 16
=
FF7 A 16 . Continuing
1
/2 (target location - source address)
=
7FBD
=
BD (dropping the first two digits)
The displacement, BD, is negative. The patch value is therefore IOBD 16 , where 10 is the
hexadecimal op code for the JMP instruction and BD16 is the displacement value, negative
in this case.
Note that the 7F is generated from the addition of 2 16 (10000 16 ) and may be discarded. If
the high order eight bits of the destination are not equal to 7F, the branch distance is too
great to reach with a JMP instruction.
3.6.3.5 Spin and NOP. It is sometimes convenient to patch a spin (branch to itself) into a
location to intercept control in unexpected situations (the alternate path of a conditional jump,
for example). That instruction is a JMP to itself and is a value of I OFF 16' (The corresponding.
assembly language code is JMP $.)
Unwanted instructions can be replaced with a no-operation (NOP) which is a JMP to the next
instruction. The value for an NOP is 1000 16 ,
3.6.3.6 Out-of-Line Patches. It is often necessary to patch more instructions into a program
than there is room, requiring an out-of-line patch. The simplest mechanism is to use a symbolic
address branch instruction to a specific location where the patch is placed. After the patch, use a
branch instruction back to the original code.
Example:
0460
(loc
A)4-- A
B
~
0460
L
(loc
B)
Be careful to see that code which is overlayed is mQved to the patch area, that it is not a PC
relative jump, and that the return pointer comes to the beginning of
an
instruction.
3-74
Digital Systems Division

Advertisement

Table of Contents
loading

Table of Contents