Interfacing subroutines with parameter passing, Computer Engineering

Assignment Help:

Interfacing Subroutines with Parameter Passing

Let's now write a C program which calls the assembly program for parameter passing. Let's extend the previous two programs such that if on function call 0 is passed then cursor is turned off and if 1 is passed then cursor is turned on. Calling C program for such may look like:

# include < stdio.h 

voidcursw(int);

void main()

{

printf("%s\n", "the cursor is now turning off");

cursw(0); /* call to assembly routine with 0 as parameter

getchar();

printf("%s\n","the cursor is now turning on");

cursw(l); /* call to assembly routine with parameter as1.

   }

The variables in C or C + + are passed on the stack.


Related Discussions:- Interfacing subroutines with parameter passing

Define a technique of temporarily removing inactive program, is a technique...

is a technique of temporarily removing inactive programs from the memory of computer system? Swapping is a technique of temporarily eliminating inactive programs from the memor

Illustrate basic strategy used in raid, Q. Illustrate Basic strategy used i...

Q. Illustrate Basic strategy used in RAID? Basic strategy used in RAID is to replace large capacity disk drive with multiple smaller capacity disks. Data on these disks is dist

Show the mailing lists on internet, Q. Show the Mailing lists on Internet? ...

Q. Show the Mailing lists on Internet? Another exciting aspect about E-mail is that you can find groups of people who share your interests-whether you are inclined toward games

Write a program to read in a positive integer, Write a program to read in a...

Write a program to read in a positive integer and check whether it is prime or not? /* Program to check whether a given number is prime or not*/] # include # include

Advantages and disadvantages of shared memory programming, Q. Show Advantag...

Q. Show Advantages and Disadvantages of Shared Memory Programming? Advantages of Shared Memory Programming Data sharing between processes is both rapid and uniform bec

Unification algorithm - artificial intelligence, Unification Algorithm - Ar...

Unification Algorithm - Artificial intelligence: To merge two statements, we should get a substitution which forms the two sentences similar. Remember that we write V/T to sign

Instruction set design considerations, Some of the fundamental consideratio...

Some of the fundamental considerations for instruction set design includes selection of:  A set of data-types (For example: integers, long integers, doubles, character strin

Explain the trackball and thumbwheel devices, Explain the Trackball and Thu...

Explain the Trackball and Thumbwheel devices  Joysticks A joystick consists of a small, vertical lever (called the stick) mounted on a base that is used to steer the screen

Characteristics of a pipeline, What are the main characteristics of a pipel...

What are the main characteristics of a pipeline? Ans: The main characteristics of a pipeline are: a) The speedup or efficiency gain by suing a pipeline depends on the numbe

What are escape sequences characters, What are escape sequences characters?...

What are escape sequences characters? List any six of them.  The characters which when used with output functions like printf( ),putc(),put() etc. helps in formatting the outpu

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