Vous êtes sur la page 1sur 3

TMA1271 Introduction to Machine Architecture Programming Exercise I

TMA1271 - Introduction to Machine Architecture


Trimester 3 2009/2010
Programming Exercises
Objectives of tutorial 6:

• To have familiarity with XPO85 kit/ Simulator


– Different software commands of Simulator
– Software details of Simulator
– How to write and execute assembly language programs based
on Intel 8085 microprocessor using this Simulator

• Write and Execute assembly language programs given in


programming Exercise I

• Initially, concentrate on Substitute memory, register, GoTo


commands in order to enter and execute simple programs (pages 14,15,16 of
manual and also see pages 25,26,27,29,30 of workbook manual)
• Have the understanding of scratch Pad RAM and Battery Back up
RAM differences and locations.(Chapter 2)
• Write, code and execute simple assembly language programs
using the above commands at the specific memory locations.
• Expand your understanding on other commands such as Move,
Compare, Blank Check, Search etc.(Chapter 3)
• Have the understanding of monitor utilities your kit is capable of
in order to use them appropriately in your own program.(Chapter 10)
• Understand and execute the standard programs, which are
found in chapter 12.

RK/SA 1
TMA1271 Introduction to Machine Architecture Programming Exercise I
PROGRAMMING EXERCISE I

1. a. Specify the register contents and the flag status as the following
instructions are executed.

XRA A
MVI B, FFH
INR B
DCR A
ADD B
SUI 86H
ANA C
RST 1

Verify your results by executing the above instruction in the given XPO 85
kit in a single step mode and examining various registers after each step.

b. Write instructions to
i. Clear accumulator
ii. Load the data byte 8EH in register D and F7H in register E.
iii. Mask the high-order4 bits from both the data bytes
iv. Exclusive OR the masked bytes
v. Store the result in a memory location

Verify your theoretical result by executing the program in single


step mode.

2. a. Write 8085 ALP to find the

(i) 1’s complement and 2’s complement of 8 bit number in location


‘X’ and store the 8 bit results in two consecutive memory locations.
(ii) 1’s complement and 2’s complement of a 16-bit number in
locations ‘X’ and ‘X+1’ (lower order first followed by higher order)
and store the 16 bit result in consecutive memory locations.

b. Write 8085 ALP to

(i) Display the contents of Stack Pointer register at two consecutive


memory locations ‘X’ and ‘X+1’ (lower order followed by higher
order)
(ii) Perform multiplication by 2 and division by 2 assuming D7 and
D0 bits are not 1.

RK/SA 2
TMA1271 Introduction to Machine Architecture Programming Exercise I
3. a. The following block of data is stored in the memory locations from
6000H to 600FH. Write 8085 Assembly Language Program to transfer
the data to the locations 7000H to 7000FH

b. A group of data bytes are stored starting form memory locations


6500H to 650FH. Write 8085 ALP to shift the data bytes by 5
memory locations and Store FFH in the first 5 memory locations.

4. a. A system is designed to monitor the temperature of a furnace.


Temperature readings are recorded in 16 bits and stored in memory
locations starting at 7060H. the high-order byte is stored first and the
low-order byte is stored in the next consecutive memory location.
However, the low-order byte of all the temperature readings is
constant. Write 8085 ALP to transfer the high-order readings to
consecutive memory locations starting at 7080H and discard the low-
order bytes.
Temperature Readings (H): 6745, 8745, 1F45, 3045, 8045, 7F45

b. First set of data is stored from memory locations starting from


6155H
to 6165H.Second set of data is stored from 6255H to 6265H.
Write 8085 ALP to interchange the contents of memory locations
with each other.
(6155H) ------------------------(6255H)
----- ------

----- ------
(6165) ---------------------------(6265H)

RK/SA 3

Vous aimerez peut-être aussi