CS401 Short Notes Chapter 16
- Type
- Quiz
- Course
- CS401 Computer Architecture and Assembly Language Programming
- Size
- PDF 189 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from page 1 of 1. Download the file for all 1 page.
CS401-ASSEMBLY LANGUAGE AND PROGRAMMING CS401 CHAPTER NO 16 (LECTURE 44)
👉 Also Recommended: CS401 SHORT NOTES CHAPTER 1-7 Midterm
Short Notes Chapter 16 (Lecture 44):
Calling conventions of the language:
To interface an assembly routine with a high-level language program means to be able to call functions back and forth. And to be able to do so requires knowledge of certain behavior of the HLL when calling functions. This behavior of calling functions is called the calling conventions of the language.
Two prevalent calling conventions are:
- the C calling convention &
- the Pascal calling convention
What is the naming convention?
C prepends an underscore to every function or variable name while Pascal translates the name to all uppercase. C++ has a weird name mangling scheme that is compiler dependent. To avoid it C++ can be forced to use C style naming with extern “C” directive.
How are parameters passed to the routine?
In C parameters are pushed in reverse order with the rightmost being pushed first. While in Pascal they are pushed in proper order with the leftmost being pushed first.
Which registers must be preserved?
Both standards preserve EBX, ESI, EDI, EBP, ESP, DS, ES, and SS.
Which registers are used as scratch?
Both standards do not preserve or guarantee the value of EAX, ECX, EDX, FS, GS, EFLAGS, and any other registers.
Which register holds the return value?
Both C and Pascal return up to 32-bit large values in EAX and up to 64-bit large values in EDX:EAX.
Who is responsible for removing the parameters?
In C the caller removes the parameter while in Pascal the callee removes them. The C scheme has reasons pertaining to its provision for variable number of arguments.
Related CS401 files
All CS401 files →- CS401 Highlighted Handouts Set 2 Highlighted PDF 1.5 MB
- CS401 Midterm Objective and Subjective Past Papers Midterm PDF 1.3 MB
- CS401 Solved Quiz 1 by Waqar Siddhu Quiz RAR 904 KB
- CS401 Short Notes Chapter 1 Quiz PDF 4.1 MB
- CS401 Short Notes Chapter 14 Quiz PDF 228 KB
- CS401 Short Notes Chapter 8 Quiz PDF 164 KB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.