Condition Codes

CF:Carry Flag.The most recent operation generated a carry out of the most significant bit.Used to detect overflow for unsigned operations.

ZF:Zero Flag.The most recent operation yielded zero.

SF:Sign Flag.The most recent operation yielded a negative value.

OF:Overflow Flag.The most recent operation caused a two‘s-complement overflow-either negative or positive.

Suppose we used ADD instructons to perform the equivalent of the C assignment t=a+b,where variables a,b,and t are integers.

CF:(unsigned)t<(unsigned)a

ZF:(t==0)

SF:(t<0)

OF:(a<0==b<0)&&(t<0!=a<0)

时间: 2024-11-02 21:56:32

Condition Codes的相关文章

stdio.h和math.h文件内容

下面的头文件来自CodeBlocks 13.12配套的MINGW,主要是为了方便好奇的同学. 第一个文件是stdio.h. EOF在第47行 printf在第294行 FILE在第139行 stdin在第158行 1 /* 2 * stdio.h 3 * This file has no copyright assigned and is placed in the Public Domain. 4 * This file is a part of the mingw-runtime packa

YASM User Manual

This document is the user manual for the Yasm assembler. It is intended as both an introduction and a general-purpose reference for all Yasm users. 1.?Introduction Yasm is a BSD-licensed assembler that is designed from the ground up to allow for mult

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,

Next Instruction Access Intent Instruction

Executing a Next Instruction Access Intent instruction by a computer. The processor obtains an access intent instruction indicating an access intent. The access intent is associated with an operand of a next sequential instruction. The access intent

《CS:APP》 chapter 8 Exceptional Control Flow 笔记

Exceptional Control Flow The program counter assumes a sequence of values a0,a1,...,an?1 where each ak is the address of some corresponding instruction Ik. Each transition from ak to ak +1 is called a control transfer. A sequence of such control tran

20135316王剑桥 linux第五周课实验笔记

4.1.1程序员的可见的状态 ———— Y86的每条指令都会读取或修改处理器状态的某些部分,称为程序员可见状态.如图1所示. 1.程序寄存器(Program registers): %eax, %ecx, %edx, %ebx, %esi,%edi, %esp和%ebp.都是32位的. 2.条件码(Condition codes): ZF(零标志), SF(符号标志), OF(溢出标志).用来保存最近的算术或逻辑指令造成的影响. 3.程序计数器(PC):存放当前正在执行的地址. 4.存储器(Me

ARM机器码分析

我们编写的汇编程序还是不够底层,CPU都是对机器码进行操作的,所以还需要用汇编器将汇编代码转换成机器码才能被CPU处理.下面举几个例子来说说分析ARM机器码的方法. 对编译连接之后得到的ELF进行反汇编:arm-linux-objdump 查看得到的反汇编代码.这里如果想同时看到汇编代码和机器码,在编译的时候需要加上-g调试选项. 1.mov r1,#0xff  1110 00 1 1101 0 0000 0001 000011111111 前者是汇编代码,后者是其对应的机器码.用第一个例子具体

《CS:APP》 chapter 8 Exceptional Control Flow 注意事项

Exceptional Control Flow The program counter assumes a sequence of values a0,a1,...,an?1 where each ak is the address of some corresponding instruction Ik. Each transition from ak to ak +1 is called a control transfer. A sequence of such control tran

关于FPU

关于FPU,比较运算有几个地方需要关注,mark一下. he result of the comparison is reported in the condition codes field of the Status Word as follows (the C1 bit is not used and the C2 bit was not used in early FPUs): C3 C2 C0 | ZF PF CF If ST(0) > source 0 0 0 | 0 0 0 If