You are on page 1of 7

Computer Organization and Assembly Language

Program 1

Ø

Write an assembly language program that
will clear the contents of a block of
memory. The starting address of the block
has an offset of ALPHA and the ending
address of the block has an offset of
OMEGA. These addresses have random
contents. Clearing these locations means
that all the memory locations should
become zeros.

Assembly Language Programming Techniques

* Property of STI
Page 1 of 7

Computer Organization and Assembly Language

Program 2

Ø

Write an assembly language program that
will clear 100 memory locations starting at
offset ALPHA.

Assembly Language Programming Techniques

* Property of STI
Page 2 of 7

Computer Organization and Assembly Language

Program 3

Ø

Write an assembly language program that
will move the contents of memory block 1
(C100H to C120H) to memory block 2
(C150H to C170H). This means that the
contents of C100H will move to location
C150H and overwrite them and so on.
After executing the program, the contents
of two blocks should be the same.

Assembly Language Programming Techniques

* Property of STI
Page 3 of 7

Computer Organization and Assembly Language

Program 4

Ø

Write an assembly language program that
checks if ASCII “A” (41H) exists in a list.
The list is stored in memory starting at
memory location ALPHA. The list is
terminated with a sentinel number FFH
(note that the sentinel is not part of the list).
If ASCII “A” is not found in the list, then
initialize memory location STAT with 00H,
else initialize it with FFH.

Assembly Language Programming Techniques

* Property of STI
Page 4 of 7

Computer Organization and Assembly Language

Program 5

Ø

Write an assembly language program that
checks if all 100 elements in the list are
ASCII “A” (41H). The list is stored at
memory location ALPHA. If all 100
elements in the list are ASCII “A,” then
initialize memory location STAT with 00H,
else initialize it with FFH.

Assembly Language Programming Techniques

* Property of STI
Page 5 of 7

Computer Organization and Assembly Language

Program 6

Ø

Write an assembly language program that
counts the number of odd and even
numbers in a list that is stored in memory
starting at memory location ALPHA. The
list is terminated with a sentinel number
FFH (note that the sentinel is not part of
the list). Place the odd number count in
memory location ODD and the even
number count in memory location EVEN.
Assume that there is a possibility of an
empty list.

Assembly Language Programming Techniques

* Property of STI
Page 6 of 7

Computer Organization and Assembly Language

Program 7

Ø

Write an assembly language program that
counts the number of positive and negative
numbers in the list. The list contains bytesize signed numbers and is stored at
memory location ALPHA. The list is
terminated with a sentinel number FFH
(note that the sentinel is part of the list).
Place the positive number count in memory
location POS and the negative number
count in memory location NEGA.

Assembly Language Programming Techniques

* Property of STI
Page 7 of 7