1: /*	@(#)fmcrt0.s	2.1	SCCS id keyword	*/
   2: / C runtime startoff including monitoring
   3: 
   4: cbufs   = 300.
   5: exit    = 1.
   6: write   = 4.
   7: signal  = 48.
   8: 
   9: .globl  _monitor
  10: .globl  _sbrk
  11: .globl  _main
  12: .globl  _exit
  13: .globl  _environ
  14: .globl  _etext
  15: .globl  __cleanup
  16: .globl  countbase
  17: .globl  fptrap
  18: 
  19: 
  20: start:
  21:         sys     signal; 4; fptrap
  22:         setd
  23:         mov     2(sp),r0
  24:         clr     -2(r0)
  25:         mov     sp,r0
  26:         sub     $4,sp
  27:         mov     4(sp),(sp)
  28:         tst     (r0)+
  29:         mov     r0,2(sp)
  30: 1:
  31:         tst     (r0)+
  32:         bne     1b
  33:         cmp     r0,*2(sp)
  34:         blo     1f
  35:         tst     -(r0)
  36: 1:
  37:         mov     r0,4(sp)
  38:         mov     r0,_environ
  39: 
  40:         mov     $_etext,r1
  41:         sub     $eprol,r1
  42:         add     $7,r1
  43:         ash     $-3,r1
  44:         bic     $!17777,r1
  45:         mov     $cbufs,-(sp)
  46:         add     $3*[cbufs+1],r1
  47:         mov     r1,-(sp)
  48:         asl     r1
  49:         mov     r1,-(sp)
  50:         jsr     pc,_sbrk
  51:         tst     (sp)+
  52:         cmp     r0,$-1
  53:         beq     9f
  54:         mov     r0,-(sp)
  55:         add     $6,r0
  56:         mov     r0,countbase
  57:         mov     $_etext,-(sp)
  58:         mov     $eprol,-(sp)
  59:         jsr     pc,_monitor
  60:         add     $10.,sp
  61:         jsr     pc,_main
  62:         cmp     (sp)+,(sp)+
  63:         mov     r0,(sp)
  64:         jsr     pc,_exit
  65: 
  66: 9:
  67:         mov     $2,r0
  68:         sys     write; 8f; 9f-8f
  69: 
  70: .data; 8: <No space for monitor buffer\n>; 9:.even; .text
  71: 
  72: _exit:
  73:         mov     r5,-(sp)
  74:         mov     sp,r5
  75:         jsr     pc,__cleanup
  76:         clr     -(sp)
  77:         jsr     pc,_monitor
  78:         tst     (sp)+
  79:         mov     4(r5),r0
  80:         sys     exit
  81: eprol:
  82: .bss
  83: _environ:
  84:         .=.+2
  85: countbase:
  86:         .=.+2
  87: .data
  88:         .=.+2

Defined functions

_exit declared in line 12; defined in line 72; used 2 times
cbufs defined in line 4; used 2 times
eprol defined in line 81; used 2 times
exit defined in line 5; used 1 times
  • in line 80
signal defined in line 7; used 1 times
  • in line 21
start defined in line 20; never used
write defined in line 6; used 1 times
  • in line 68

Defined variables

_environ declared in line 13; defined in line 83; used 11 times
countbase declared in line 16; defined in line 85; used 2 times
Last modified: 1981-07-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 830
Valid CSS Valid XHTML 1.0 Strict