
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Topic Video
Question
Answer 2 only Write an assembly subroutine program DELAY that loops 2500 times.

Transcribed Image Text:Write an assembly subroutine program DELAY that loops 2500 times.
3.
Quadratic equation below is to be executed using Atmega32. Variable X is an 8-bit signed number taken
from input pin of Port B. The output of the computation is send to Port C (HIGHER BYTE) and Port D
(LOWER BYTE). Write an assembly program that performs the quadratic equation below.
LDI
OUT
LDI
OUT
OUT
Y = (X²+3X)/2
R16, e
DDRB, R16
R17, 0xFF
DDRC, R17
DDRD, R17

Transcribed Image Text:1.
SECTION
LECTURER:
i.
ii.
ADDRESS
00000000:
00000001:
00000002:
00000003:
00000004:
LDI
00000005:
LDI
00000006:
LDI
00000007:
PUSH
00000008:
PUSH
00000009:
PUSH
0000000A:
CALL
0000000C: EXIT:
JMP
eeeeeeeE: MUL_FUNC: ADD
0000000F:
SUB
00000010:
00000011:
R16
Figure 1 shows an incomplete assembly program with a subroutine. Based on the assembly program,
answer the following questions.
R17
OPCODE
MUL
RET
R18
4-jan 2023
State the contents of the following table after this assembly program is executed.
PROGRAM
COUNTER, PC
1
OPERAND
R16, 0xAA
R17, 0xBB
R18, 0XCC
R17
R18
R16
Figure 1
The stack pointer must be initialized at the uppermost data memory location. Complete the assembly
program by adding the missing instructions and write it in Figure 1.
MUL_FUNC
EXIT
R16, R17
R18, R17
R16, R18
MARKS
TIME: 1 hour 15
STACK
POINTER, SP
/40
0x85D 0x85E
0x85F
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps with 1 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.Similar questions
- Assume we are using an unknown assembly language, without finding out what assembly language it is, try to figure out what these codes are going to do by GUESSING, and express them in high-level language such as Java or C. Code group 1: MOV R1, 0 LABLE1 ………… ADD R1, 1 CMP R1, 5 JLE LABLE1 Code group 2: MOV R1, 1 LABEL2 ………………. CMP R1, 10 JGE LABEL2 Code group 3: JMP LABEL3 LABEL4 …………….. LABEL3 CMP R1, 1 JE LABEL4arrow_forward2. Write the following code segment in MARIE's assembly language: if X > 1 then Y = X + X; X 0; %3D endif; Y = Y + 1;arrow_forwardCompute the CPI for a computer that runs its workload composed of two programs. Program 1 runs 1865751 instructions using 12451317 clock cycles, while program 2 runs 10114053 instructions using 13432898 clock cycles. The first program runs 2 times for each time program 2 runs.arrow_forward
- Write an Assembly Language program that will swap the values from two different variables and display the registers these two values are in. For example, if A = 2 and B = 3 then, once the program executes the values should be A = 3 and B = 2.arrow_forwardIt is feasible to design compilers and assemblers to sequence instructions in assembly language in a way that minimizes hazards in a pipeline. Do all assemblers and compilers optimize the order of instructions in assembly language in the same way?arrow_forward4) Write the following code segment in MARIE assembly language using given set of variables (symbols). Sum = 0; X = 3; Sum = Sum + X; X = X + 1; Assembly program: Load X Add Store X Load X Loop, Endloop, While X <= 10 do Sum, X, One, Ten, One Load Sum Output Halt Dec Dec Dec Dec 0 3 1 10arrow_forward
- 2) Write the following code segment in MARIE's assembly language. If X >= Y then X = X * 2 else Y = X - Y + Z;arrow_forwardWhat kind of processing, and what are the fundamental components of that processing, allows for the avoidance of empty calculation cycles when numerous instructions are sent through a computer processor at the same time? In your own words, describe what transpired as a result of their actions.arrow_forwardWrite a code segment in MARIE assembly language to do the following: If X<Y, then X=16*X; Else Y=16*X+Y. To call a subroutine which will do TEMP=16*X, and try to minimize the number of instructions when you write the subroutine.arrow_forward
- Learn to tell the difference between assembly and machine code.Remember to keep in mind the MIPS forms for instructions.arrow_forwardWrite an assembly program using MARIE that will do the following:Given three numbers (X, Y, and Z), find the product of X and Y (called PROD for reference)Using this product as a dividend, find the quotient and remainder when divided by Z as thedivisor.Use the values:X = 5, Y = 3, and Z = 4arrow_forwardWrite the following code segment in MARIE's assembly language. (HintX>1 is equivalent to X-1>0) :if X > 1 thenY = X + X;X = 0;endif;Y = Y + 1;arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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