Question: PROGRAM 1 ( WRITE IN ASSEMBLY ) To practice with conditional branch instructions, write a program that finds the minimum ( most negative ) and

PROGRAM 1(WRITE IN ASSEMBLY)
To practice with conditional branch instructions, write a program that finds the minimum (most
negative) and maximum (most positive) numbers in an array of 20 signed 8-bit integers. As shown
below, the array is to be stored in RAM beginning at location LIST using the following test data
LIST: .byte 5,-8,20,15,-20,83,125,-107,0,35,14,-19,-30,0,35,-8,-6,22,0,-1
MIN: .word 0
MAX: .word 0
Write the minimum and maximum values in 32-bit variables MIN and MAX, respectively. You
should be able to determine both values within a single program loop, with the loop repeated 20
times.
Submit your source program and an Expressions view showing MIN, MAX and the elements of
array LIST - all in signed decimal format. Also include brief answers to the following questions:
What would you change in your program if LIST had been an array of unsigned 8-bit integers?
What would you change in your program if LIST had been an array of signed 16-bit integers?
PROGRAM 2(WRITE IN ASSEMBLY)
Create a program that will convert any uppercase letters to lowercase letters within a null-
terminated string of ASCII characters. Any changes should replace the original values within the
character string in memory. The program should be able to process strings of arbitrary length.
Recall that a null-terminated string of ASCII characters can be placed in memory with the .asciz
assembler directive:
Example: STRG: .asciz "This Is A *%5@ STRING!"
Things to consider:
How far apart (numerically) are uppercase and lowercase ASCII code values?
It's not likely that you will modify every single character. If you read in a lowercase letter,
a numeric digit, a space, or punctuation, there's nothing that needs to be modified.
When you reach the null value (0x00), there's nothing left to change.
Submit your source file and a Memory view showing the final character string. Use the ASCII
rendering for the Memory view, which shows the actual characters in the string.
PROGRAM 1 ( WRITE IN ASSEMBLY ) To practice with

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!