Question: 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'

 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

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

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 Databases Questions!