-
overflow flag
The overflow flag of which is used to reflect whether the result of the addition and subtraction of a signed number is overflowing. If the result of the operation exceeds the range that can be represented by the current number of operation bits, it is called overflow, and the value of of
OF is the overflow flag bit, and SF is the symbol flag bit.
1.If of is zero, indicating that there is no overflow, then logically the positive or negative of the true result is equal to the positive or negative of the actual result.
If sf is 1, then the actual result is negative, so logically the real result is negative.
2.If of is 1, it means that there is an overflow, then logically the positive or negative of the true result is not equal to the positive or negative of the actual result.
If sf is 0, then the actual result is positive, as can be seen from the previous "logically the positive or negative of the real result is not equal to the positive or negative of the actual result", and the logical real result should be negative.
It can be concluded that if the actual result is positive because of the overflow, then the logical real result must be negative.
Decimal. Hexadecimal.
mov al,-45 mov al,d3
add al,-100 add al,9c
The value of al should be -145 and the value of al should be 6f(111), binary.
The representation is 01101111, and the 8-bit binary can express the data range from -128 to 127, of=1 Therefore, sf = 0, because the overflow caused the actual result to be positive, 3If of is 1, it means that there is an overflow, then logically the positive or negative of the true result is not equal to the positive or negative of the actual result.
If sf is 1, then the actual result is negative, as can be seen from the previous "logically the positive or negative of the real result is not equal to the positive or negative of the actual result", and the logical real result should be positive.
It can be concluded that if the actual result is negative because of the overflow, then the logical real result must be positive.
Decimal Hexadecimal.
mov al,45 mov al,2d
add al,100 add al,64
The value of al should be 145, the value of al should be 91h, the binary representation is 1001 0001, and the 8-bit binary can express the data range from -128 to 127, of=1 Therefore, sf=1 is negative due to spillover.
0110 1111 (Complement of 111.)
1001 0000 (reversed).
1001 0001 (add 1 to get the complement of -110) is 91h
4.If of of 0 means that there is no overflow, then logically the positive or negative of the true result is equal to the positive or negative of the actual result.
If sf is 0, the actual result is positive, so logically the real result is positive.
-
The computer actually checks whether the top two digits are the same to determine whether the carry is the same.
If the carry is the same, it does not overflow, and if it is different, it overflows.
If the computer determines the value of of of
Add the two complements together, 1For the addition of the highest digits are all 1, the highest digit must have a carry, and if the highest digit becomes 0, then the overflow is equivalent to, the highest digit has a carry, and the second highest digit has no carry, and an overflow occurs.
If the highest digit becomes 1, then there is no overflow, which is equivalent to, the highest digit has a carry, and the second highest digit has a carry, and no overflow occurs.
2.For the highest digits are all the sum of 0s.
If the highest digit becomes 1, then the overflow is equivalent to, the highest digit has no carry, and the second highest digit has a carry, and an overflow occurs.
If the highest digit is still 0, then there is no overflow, which is equivalent to, the highest digit has no carry, the second highest digit has no carry, and no overflow occurs.
3.The highest digit is 0 and the other is the addition of 1, if the highest digit becomes 0, then there is no overflow, which is equivalent to, the highest digit has a carry, and the second highest digit has a carry, and no overflow occurs.
If the highest digit becomes 1, then there is no overflow, which is equivalent to, the highest digit has no carry, the second highest digit has no carry, and no overflow occurs.
To sum up, the next highest carry xor highest carry = 0, of=0
The next highest carry xor highest carry = 1, of=1
-
How do you judge the of overflow flag in compilation 8086?
In the compilation, how else can you judge!!
Of course, it is judged by instructions.
In 8086 assembly language, there are two instructions: jo, jno.
jo, is of=1 transfer; jno, is of=0 transfer. You can use these two commands to determine the of flag.
What is the exact definition of of? of is an abbreviation for "overflow flag".
To understand what "of" is, you first have to understand what "overflow" is.
To understand what "overflow" is, you must first understand what a "complement" is and its "representation range".
In addition, when two numbers are multiplied, if the product is larger, of can be 1.
If the divisor is too small (or zero) and the quotient is too large, of of can be 1.
It's a long story. These are all written in the book.
You'd better understand it yourself.
-
First of all, to know, what is overflow?
Generally speaking, containers that are too small to hold will overflow.
On the computer side, overflow is when the data is too large and beyond the intended range.
Numbers, in computers, are all in machine codes.
deputy. People hold the most commonly used".Natural numbersand "integer", which can be expressed as follows:
Machine code,No matter what number it represents, as long as the result of the operation is outside the predetermined range, it is [overflow].
However, in computer science.
In the human mouth, it is different.
[Overflow of unsigned numbers] is not called overflow, but should be called [carrying].
[overflow with a signed number] is called [overflow].
These people who are engaged in computers have unclear basic concepts, but they are pretentious!
Pretending to be a brain circuit Qingqi... Normal people can only be speechless about this.
Sincerely
Well, let's follow the computer profession:
Overflow refers to "the result of the complement operation is out of range".
The characteristic of the overflow is "symbol error".
Knowing this, it is easy to judge whether it is overflowing, and it is easy to wear it.
Each time the CPU finishes the operation, it gives the result and the "carry flag cf" and "overflow flag of".
If of=1, it means that there is an overflow in the calculation just done.
There are six ways to manually determine whether it is overflowing.
First, the operation of unsigned numbers will definitely not overflow. There are only carrying.
2. Only when there is a positive and negative can it be possible to go beyond the range. If you don't have that, it will never overflow.
3. Manual use of the decimal system.
Numerical calculations. And, if it is not out of range, there is no overflow.
Fourth, manual use of binary complement.
Compute. And the symbol, if correct, is not overflowing.
5. Make a program and let the computer calculate. Then observe the overflow flag bit, which is zero, and there is no overflow.
Sixth, manually use the complement calculation, if the "highest carry" and "the second highest carry" are the same, there is no overflow.
Sixth, this is the method used by the CPU hardware.
Hardware, the theoretical basis of which it is based, is very obscure.
XOR operations generally do not require beginners to master.
However, some Edser teachers prefer to introduce this method.
But I can't come up with any theories!
Actually, this is a very boring performance, just thinking about being difficult for students.
-
overflow flag of of of which is used to reflect whether the result of the addition and subtraction of a signed number is overflow. If the result of the guess operation exceeds the range that can be represented by the current number of bits, the old sign is referred to as overflow, and the value of of -
-
mov al,7dh add al,0bh al=88h of 1 spill noise is out.
-7dh + 0bh = 88h。
The sum of two positive numbers, and the sum, is a negative number! It does not conform to the logical relationship of normal thickness, of course, it is overflow.
The range of the signed number is between -127 and 128.
Is it al=88h=136 so overflowing?
That's right. 88h's complement 120,Still staring at the only one judging by his complement The complement is not overflowing。
88h, which is already the complement. Supplement 120? Nothing!
-
If both numbers are noisy positive numbers, then the addition will cause overflow, and there will only be carrying, and if it is signed, the add assembly instruction will overflow.
This is judged by the delay in touching the number of the character.
If it is 1, it means overflow.
Vice versa. 88h
The binary code system is expressed as 10001000
The highest digit is 1 so, it means overflow!
-
What is Zheng Brigade overflowing?
Spillover is a universal word, and its meaning is self-explanatory.
In the computer world, this refers to the size of the data that is beyond what the code can represent.
Not only complement calculations, but any form of computation can produce overflows.
For example: 1999, 2000...This is expressed in a 4-digit decimal system.
When it comes to 9999, another year, if you still use 4 digits, it will overflow.
**The number has been increased from 7 to 8 digits because the 7-digit code is not enough.
If you don't limit the number of bits encoded, there is no overflow problem.
The two commonly used numbers, in computers, are represented by machine codes. Its scope is as follows:
The machine code, no matter what number it represents, as long as the operation result is out of range, it is [overflow].
However, in the mouth of computer professionals, it is different.
[Overflow of unsigned numbers] is not called overflow, but should be called [carrying].
[overflow with a signed number] is called [overflow].
These people who are engaged in computers have unclear basic concepts, but they are pretentious!
Pretending to be a brain circuit Qingqi...
Normal people can only be speechless about this.
Let's just say that the computer profession :
Overflow refers to "the result of the complement operation is out of range".
The characteristic of the overflow is "symbol error". Knowing this, it is easy to judge whether it is overflowing or not.
First, the operation of unsigned numbers will definitely not overflow. There are only carrying.
2. If it is not: positive, negative, positive, negative, negative, it will certainly not overflow.
3. You calculate the values manually. As a result, if it is not out of range, there is no overflow.
Fourth, you manually calculate the complement. And the symbol, if correct, is not overflowing.
Fifth, you program and let the CPU calculate. Observe the overflow flag, if it is zero, there is no overflow.
Sixth, you manually use the complement to calculate, such as "the highest carry" and "the second highest carry" are the same, there is no overflow.
Sixth, this is the method used by the hardware in the CPU.
Hardware, the theoretical basis of which it is based, is very obscure.
XOR operations generally do not require beginners to master.
But Suihan, some of Edher's teachers, preferred to introduce this method.
But I can't come up with any theories! Shouting the clan stoolActually, this is a very boring performance.
The purpose is obviously to make it difficult for students.
-
How do you judge the of overflow flag in compilation 8086?
Use jo and jno commands to judge.
What is the exact definition of it?
Who is it?
The friend on the first floor said that it was a bit troublesome, but it was actually easier to explain. >>>More
In modern sign design, the use of color is becoming more and more vivid, and the unsaturated color theory of logo design is gradually ebbing, replaced by the concentration of color. Below I have brought you an analysis of the use of color in logo design, I hope it will be useful to you. >>>More
INT 21 is a DOS function call, and the call function number is placed in AH, and the format is as follows: >>>More
Not much to say, pommel horses are also called TMS steps, and it is best to train the triceps of the arms at the beginning, and sweep the legs back and forth. There are also kicking and hooking legs, and it is easier to get up the pommel horse after being proficient. >>>More
After passing an exam that I thought I couldn't pass, I happened to read a book and felt more confident, and then suddenly I felt that anything was possible as long as I worked hard, and I might not have anything if I didn't work hard.