Translating Conditional Branches

By using a PC-relative encoding of the jump targets,the instructions can be compactly encoded(requiring just 2 bytes),and the object code can be shifted to different positions in memory without alteration.

The most general way to translate conditional expressions and statements from C into machine code is to use combinations of conditional and  unconditional jumps.

时间: 2024-10-12 21:59:41

Translating Conditional Branches的相关文章

JVM Specification 9th Edition (2) Chapter 2. The Structure of the Java Virtual Machine

Chapter 2. The Structure of the Java Virtual Machine 内容列表 2.1. The class File Format (class文件的格式) 2.2. Data Types (数据类型) 2.3. Primitive Types and Values (原始数据类型和值) 2.3.1. Integral Types and Values 2.3.2. Floating-Point Types, Value Sets, and Values 2

设计模式(一) 策略模式

 一  入门 摘自<Head First Design Patterns> chapter 1 1  飞翔的鸭子 开发一款模拟鸭子的游戏.首先设计一个鸭子母类,里面有鸭子的叫声.游泳和外形三个成员函数,然后在野鸭和红头鸭两个子类中重写继承的外形函数. 更进一步,要求鸭子会飞,应该如何设计程序呢? 2  两种方法 1)  继承 为 Duck 母类添加 fly() 成员函数,然后各个子类继承 fly() 问题: 并不是所有的鸭子都会飞,比如“煮熟的鸭子”.解决: 不会飞的鸭子自母类继承 fly()

设计模式进阶(一) 策略模式

摘自<Design Paterns_Elements of Reusable Object-Oriented Software> 上一系列偏重于入门,从本篇开启进阶系列,着重于设计模式的适用情景. 回顾入门系列 设计模式入门(一)  策略模式 1  Intent Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary

Flexible implementation of a system management mode (SMM) in a processor

A?system?management?mode?(SMM) of operating a processor includes only a basic set of hardwired hooks or mechanisms in the processor for supporting SMM. Most of SMM functionality, such as the processing actions performed when entering and exiting SMM,

The Aggregate Magic Algorithms

http://aggregate.org/MAGIC/ The Aggregate Magic Algorithms There are lots of people and places that create and collect algorithms of all types (here are a few WWW sites). Unfortunately, in building systems hardware and software, we in The Aggregate o

Method, apparatus and system for acquiring a global promotion facility utilizing a data-less transaction

A data processing system includes a global promotion facility and a plurality of processors coupled by an interconnect. In response to execution of an acquisition instruction by a first processor among the plurality of processors, the first processor

Methods and Systems for Enhancing Hardware Transactions Using Hardware Transactions in Software Slow-Path

Hybrid transaction memory systems and accompanying methods. A transaction to be executed is received, and an initial attempt is made to execute the transaction in a hardware path. Upon a failure to successfully execute the transaction in the hardware

likely()与unlikely()

he gcc C compiler has a built-in directive that optimizes conditional branches as either very likely taken or very unlikely taken. The compiler uses the directive to appropriately optimize the branch. The kernel wraps the directive in very easy-to-us

MIPS流水线笔记

非流水线下,指令的常规操作: IF IR<- Mem[PC] NPC<- PC+4 ID-instruction decode and register fetch step A<- Regs[IR6..10] B<- Regs[IR11..16] 可能读取的寄存器值没有用,但没关系:译码后如果没用,以后操作就不用 Imm<- ((IR16)16)##IR16-31 EX,根据译码结果分为四种情况 Memory reference ALUOUTPUT<- A+(IR16