| ECE291 | Computer Engineering II | J. W. Lockwood |
extern void far MYSUB( int , int ); |
| C Variable Type | # of Bytes | char | 1 | int, short, near* | 2 | long, far* | 4 |
|---|
CL /c sub.c
|
MYSUB( int x , int y ) { .. } |
| Value | Notes |
|---|---|
| 2222h | Right-most variable pushed first |
| 6666h | Left-most variable pushed last |
| Value | Notes |
|---|---|
| CS | Return Address (FAR) |
| IP |
| Mem | Value | Notes |
|---|---|---|
| [BP+8] | 22 | Right-most parameter |
| [BP+6] | 66 | Left-most parameter |
| [BP+4] | CS | Return Address (FAR) |
| [BP+2] | IP | |
| [BP] | BP' | Old value of BP |
|
CSUB(int x , int y) { int i = 77; ... } |
|
MYSUB PROC NEAR ... SUB SP,2 MOV [BP-2],77 ... MYSUB ENDP |
| Mem | Value | Notes |
|---|---|---|
| [BP-2] | 77 | Local Variable |
_MYSUB
PUBLIC _MYSUB
MASM mysub.asm,,;