EP0263447A2

A method and apparatus for implementing a branch and return on address instruction in a digital data processing system.

Abstract

A digital data processor acts on a branch and return on address (BAROA) instruction having an operation code field, a memory entry address field and a memory exit address field. The operation code field of the branch and return on address instruction is into an instruction register, the memory exit address field of the loaded branch and return on address instruction is loaded into the address register and the memory entry address field of the branch and return on address instruction is loaded into the program counter. The next sequential address following the address of the current BAROA instruction is then stored in a register stack, and a sequence of instructions starting with the instruction residing at the memory entry address provided by the branch and return on address instruction is fetched and executed. The program counter is incremented each time an instruction is executed. In this manner, the program counter provides the memory addresses of the instructions to be fetched. The memory address in the program counter is compared with the exit address in the address register and loading a return instruction operation code into the instruction register when the memory address in the program counter becomes equal to the exit address in the address register, such return instruction operation code, in turn, causing the address stored in the register stack to be loaded into the program counter.

EP0263447A2, drawing sheet 1
Sheet 1 of 6

Term

Term ended

Projected expiry passed 2 October 2007, 19 years ago.

  1. Priority
  2. Filed
  3. Published
  4. Projected expiry
  5. Today

10 claims: 5 independent, 5 dependent

  1. 1
    A method of operating a digital data processing system for enabling instructions in a read-write memory coupled to a data processor modify the code in a read only memory coupled to the data processors, such method being characterised by:loading into the read-write memory a branch and return on address instruction followed by one or more other instructions for modifying the read only memory code, such branch and return on address instruction including an operation code field, a read only memory entry address field and a read only memory exit address field;commencing execution of the read only memory instructions contained in the read only memory code in a sequential manner, such read only memory instructions including a branch and return on address instruction in the read-write memory;branching to the read-write memory when such branch instruction is reached and executing the branch and return on address instruction by returning to the read only memory and executing a sequence of read only memory instructions starting with the instruction residing at the entry address provided by the branch and return on address instruction;and comparing the address of each read only memory instruction with the exit address provided by the branch and return on address instruction for returning to the read-write memory and commencing execution of the read-write memory instructions following the branch and return on address instruction when the read only memory address becomes equal to the exit address, such read-write memory instructions including a branch instruction for branch back to the read only memory at the appropriate point to complete the desired modification of the read only memory code.
  2. 2
    An address mechanism in a digital data processing system for enabling instructions in a read-write memory coupled to a data processor to modify the code in a read only memory coupled to the data processor, such mechanism characterised by:means for loading into the read-write memory a branch and return on address instruction followed by one or more other instructions for modifying the read only memory code, such branch and return on address instruction including an operation code field, a read only memory entry address field and a read only memory exit address field;means for executing the read only memory instructions contained in the read only memory code in a sequential manner, such read only memory instructions including a branch instruction for causing a branch to the branch and return on address instruction to the read-write memory;means responsive to the branch and return on address instruction for returning to the read only memory and executing a sequence of read only memory instructions starting with the instruction residing at the entry address provided by the branch and return on address instruction,       and means for comparing the address of each read only memory instruction with the exit address provided by the branch and return on address instruction for returning to the read-write memory and commencing execution of the read-write memory instructions following the branch and return on address instruction when the read only memory address becomes equal to the exit address, such read-write memory instructions including a branch instruction for branching back to the read only memory at the appropriate point to complete the desired modification of the read only memory code.
  3. 3
    A method of operating a digital data processor having instruction and data processing elements including a program counter for holding the memory address of the instruction to be executed, an instruction register for receiving the operation code field of the instruction to be executed, a memory address register and a control unit for controlling the instruction and data processing elements in accordance with the operation code field residing in the instruction register characterised by the steps of:supplying to the digital data processor a branch and return on address instruction having an operation code field, a memory entry address field and a memory exit address field;loading the operation code field of the branch and return on address instruction into the instruction register;loading the memory exit address field of the branch and return on address instruction into the memory address register;loading the memory entry address field of the branch and return on address instruction into the program counter;fetching from memory and executing a sequence of instructions starting with the instruction residing at the memory entry address provided by the branch and return on address instruction;incrementing the program counter each time an instruction is executed, such program counter providing the memory addresses of the instructions to be fetched;and comparing the memory address in the program counter with the exit address in the memory address register and loading a return instruction operation code into the instruction register when the memory address in the program counter becomes equal to the exit address in the memory address register.
  4. 4
    A digital data processor having instruction and data processing elements including a program counter for holding the memory address of the instruction to be executed, an instruction register for receiving the operation code field of the instruction to be executed and a control unit for controlling the instruction and data processing elements in accordance with the operation code field residing in the instruction register, characterised by a branch and return on address mechanism comprising:means for supplying a branch and return on address instructions having an operation code field, a memory entry address field and a memory exit address field;means for loading the operation code field of the branch and return on address instruction into the instruction register;exit address register means;means for loading the memory exit address field of the branch and return on address instruction into the exit address register means;means for loading the memory entry address field of the branch and return on address instruction into the program counter;means for fetching from memory and executing a sequence of instructions starting with the instruction residing at the memory entry address provided by the branch and return on address instruction;means for incrementing the program counter each time an instruction is executed, such program counter providing the memory addresses of the instructions to be fetched;means for comparing the memory address int he program counter with the memory address in the exit address register for producing an equality signal when these two memory addresses become equal to one another;and means responsive to the occurrence of an equality signal for causing a return instruction operation code to be loaded into the instruction register to serve as the next instruction to be executed.
  5. 10
    A method of using a read-write memory code patch for correcting a read only memory code bug comprising:branching from the read only memory code to the read-write memory code patch;obtaining from the read-write memory code patch a read only memory exit address specifying the first line of read only memory code containing the code bug;resuming normal execution of the read only memory code;comparing the read only memory exit address with the address of the next read only memory instruction to be executed;and branching to the read-write memory code patch and executing the remainder of the instruction therein when the address of the next read only memory instruction to be executed is equal to the read only memory exit address.