Submission (1) Convert the following pseudo code into assembly code. ( 7/' represents comments) // Each element is 1 Byte long arrayl 13h, 14h, 15h, 16h array2 12h, 13h, 14h, 15h // Each element is 1 Byte long // lengthl is a Symbolic constant // length2 is a Symbolic constant // this variable is 1 byte long initialized with 30 lengthl = number of items in Arrayl. length2 = number of items in Array2 samplel = 30h sample2 = 5h. // this variable is 1 byte long maxlength = max of lengthl and length2. // maxlength is // this is a variable initialized with 0 1 byte long variable index = 0. index < maxlength ) { If (arrayl [index] > array2 [index] expl = (arrayl[index] * samplel) / (array2 [index] only store the quotient of the division in exp1 and exp1 is 7716 bit long variable While ( Sample2) else expl index = index + 1 = 0

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter3: Data Representation
Section: Chapter Questions
Problem 7RQ
icon
Related questions
Topic Video
Question
Submission (1)
Convert the following pseudo code into assembly code. ( 7/' represents comments)
// Each element is 1 Byte long
// Each element is 1 Byte long
arrayl
13h, 14h, 15h, 16h
array2 12h, 13h, 14h, 15h
// lengthl is a Symbolic constant
// length2 is a Symbolic constant
// this variable is 1 byte long initialized with 30
lengthl = number of items in Arrayl.
length2 = number of items in Array2
samplel = 30h
sample2 = 5h.
// this variable is 1 byte long
1 byte long variable
max of lengthl and length2. // maxlength is
// this is a variable initialized with 0
maxlength =
index = 0.
While (
index < maxlength ) {
If (arrayl[index] > array2[index]
expl = (arrayl[index] * samplel) / (array2 [index]
1,1, only store the quotient of the division in expl and expl is
Sample2)
16 bit long variable
else
expl = 0
index = index + 1
}
Transcribed Image Text:Submission (1) Convert the following pseudo code into assembly code. ( 7/' represents comments) // Each element is 1 Byte long // Each element is 1 Byte long arrayl 13h, 14h, 15h, 16h array2 12h, 13h, 14h, 15h // lengthl is a Symbolic constant // length2 is a Symbolic constant // this variable is 1 byte long initialized with 30 lengthl = number of items in Arrayl. length2 = number of items in Array2 samplel = 30h sample2 = 5h. // this variable is 1 byte long 1 byte long variable max of lengthl and length2. // maxlength is // this is a variable initialized with 0 maxlength = index = 0. While ( index < maxlength ) { If (arrayl[index] > array2[index] expl = (arrayl[index] * samplel) / (array2 [index] 1,1, only store the quotient of the division in expl and expl is Sample2) 16 bit long variable else expl = 0 index = index + 1 }
Submission (2)
array1 elements are 1 byte long
array2 elements are 1 byte long
length1 and length2 are symbolic constant
sample1 and sample2 are 1 byte long variables initialized with 30h, and 5h respectively
maxlength is a 1 byte long variable and uninitialized in the beginning.
Inside the code section, compute the largest between length1 and lenght2 and store it in the
maxlength
Index is a variable that is 1 byte long and initialized with 0
Exp1 is a variable that is 2 byte long.
You are free to use any register and user defined temporary memory variables to store the
values.
Your code must produce correct results.
Also handle corner cases (e.g. if the divisor is zero, assign 0 to exp1)
Transcribed Image Text:Submission (2) array1 elements are 1 byte long array2 elements are 1 byte long length1 and length2 are symbolic constant sample1 and sample2 are 1 byte long variables initialized with 30h, and 5h respectively maxlength is a 1 byte long variable and uninitialized in the beginning. Inside the code section, compute the largest between length1 and lenght2 and store it in the maxlength Index is a variable that is 1 byte long and initialized with 0 Exp1 is a variable that is 2 byte long. You are free to use any register and user defined temporary memory variables to store the values. Your code must produce correct results. Also handle corner cases (e.g. if the divisor is zero, assign 0 to exp1)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning