Introduction About Microprocessor 8086
Introduction About Microprocessor 8086
8086 s configuration
Introduction Of microproject
8086 is 16-bit register. we can simply take the numbers from memory to AX and BX
register ,then subtract then using SUB instruction .
When the borrow is present ,the CY flag will be1,so we store borrow into memory
otherwise only store AX into memory.
2's complement is used for representing signed numbers and performing arithmetic operations
such as subtraction, addition, etc.
The positive number is simply represented as a magnitude form. So there is nothing to do for
representing positive numbers. But if we represent the negative number, then we have to
choose either 1's complement or 2's complement technique.
The 1's complement is an ambiguous technique, and 2's complement is an unambiguous
technique. Let's see an example to understand how we can calculate the 2's complement in
signed binary number representation
2’s complement
Step 3 and Step 4 have been explained in the above difference calculation.
Algorithm of 2’s compliment subtraction
Step1: Start
Step2: Initialize data segment
Step3: Load smaller BCD number.
Step4: Determine the 2’s compliments of the smaller number.
Step5: Add this 2 larger number.
Step6: There is no carry in this case .the 2’s compliment form and is negative .
Step7: To get an answer into true from ,take 2’s compliment and change it’s sign .
Step8: Store result.
Step9:Stop.
Flowchart
Start
Store result
Stop
.model small
.data
Num1 dw -0320h;
Num2 dw 0640h;
Result dw 00h;
.code
Mov ax,@data; /Initialize data section
Mov ds,ax;
Mov ax,00h;
Mov ax,num1; /load num1 in ax
Mov bx,num2; /load num2 in bx
Sub ax,bx; /subtract data from reg bx in data in reg ax
Mov result ,ax; /result in reg ax
Ends
End /terminate program
Inserted data : Number 1= -0320H
Number 2= 0640H
Subtraction of these two number is -0320H
Conclusion
Two’s complement is a great way to stored signed values in memory. However, one still need
to pay attention with overflow. Adding 2 large numbers would lead to a carry-over falling in