1: / C library -- nargs
   2: 
   3: / WARNING: this routine does not work
   4: / with user I&D space separate.
   5: / Moreover, due to a design botch in
   6: / the 11/45, it cannot be made to work
   7: / by adding mfpi instructions.
   8: 
   9: .globl  _nargs
  10: 
  11: _nargs:
  12:         mov     r5,-(sp)
  13:         mov     2(r5),r1                / pc of caller of caller
  14:         mov     sp,r5
  15:         clr     r0
  16:         cmp     -4(r1),jsrsd
  17:         bne     8f
  18:         mov     $2,r0
  19: 8:
  20:         cmp     (r1),tsti
  21:         bne     1f
  22:         add     $2,r0
  23:         br      2f
  24: 1:
  25:         cmp     (r1),cmpi
  26:         bne     1f
  27:         add     $4,r0
  28:         br      2f
  29: 1:
  30:         cmp     (r1),addi
  31:         bne     1f
  32:         add     2(r1),r0
  33:         br      2f
  34: 1:
  35:         cmp     (r1),jmpi
  36:         bne     1f
  37:         add     2(r1),r1
  38:         add     $4,r1
  39:         br      8b
  40: 1:
  41:         cmpb    1(r1),bri+1
  42:         bne     2f
  43:         mov     r0,-(sp)
  44:         mov     (r1),r0
  45:         swab    r0
  46:         ash     $-7,r0
  47:         add     r0,r1
  48:         add     $2,r1
  49:         mov     (sp)+,r0
  50:         br      8b
  51: 2:
  52:         asr     r0
  53:         mov     (sp)+,r5
  54:         rts     pc
  55: 
  56: .data
  57: jsrsd:  jsr     pc,*$0
  58: tsti:   tst     (sp)+
  59: cmpi:   cmp     (sp)+,(sp)+
  60: addi:   add     $0,sp
  61: jmpi:   jmp     0
  62: bri:    br      .

Defined functions

Defined variables

addi defined in line 60; used 1 times
  • in line 30
bri defined in line 62; used 1 times
  • in line 41
cmpi defined in line 59; used 1 times
  • in line 25
jmpi defined in line 61; used 1 times
  • in line 35
jsrsd defined in line 57; used 1 times
  • in line 16
tsti defined in line 58; used 1 times
  • in line 20
Last modified: 1975-05-14
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 602
Valid CSS Valid XHTML 1.0 Strict