You are on page 1of 2

TAN SOO CHIN 1171103570 ST

Part 2: Exercises (3 marks)

Write 8085 Assembly Language Program to find the negative value of a positive
number in memory location 8000h. Store the result in specified memory location using
the given represen- tation:

Memory Location Representation


8000h Positive number
8001h Sign-magnitude
8002h 1's complement
8003h 2's complement
8004h Biased

Test case:

Before Execution After Execution

Case 1 Case 2 Case 1 Case 2


Address Content Address Content Address Content Address Content
8000 0B 8000 45 8000 0B 8000 45
8001 XX 8001 XX 8001 8B 8001 C5
8002 XX 8002 XX 8002 F4 8002 BA
8003 XX 8003 XX 8003 F5 8003 BB
8004 XX 8004 XX 8004 74 8004 3A

Assembly program – 2 marks

LDA 8000h
ORI 80h
STA 8001h
LDA 8000h
CMA
STA 8002h
ORI 01h
STA 8003h
ADI 127
STA 8004h
HLT
TAN SOO CHIN 1171103570 ST

Flow Chart – 1 marks

Start

Load content of memory location


8000h into Accumulator

Performs OR operation between the


content of Accumulator with 80h

Store the result in memory location 8001h

Load content of memory location 8000h into


Accumulator

Find 1’s complement of the content


in Accumulator by using CMA

Store the result in memory location 8002h

Find 2’s complement of the content in Accumulator by performing


OR operation between the content of Accumulator with 01h

Store the result in memory location 8003h

Add the bias value to the content of Accumulator

Store the result in memory location 8004h

You might also like