Unlock instant, AI-driven research and patent intelligence for your innovation.

Program rewriting method and device

A technology for program and program processing, applied in the field of program rewriting method and device, capable of solving problems such as program termination and crash

Active Publication Date: 2019-12-31
LOONGSON TECH CORP
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] The present invention provides a program rewriting method and device, which are used to solve the program termination or crash caused by the guessed PC value exceeding the legal instruction fetch address space when the processor jumps, which cannot be avoided in the prior art. technical issues

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Program rewriting method and device
  • Program rewriting method and device
  • Program rewriting method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0077] The method involved in the present invention can be applied to the scene where the processor performs instruction jump when executing the program, and the execution subject of the method can be a processor, or a communication device integrated with a processor, such as a computer, a tablet computer, a server, etc. . The following embodiments are described by taking the execution subject as a processor as an example.

[0078] It should be noted that "A, and / or, B" mentioned in this embodiment of the present invention may include "A", "B", and "A and B".

[0079] The method involved in the embodiment of the present invention aims to solve the technical problem in the prior art that it is impossible to avoid the program termination or crash caused by the guessed PC value exceeding the legal fetch address space when the processor jumps.

[0080] The technical solution of the present invention will be described in detail below with specific embodiments. The following speci...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a program rewriting method and apparatus. The method comprises the steps of creating a trampoline code for a target register of an indirect jump instruction in a to-be-processed program, and obtaining a trampoline code segment, wherein the trampoline code is used for constricting a PC (Program Counter) value corresponding to the indirect jump instruction in Kseg0; adding the trampoline code segment to an initial position of an address space of the to-be-processed program to obtain a new version program and a mapping table; and modifying the address of the target register of the indirect jump instruction located outside the trampoline code in the new version program to be an address of the trampoline code in the new version program, thereby obtaining a modified new version program, and enabling a processor to execute the trampoline code by jump when executing the address of the indirect jump instruction located outside the trampoline code. According to the method provided by the invention, the technical problem of program stop or crash caused by the fact that the processor performs instruction fetching on a wrong PC is avoided, so that the executive efficiency of the processor is improved.

Description

technical field [0001] The invention relates to computer technology, in particular to a program rewriting method and device. Background technique [0002] When the processor executes a program segment, it often encounters various jump instructions on the execution path, for example, direct jump instructions or indirect jump instructions. After the processor executes the jump instruction, the processor will jump to the target address of the jump instruction, and then execute the instruction at the target address. However, for indirect jump instructions, generally, before the program is executed, the processor does not know the target address to which the indirect jump instruction will jump, but uses the method of transfer guessing during program execution. Guess the target address of an indirect jump instruction. The above-mentioned branch guessing method can predict whether the jump is executed and the target address of the jump. Generally, it can continuously process and ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F9/445
Inventor 邱吉徐成华宋贵环
Owner LOONGSON TECH CORP