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
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
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Topic Video
Question
![## Submission (1)
### Convert the following pseudo code into assembly code. (‘//’ represents comments)
```plaintext
array1 13h, 14h, 15h, 16h // Each element is 1 byte long
array2 12h, 13h, 14h, 15h // Each element is 1 byte long
length1 = number of items in Array1. // length1 is a symbolic constant
length2 = number of items in Array2. // length2 is a symbolic constant
sample1 = 30h // This variable is 1 byte long initialized with 30
sample2 = 5h // This variable is 1 byte long
maxlength = max of length1 and length2. // maxlength is 1 byte long variable
index = 0. // This is a variable initialized with 0
While ( index < maxlength ) {
If (array1[index] > array2[index])
exp1 = (array1[index] * sample1) / (array2[index] * sample2)
// Only store the quotient of the division in exp1 and exp1 is a 16-bit long variable
else
exp1 = 0
index = index + 1
}
```
This pseudo code involves initializing arrays and constants, then iterating through the arrays with a loop. Depending on the comparison of elements, it performs a calculation and stores results conditionally.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fc353cc0f-0c4d-4d5b-a3e6-e746dbb90f94%2F9d9c42d8-9baa-40c8-a7e6-bfc9fb3ff693%2Fnr528xi_processed.png&w=3840&q=75)
Transcribed Image Text:## Submission (1)
### Convert the following pseudo code into assembly code. (‘//’ represents comments)
```plaintext
array1 13h, 14h, 15h, 16h // Each element is 1 byte long
array2 12h, 13h, 14h, 15h // Each element is 1 byte long
length1 = number of items in Array1. // length1 is a symbolic constant
length2 = number of items in Array2. // length2 is a symbolic constant
sample1 = 30h // This variable is 1 byte long initialized with 30
sample2 = 5h // This variable is 1 byte long
maxlength = max of length1 and length2. // maxlength is 1 byte long variable
index = 0. // This is a variable initialized with 0
While ( index < maxlength ) {
If (array1[index] > array2[index])
exp1 = (array1[index] * sample1) / (array2[index] * sample2)
// Only store the quotient of the division in exp1 and exp1 is a 16-bit long variable
else
exp1 = 0
index = index + 1
}
```
This pseudo code involves initializing arrays and constants, then iterating through the arrays with a loop. Depending on the comparison of elements, it performs a calculation and stores results conditionally.

Transcribed Image Text:**Submission (2)**
- **array1** elements are **1 byte** long
- **array2** elements are **1 byte** long
- **length1** and **length2** are symbolic constants
- **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 **length2** and store it in **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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images

Knowledge Booster
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.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education