0% found this document useful (0 votes)
53 views

COAL Assignment 3

This document provides instructions for three assembly language programming assignments. Assignment 1 asks students to write a subroutine that trims occurrences of one string from another on the video screen. Assignment 2 asks students to write a procedure to copy a given screen area to the center of the screen without a temporary array. Assignment 3 asks students to update a strcmp subroutine to return 0 if strings are equal, -1 if the first is smaller, and 1 if the first is greater.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

COAL Assignment 3

This document provides instructions for three assembly language programming assignments. Assignment 1 asks students to write a subroutine that trims occurrences of one string from another on the video screen. Assignment 2 asks students to write a procedure to copy a given screen area to the center of the screen without a temporary array. Assignment 3 asks students to update a strcmp subroutine to return 0 if strings are equal, -1 if the first is smaller, and 1 if the first is greater.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Assembly Language (F&R)

(A, B, C)
Fall 2017
Assignment-3
Submission: Wednesday 1st November (on xeon until labs are open)

(On String Instructions and Video Memory)

Question 1:
Write a subroutine Trimmer that trims all the occurrences of string2 from string1 printed on video
screen. The subroutine takes the following parameters (in same order):
i. Row number where string 1 is printed on screen
ii. Column number where string 1 is printed on screen
iii. Length of string 1
iv. Offset (i.e. address) of string 2 in data segment

You can safely assume that String2 length is less than String1 length. You would have to calculate the
length of string 2 yourself. For example:
String 1 (on video screen): Hello world
String 2 (defined in ds): wor
After this subroutine string1 becomes:
Hello ldrld
(You can create other subroutines as well.)

Question 2:
Write a near procedure to copy a given area on the screen at the center of the screen without using a
temporary array. The routine will be passed top, left, bottom, and right in that order through the stack.
The parameters passed will always be within range the height will be odd and the width will be even so
that it can be exactly centered.

Question 3:
Update the strcmp subroutine of book, such that it returns 0 of two strings are equal, -1 if string 1 is
smaller than string 2 and 1 if string 1 is greater than string 2. (Strings are defined in data segment.)

You might also like