UMBC CMSC 313, Computer Organization & Assembly Language, Fall 2004, Section 0101
The Stack & C Functions II
Thursday 10/14, 2004
[Up]
[Previous Lecture]
[Next Lecture]
Assigned Reading in Murdocca & Heuring: 7.7
Assigned Reading in Neveln: 8.1-8.8
Assigned: Proj4
Due: Proj3
Slides (in PDF): Slides13.pdf
Topics Covered:
- Discussed Project 3.
- Discussed Project 4.
- Examples of assembly language programs calling the C
printf() function. (Note the use of gcc to link and load
the resulting program.)
- An example of a function implemented in assembly language
that is called by a C main program.
- Read the web page on the stack
and C functions for full coverage.
- The storage hierarchy consisting of registers, cache, main
memory (RAM), secondary storage (hard disk) and off-line storage
(tape) and trade-offs between cost and speed.
- Problems with memory management: not enough RAM, memory protection
and fragmentation.
- Virtual memory by paging.
Programs shown:
Programs not shown:
- An example of a C function that returns a value that takes
up more than 4 bytes. The mechanism is to pass a pointer to
a memory location (on the stack) to hold the return value.
Note also the use of the variation of the RET instruction
which takes an operand:
cfunc3.c and
cfunc3-edited.asm
(comments added).
Last Modified:
22 Jul 2024 11:29:42 EDT
by
Richard Chang
to Fall 2004 CMSC 313 Section Homepage