February 04, 2012
Write a program to find the 1’s complement of a number.
Apparatus Used: Microprocessor kit, Keyboards
Assumption: Suppose first number is stored at 2200 H. We have to find 1’s complement of this number and we have to store complemented at 2250 H.
Algorithm:
- Store the number in the accumulator.
- Get one’s complement of the number.
- Store complemented number at given address.
Program:
Memory Add
|
Mnemonics
|
Op-code
|
Comments
|
2000
|
LDA
|
2200 H
|
Store the number in accumulator
|
2002
|
CMA
|
Get 1’s complement
| |
200C
|
STA
|
2250
|
Store output
|
200F
|
RST
|
5
|
Set Break-point
|
2010
|
END
|
End the program
|
Description of used instruction:
LDA adr: Load data into register A (accumulator) directly from the address given within the instruction.
CMA: This instruction complements each bit of accumulator. This result of this instruction is complement.
STA: This instruction is used to store the content of accumulator at specified memory address.
RST 5: This instruction is used to set break-point for the execution.
END: This instruction is used to execute the program.
Result:
Input:
2200-88(1000 1000)
Output:
2250-77(0111 0111)
Procedure to look output
- After press ENTER, You will get first screen
- Press G and Provide Initial address (as 2000)
- Press SHIFT+4,You will get first screen again
- Press M and Provide Input location for Input (M2200)
- Press ENTER and Provide your Input at location (2200: 88)
- Press SHIFT+4
- Press G and Provide Initial address (as 2000)
- Press SHIFT+4,You will get first screen again
- Press M and Provide address for output (M2050) and press ENTER
- You will get your desired output.
Subscribe to:
Post Comments (Atom)
Your way of describing everything in this post
ReplyDeleteis truly good, all be able to easily be aware of it, Thanks a lot.
Check out my web site :: แทงบอลออนไลน์
With havin so much written content do you ever run into any issues of plagorism or copyright infringement?
ReplyDeleteMy website has a lot of exclusive content I've either authored myself or outsourced but it seems
a lot of it is popping it up all over the web without my agreement.
Do you know any methods to help stop content from being stolen?
I'd truly appreciate it.
Look at my site :: bong
This is my first time go to see at here and i
ReplyDeleteam actually happy to read everthing at one place.
My blog :: ฉลากสินค้า