UMBC CMSC 313, Computer Organization & Assembly Language, Fall 2004, Section 0101
The Stack & C Functions II
Thursday 10/14, 2004
Assigned Reading in Murdocca & Heuring: 7.7
Assigned Reading in Neveln: 8.1-8.8
Slides (in PDF): Slides13.pdf
- 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
- Virtual memory by paging.
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:
20 Oct 2004 00:52:16 EDT
to Fall 2004 CMSC 313 Section Homepage