- Mastering Assembly Programming
- Alexey Lyashko
- 194字
- 2021-08-20 10:23:30
Bit #11 - overflow flag
The overflow flag (OF) is sometimes perceived as two's complement form of the carry flag, which is not really the case. OF is set when the result of the operation is either too small or too big a number to fit into the destination operand. For example, consider the addition of two 8-bit positive values, 0x74 and 0x7f. The resulting value of such an addition is 0xf3, which is still 8-bit, which is fine for unsigned numbers, but since we added two values that we considered to be signed, there has to be the sign bit and there are no more bits to store the 9-bit signed result. The same would happen if we try to add two negative 8-bit values, 0x82 and 0x81. The meaning of the addition of two negative numbers is in the fact subtraction of a positive number from a negative number, which should result in an even smaller number. Thus, 0x82 + 0x81 would result in 0x103, where the ninth bit, 1, is the sign bit, but it cannot be stored in an 8-bit operand. The same applies to larger operands (16, 32, and 64-bit).
- 企業(yè)級Java EE架構(gòu)設(shè)計(jì)精深實(shí)踐
- MATLAB圖像處理超級學(xué)習(xí)手冊
- 程序員數(shù)學(xué):用Python學(xué)透線性代數(shù)和微積分
- HTML5+CSS3基礎(chǔ)開發(fā)教程(第2版)
- C語言程序設(shè)計(jì)案例式教程
- 可解釋機(jī)器學(xué)習(xí):模型、方法與實(shí)踐
- 批調(diào)度與網(wǎng)絡(luò)問題的組合算法
- Learning Concurrent Programming in Scala
- Hands-On Nuxt.js Web Development
- Instant Debian:Build a Web Server
- Red Hat Enterprise Linux Troubleshooting Guide
- OpenCV 3計(jì)算機(jī)視覺:Python語言實(shí)現(xiàn)(原書第2版)
- Moodle 3 Administration(Third Edition)
- Java EE項(xiàng)目應(yīng)用開發(fā)
- C#從入門到精通(微視頻精編版)