Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PREVIOUS LAB - 5/4/3 - CONTINUE FROM THIS CODE with comments! section .text global _start _start: mov y,0 mov x,0 call sum sum: mul y,'160'

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

PREVIOUS LAB - 5/4/3 - CONTINUE FROM THIS CODE with comments!

section .text

global _start

_start:

mov y,0

mov x,0

call sum

sum:

mul y,'160'

mul x,'2'

add y,x

mov loc,y

mov y,'1000'

sub y,'1'

div loc,'8'

div y,'4'

mov a,y

div y,'100'

mov b,y

add a,b

add loc,y

add a,loc

mov sum,a

mov dx,0

mov ax,sum

mov bx,7

div bx

add dx,5

mov w,dx

ret

section .data

x dw

y dw

loc dd 0

w dw 0

sum dw 0

msg db "The output is:", 0xA,0xD

Purpose: The main purpose of this lab assignment is to demonstrate understanding of how to use procedures (subroutines). Another objective is to learn how to handle multiple decimal digits that have to be collected from the keyboard or displayed on the screen. It requires modification of the previous labs 3, 4, and 5 You have up to 2 weeks to complete this lab Introduction: In lab 3 you learned how to output ASCII values to the screen. In lab4 you learned how to input ASCII decimal digits from the keyboard. In lab5 you learned how to deal with procedures. Although you were asked to Procedures typically are passed parameters (if needed) before they are called. The output of the procedure can also be a parameter if necessary. In Intel Assembly parameters can be passed via registers or the stack. In this assignment you can use either method to pass parameters Requirements: Modify Labs 3, 4, and 5 as follows 1) LAB3: Use the complete algorithm for outputting multiple decimal digits to the screen. It involves converting binary number to decimal digits 2) LaB4: Implement complete algorithm for inputting decimal digits from the keyboard. These digits must be converted to binary number 3) LAB5: We want to see better modularity of procedures via proper parameter passing. No procedure should access parameters via global variables. Parameters can be passed by value or by reference as needed. 4) Program stays in a loop until q' uit) key is pressed. Purpose: The main purpose of this lab assignment is to demonstrate understanding of how to use procedures (subroutines). Another objective is to learn how to handle multiple decimal digits that have to be collected from the keyboard or displayed on the screen. It requires modification of the previous labs 3, 4, and 5 You have up to 2 weeks to complete this lab Introduction: In lab 3 you learned how to output ASCII values to the screen. In lab4 you learned how to input ASCII decimal digits from the keyboard. In lab5 you learned how to deal with procedures. Although you were asked to Procedures typically are passed parameters (if needed) before they are called. The output of the procedure can also be a parameter if necessary. In Intel Assembly parameters can be passed via registers or the stack. In this assignment you can use either method to pass parameters Requirements: Modify Labs 3, 4, and 5 as follows 1) LAB3: Use the complete algorithm for outputting multiple decimal digits to the screen. It involves converting binary number to decimal digits 2) LaB4: Implement complete algorithm for inputting decimal digits from the keyboard. These digits must be converted to binary number 3) LAB5: We want to see better modularity of procedures via proper parameter passing. No procedure should access parameters via global variables. Parameters can be passed by value or by reference as needed. 4) Program stays in a loop until q' uit) key is pressed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming Languages 12th International Symposium Dbpl 2009 Lyon France August 2009 Proceedings Lncs 5708

Authors: Philippa Gardner ,Floris Geerts

2009th Edition

3642037925, 978-3642037924

Students also viewed these Databases questions