Basic input -output library of subroutines, C/C++ Programming

Assignment Help:

GetChar - get a character from the keyboard, echo to the display and return it in reg al.

- Note: if a linefeed (LF) is received (Enter key), a carriage return (CR) will also be echoed.

PutChar - display a character passed in reg al.

The higher level routines which you will write call the above routines. They are:

GetStr - read a string from the keyboard and place it at the address passed in register AX.

- Note: you must delimit this string by placing a ‘at the end

GetNum - read an unsigned 16-bit decimal number (<65535) from the keyboard and return it in register AX.

- Note: for now, you do not need to do any error checking

- this means that you have to be careful when testing!

PutStr - display a string - address is passed in the AX reg

- Note: string passed must be delimited with a ‘

PutLine - display a string (address in AX) and also print CR/LF

- Note: this routine is written for you - it calls PutStr first

PutNum - display a 16 bit signed number passed in the AX reg

- Note: you did this in Lab 2 - you get to re-use code!

Note that since you will be using the AL or AX register to pass and return parameters, you do not save this register inside each subroutine. You must push (and pop) all other registers you use in each subroutine, however.

Be careful with labels since all of the subroutines will be in a single file. You cannot have a duplicate label. Use the convention shown in the subroutines given. Notice that each subroutine has 2 capital letters in the title and these letters are unique. For example, for the GetChar routine, these characters are GC. Precede every label inside this routine with GC (notice GCWait). In this way, you will not have any duplicate labels. You should also remember that the assembler is NOT case sensitive - we only use uppercase letters to improve the documentation. It is good practice to use a capital letter to begin every label.

Once again we will test these subroutines by writing a Main routine during the main lab. This routine will be more complicated; however, as we will display some interesting messages.


Related Discussions:- Basic input -output library of subroutines

Bitwise operations, Bitwise Operations 1. Write a function that has an ...

Bitwise Operations 1. Write a function that has an int parameter n, makes an integer mask having the bit 1 at the nth place from the rightmost bit, and returns the mask. For ex

Poker room auto seat program, Poker Room auto seat program Project Descr...

Poker Room auto seat program Project Description: I want a script for an online poker site. It requires to be scanning all the available tables and when the table meets certa

Declaration of variables in cpp, Declaration of Variables: Variables ar...

Declaration of Variables: Variables are declared as follows: int a; float b;   Assigning value to variables: int a = 100; Declaring and assigning is called ini

Using the substitution model illustrate the process, Each of the following ...

Each of the following two procedures defines a method for adding two positive integers in terms of the procedures inc, which increments its argument by 1, and dec, which decrements

Arrays, Write two different arrays. Store the names in it and then compare ...

Write two different arrays. Store the names in it and then compare if both the names entered by the user are the same.

If one won''t explicitly call the destructor of a local then , if one won't...

if one won't explicitly call the destructor of a local; then how does he handle the above situation?

C program for reverse the string , C Program for REVERSE THE STRING #i...

C Program for REVERSE THE STRING #include stdio.h> #include conio.h> #include string.h> void main() {           char name[30];           char *s;

Described friend?, A: Something to let your class to grant access to anothe...

A: Something to let your class to grant access to another class or function. Friends may be either classes or functions. Class grants access privileges to its friends. In genera

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd