One’s compliment using 8085
Ø An
Assembly Language Program to find one’s compliment using 8085?
Algorithm
1) Start
the program by loading the data to Accumulator.
2) Invert
ones to zeros and zeros to ones.
3) Store
the result.
4) Terminate
the program.
Program
MEMORY
|
LABEL
|
MNEMONIC
|
HEX CODE
|
COMMENT
|
4200
|
LDA 4500
|
3A
|
Load
Accumulator with data in the location 4500
|
|
4201
|
00
|
|||
4202
|
45
|
|||
4203
|
CMA
|
2F
|
Compliment
Accumulator content
|
|
4204
|
STA 4100
|
32
|
Store the
result in the memory location 4100
|
|
4205
|
00
|
|||
4206
|
41
|
|||
4207
|
HLT
|
76
|
Program ends
|
Observation
Input at 4500 : FFH
Output at 4100 : 00H
-------------------------------------------------------------------------------------------
Two’s compliment using 8085
Ø An
Assembly Language Program to find two’s compliment using 8085?
Algorithm
1) Start
the program by loading the data to Accumulator.
2) Invert
ones to zeros and zeros to ones.
3) Increment
this inverted number by 1.
4) Store
the result.
5) Terminate
the program.
Program
MEMORY
|
LABEL
|
MNEMONIC
|
HEX CODE
|
COMMENT
|
4200
|
LDA 4500
|
3A
|
Load
Accumulator with data in the location 4500
|
|
4201
|
00
|
|||
4202
|
45
|
|||
4203
|
CMA
|
2F
|
Compliment
Accumulator content
|
|
4204
|
INR A
|
3C
|
Increment
accumulator content.
|
|
4205
|
STA 4100
|
32
|
Store the
result in the memory location 4100
|
|
4206
|
00
|
|||
4207
|
41
|
|||
4208
|
HLT
|
76
|
Program ends
|
Observation
Input at 4500 : 7FH
Output at 4100 : 81H
--------------------------------------------------------------------------------------------
No comments:
Post a Comment