1: #include "../h/config.h"
2: #ifdef VAX
3: /* No csv type stuff on the VAX; the procedure call mechanism
4: * handles it all.
5: */
6: Global(_csv) # prevent null object module
7: #endif VAX
8:
9: #ifdef PORT
10: Global(_csv) # prevent null object module
11: #endif PORT
12:
13: #ifdef PDP11
14: / csv,cret - modified C calling sequence to save registers,
15: / restore on return, and clear Icon/C boundary on return
16: / to Icon code. This sequence performs the same function as the
17: / sequence in the C library, except for setting and clearing the
18: / boundary. When returning from C to Icon, arguments are popped.
19: Global(_boundary)
20: .globl csv, cret
21: csv:
22: tst _boundary / is call being made from Icon to C?
23: bne 1f / no, branch
24: mov sp,_boundary / yes, set boundary
25: 1:
26: mov r5,r0 / make new procedure frame
27: mov sp,r5
28: mov r4,-(sp)
29: mov r3,-(sp)
30: mov r2,-(sp)
31: jsr pc,(r0) / enter procedure
32:
33: cret:
34: cmp r5,_boundary / is return being made from C to Icon?
35: bne 1f / no, branch
36: clr _boundary / yes, clear boundary address
37: mov r5,sp / restore old procedure frame
38: mov -(r5),r4
39: mov -(r5),r3
40: mov -(r5),r2
41: mov (sp)+,r5
42: mov (sp)+,r1 / pop return pc
43: mov (sp)+,r0 / pop nargs
44: asl r0
45: asl r0
46: add r0,sp / pop all arguments
47: jmp (r1) / return to Icon procedure
48: 1:
49: mov r5,sp / restore old procedure frame
50: mov -(r5),r4
51: mov -(r5),r3
52: mov -(r5),r2
53: mov (sp)+,r5
54: rts pc / return to C procedure
55: #endif PDP11
Defined functions
cret
declared in line
20; defined in line
33; used 4 times
csv
declared in line
20; defined in line
21; used 3 times