WO1996008763A2 - Method, apparatus and instruction for performing a double jump register indirect operation transfer in a microcontroller - Google Patents
Method, apparatus and instruction for performing a double jump register indirect operation transfer in a microcontroller Download PDFInfo
- Publication number
- WO1996008763A2 WO1996008763A2 PCT/IB1995/000686 IB9500686W WO9608763A2 WO 1996008763 A2 WO1996008763 A2 WO 1996008763A2 IB 9500686 W IB9500686 W IB 9500686W WO 9608763 A2 WO9608763 A2 WO 9608763A2
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- procedure
- address
- register
- instruction
- contents
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/32—Address formation of the next instruction, e.g. by incrementing the instruction counter
- G06F9/322—Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address
- G06F9/324—Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address using program counter relative addressing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/3005—Arrangements for executing specific machine instructions to perform operations for flow control
- G06F9/30054—Unconditional branch instructions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/32—Address formation of the next instruction, e.g. by incrementing the instruction counter
- G06F9/322—Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address
- G06F9/323—Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address for indirect branch instructions
Definitions
- the present invention is directed to a system for performing a double jump register indirect operation and, more particularly, to a system that makes an unconditional branch to an address in instruction or code memory where the address is found in a table in memory pointed to by an address in a register designated in the instruction.
- microcontrollers Today there is a demand for higher performance/cost ratio embedded microcontrollers which are required to perform ever more complex tasks. To attain this microcontrollers must execute real time code using code or instructions which occupy the minimum amount of memory.
- Programs typically executed by microcontrollers today are modular, that is divided into separate and some what independent subprograms/subroutines or procedures that perform different or severable tasks. These procedures are typically executed sequentially or in some known order. The procedures are also typically distributed over a wide range of memory or storage space, which can be over megabytes of address space. The procedures together perform multiple tasks. Typically the initiation of each of the procedures is performed with a call to each of the procedures.
- Each call is overhead intensive in that they occupy a large amount of memory space that can be expensive relative to the cost of the device in which the microcontroller is embedded. What is needed is a technique for performing jumps to multiple procedures in a specified order that is fast and occupies a minimum of memory or storage space.
- a microcontroller that performs a jump double register indirect instruction by determining the address of a procedure to execute using the contents of a designated pointer register as an index into a procedure address table located anywhere in the address space where each entry is an address of an entry point for the particular procedure to be executed. The address is retrieved and loaded into the microcontroller program counter resulting in a jump to the entry point of the procedure. The contents of the pointer register is post incremented to point at the next entry of the table and, as a result, the next procedure. The next execution of the instruction will cause a jump to the next procedure.
- Figure 1 depicts the format of the instruction of the present invention
- Figure 2 illustrates the double indirect addressing of the present invention
- Figure 3 depicts the hardware architecture of the present invention
- FIGS. 4 - 6 illustrate the memory arrangement of the present invention
- Figure 7 illustrates the segment select register
- Figure 8 depicts the operations performed during execution of the instruction of the present invention.
- the present invention is directed to a powerful and compact instruction designed to address the requirement for multiple procedure calls.
- the mnemonic for a jump double register indirect instruction according to the present invention is JMP [[Rs+]] where "JMP" indicates the jump operation, the double brackets indicate double indirection, "Rs” designates the source register from among eight pointer registers in a register file and M +" indicates that the contents of the source register is post decremented.
- the two byte encoded format of this instruction 1 is illustrated in figure 1.
- the first byte 2 includes two nibbles where the first nibble 3 indicates operation to be performed (opcode) and the second nibble 4 indicates the address mode.
- the second byte 5 includes two nibbles where the first nibble 6 is an opcode extension and the second nibble 7 indicates one of the eight reqisters in the register file mentioned above.
- This instruction causes an unconditional branch to an address contained in a memory address or location at an address pointed to by the source register specified in the instruction where the specified register is post incremented to point to the next location in the table of procedure addresses. That is, as illustrated in figure 2, this two byte instruction can cause a unconditional jump to any address in a 24 bit linear address space (16 megabytes) indirectly pointed to by the address in one of the registers in the register file. However, it is preferred that the jump be limited to a 64k address space associated with the instruction.
- the address 10 in memory which is the content of the content register 12, is used as an index into a table 14 of procedure pointers (addresses of routines).
- the address in the table is the jump-to address.
- the 24 bit address is created by combining the low order 16 bits of the program counter (PC) and either the high 8 bits of the PC or contents of the code segment (CS) register as chosen by the program through a segment select special function register.
- This instruction compresses code size since it can be used to index through a table of procedure addresses that are accessed in sequence.
- Each procedure in the use of this instruction when the next procedure is to be executed ends with this instruction allowing processing to proceed immediately with the next procedure whose address is in the table. The details of how this instruction is executed will be discussed in more detail after the details of the architecture of the preferred microcontroller are discussed in detail.
- FIG. 3 The architecture of the microcontroller system 16 of the present invention is illustrated in figure 3.
- This system 16 includes a single chip microcontroller 17 that performs 16 bit arithmetic operations and includes internal instruction an data storage.
- the microcontroller 17 supports external device 18 and 19 and, through 24 bit external address capability, supports sixteen megabytes of external instruction storage 20 and sixteen megabytes of external data storage 21.
- the microcontroller 17 includes a bus interface unit 22 which communicates with the external memories 20 and 21 over an external bi-directional address and data bus 24.
- the microcontroller 17 communicates with the external devices 18 and 19 through I/O ports 26 - 28 which are addressable as special function registers (SFR) 40.
- SFR special function registers
- the ports 26-28, as well as other special function registers, are addressable over an internal peripheral bus 42 through the bus interface unit 22.
- the data memory 21 can also be accessed as off-chip memory mapped I/O through the I/O ports 26 - 28.
- the on-chip special function registers 40 also include a program status word (PSW) register 44 coupled to an interruption control unit 84 communicating with the external devices as well as the ALU the execution unit 70 and decode unit 74 for flag and general control, an interrupt register 44 timer registers 50, a system configuration register (SCR) 54 containing system configuration bits, and a special segment select (SSEL) register 56.
- PSW program status word
- SCR system configuration register
- SSEL special segment select
- the core 60 includes a microcode programmable execution unit 70 which controls execution of instructions by an ALU 72 and the other units.
- the instructions decoded by a decode unit 74 are fetched from an internal EPROM 76, which is part of the instruction memory space, or from the external instruction memory 20 by a fetch unit 78.
- Static RAM 80 which is part of the data memory space, as well as general purpose registers of a register file 82 are also available for instruction and data storage.
- the microcontroller 17 includes a memory organization as illustrated in figures 4, 5 and 6 where figure 4 illustrates the organization into pages, figure 5 depicts the organization of a page in more detail and figure 6 illustrates the address range of the special function registers 40.
- the microcontroller 17 has separate address spaces for instruction memory and data memory. All registers and on-chip memory are accessible (addressable) as bytes and/or words. Some dedicated data memory areas (SFR, RAM, and Register File) may also be accessed as bits (see figure 4).
- the term "data memory” refers to on-chip RAM 80, off-chip RAM 20 or off-chip memory mapped I O.
- the SFR space 40 exists in the dedicated on-chip SFR memory area in the microcontroller 17 (see figure 6). This SFR space 40 uses the upper IK of addresses in the direct address field but is not part of the data memory map.
- the special function registers such as the SSEL register 56, are in the IK direct address block 139 from address 400 to 7FF hex.
- the first half 140 of this block is the on-chip SFR space.
- This area of SFRs is used to access SFR mapped registers, such as the SSEL register 56, and control and data registers for on-chip peripherals and I/Os.
- the rest 142 is reserved for off-chip SFRs.
- the SFR 139 space is always directly addressed. Although the SFR 139 space uses the same addressing mode as the IK of directed addressed data space, it is logically a separate space and should not be thought of as overlapping the indirect data space.
- the architecture supports RAM space segmentation into 256 pages 120 each 64K size.
- Memory in the system 16 is addressed in units of bytes, each byte consisting of 8-bits.
- a word is a 16-bit value, consisting of two contiguous bytes.
- the storage order for data in the microcontroller 17 is "Little Endian", such that the lower byte of a word is stored at the lower address and the higher byte is stored at the next higher address.
- the microcontroller 12 supports a program memory 18 with an addressable space of 16 megabytes.
- the instruction set includes jumps and calls, some of which operate only on the local code page, some of which can access the entire program memory space, and some of which are register indirect.
- Program memory target addresses referenced by jumps, calls, branches, traps and interrupts, under microcode program control, must be word aligned.
- the return address from subroutines or interrupt handlers can be on either odd or even boundaries. For instance, a branch instruction may occur at any code address, but it may only branch to an even address.
- Complete programs generally consist of many different modules, segments or subroutines. However, at any given time during program execution, only a small subset of a program's segments are actually in use.
- a current working data segment 150 in the microcontroller 17 includes a 16-bit address (pointer) 152 and an 8-bit segment 154, as illustrated in figure 7.
- the 8-bit segment registers DS or ES hold the offset which is used to identify this current segment. These segment registers are used as extension to 16-bit pointer registers and stack pointers to allow data to be accessed through the entire 16 megabyte 6/08763 P 68
- the ES and DS registers can be assigned consecutive addresses such that they may be addressed as a single word.
- a "byte" register in the SFR space contains bits that are associated with each of the seven general purpose pointer registers (i.e. not the SO), that selects neither DS or ES as and in the case of code the CS as the source for the most significant 8-bits for the 24-bit address.
- This register 156 is called the segment select register or SSEL 56 (see figure 7). Segment registers are not automatically incremented or decremented along with their associated pointer registers, but must be altered explicitly by instructions.
- code or instruction addresses may be formed to execute instructions on the microcontroller 17.
- Changing the program flow is done with simple relative branches, long relative branches, 24-bit jumps and calls, 16-bit jumps and calls, and returns.
- Simple relative branches use an 8-bit signed displacement added to the program counter (PC) to generate the new code address. The calculation is accomplished by shifting the 8-bit relative displacement left by one bit (since it is a displacement to a word address), sign extending the result to 24-bits, adding it to the program counter contents, and forcing the least significant bit of the result to zero.
- the long relative unconditional branch and call with 16-bit relative displacements use the same sequence.
- the branch range is +255 to -256 for 8-bit relative and +65535 to -65536 for long jump and call.
- Far jumps and calls include a 24-bit absolute address in the instruction and simply replace the entire program counter contents with the new value.
- the address range is anywhere in the 16M.
- Double indirect jumps use a pointer register and memory contents to determine the target address.
- the jump double register indirect instruction of the present invention starts by the execution unit 70 loading (200) the contents of the source register designated in the instruction into the code address register of the fetch unit 78, so that the contents of the register can be used to fetch the procedure address.
- the content of the source register is also loaded into the ALU 72, incremented and stored back in the source register resulting in incrementing (202) the contents of the source register.
- the address loaded into the fetch unit 78 is then modified as necessary by the segment register, etc. and used to fetch (204) the procedure address from memory. This address is then loaded (206) into program counter (PC) of the fetch unit 78 and the execution of the jump double register indirect instruction is finished. Because the PC now points at the address of the entry point of the procedure to be executed, at the beginning of the next instruction cycle the fetch unit 78 fetches the instruction of the procedure at the address loaded in the fetch unit 78 and performs normal fetch, decode and execute operations thereafter.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Executing Machine-Instructions (AREA)
Abstract
Description
Claims
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US30804894A | 1994-09-16 | 1994-09-16 | |
US08/308,048 | 1994-09-16 |
Publications (2)
Publication Number | Publication Date |
---|---|
WO1996008763A2 true WO1996008763A2 (en) | 1996-03-21 |
WO1996008763A3 WO1996008763A3 (en) | 1996-05-30 |
Family
ID=23192314
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/IB1995/000686 WO1996008763A2 (en) | 1994-09-16 | 1995-08-24 | Method, apparatus and instruction for performing a double jump register indirect operation transfer in a microcontroller |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO1996008763A2 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2000072311A3 (en) * | 1999-05-21 | 2001-05-31 | Infineon Technologies Ag | Method and device for branching during the processing of a program by a processor |
WO2013013100A1 (en) * | 2011-07-19 | 2013-01-24 | Qualcomm Incorporated | Table call instruction for frequently called functions |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
IT1192334B (en) * | 1977-10-25 | 1988-03-31 | Digital Equipment Corp | NUMBER DATA PROCESSING SYSTEM |
US4803619A (en) * | 1984-03-15 | 1989-02-07 | Bernstein David H | Digital data processing system incorporating apparatus for resolving names |
JP2681929B2 (en) * | 1987-06-22 | 1997-11-26 | 三菱電機株式会社 | Program start method |
-
1995
- 1995-08-24 WO PCT/IB1995/000686 patent/WO1996008763A2/en active Application Filing
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2000072311A3 (en) * | 1999-05-21 | 2001-05-31 | Infineon Technologies Ag | Method and device for branching during the processing of a program by a processor |
WO2013013100A1 (en) * | 2011-07-19 | 2013-01-24 | Qualcomm Incorporated | Table call instruction for frequently called functions |
CN103748549A (en) * | 2011-07-19 | 2014-04-23 | 高通股份有限公司 | Table call instruction for frequently called functions |
JP2014523594A (en) * | 2011-07-19 | 2014-09-11 | クアルコム,インコーポレイテッド | Table call instructions for frequently called functions |
US9116685B2 (en) | 2011-07-19 | 2015-08-25 | Qualcomm Incorporated | Table call instruction for frequently called functions |
Also Published As
Publication number | Publication date |
---|---|
WO1996008763A3 (en) | 1996-05-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5887189A (en) | Microcontroller system for performing operations of multiple microcontrollers | |
EP0415461B1 (en) | Central processing unit supporting variable length instructions | |
JP3649470B2 (en) | Data processing device | |
US5574873A (en) | Decoding guest instruction to directly access emulation routines that emulate the guest instructions | |
US6317822B1 (en) | Instruction encoding techniques for microcontroller architecture | |
EP0405318A2 (en) | Microprocessor having cash bypass signal terminal | |
EP0415366A2 (en) | Microprocessor having predecoder unit and main decoder unit operating in pipeline processing manner | |
EP0213843A2 (en) | Digital processor control | |
US5903919A (en) | Method and apparatus for selecting a register bank | |
US7865699B2 (en) | Method and apparatus to extend the number of instruction bits in processors with fixed length instructions, in a manner compatible with existing code | |
US4223381A (en) | Lookahead memory address control system | |
US5390311A (en) | Method and apparatus for accessing microcoded instructions in a computer system | |
AU747974B2 (en) | Method for improved interrupt handling within a microprocessor | |
US4812971A (en) | Central processing unit for a digital computer | |
KR19990036893A (en) | Processor Architecture for Execution of Multiple Addressing Modes and Its Design Method | |
US4893235A (en) | Central processing unit for a digital computer | |
EP1393183B1 (en) | Modified harvard architecture processor having data memory space mapped to program memory space with erroneous execution protection | |
KR920004279B1 (en) | Microprocessor with Pointer Register | |
US5404471A (en) | Method and apparatus for switching address generation modes in CPU having plural address generation modes | |
US6012128A (en) | Microcontroller having a page address mode | |
US7676652B2 (en) | Executing variable length instructions stored within a plurality of discrete memory address regions | |
WO1996008763A2 (en) | Method, apparatus and instruction for performing a double jump register indirect operation transfer in a microcontroller | |
JPH087680B2 (en) | Instruction counter loading device | |
US5390358A (en) | Arithmetic unit that requires only one byte instructions | |
US6321319B2 (en) | Computer system for allowing a two word jump instruction to be executed in the same number of cycles as a single word jump instruction |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
AK | Designated states |
Kind code of ref document: A2 Designated state(s): JP KR |
|
AL | Designated countries for regional patents |
Kind code of ref document: A2 Designated state(s): AT BE CH DE DK ES FR GB GR IE IT LU MC NL PT SE |
|
WWE | Wipo information: entry into national phase |
Ref document number: 1995927912 Country of ref document: EP |
|
AK | Designated states |
Kind code of ref document: A3 Designated state(s): JP KR |
|
AL | Designated countries for regional patents |
Kind code of ref document: A3 Designated state(s): AT BE CH DE DK ES FR GB GR IE IT LU MC NL PT SE |
|
WWW | Wipo information: withdrawn in national office |
Ref document number: 1995927912 Country of ref document: EP |
|
121 | Ep: the epo has been informed by wipo that ep was designated in this application | ||
122 | Ep: pct application non-entry in european phase |