1: /
   2: /
   3: 
   4: / fx9 -- code
   5: 
   6: /	jsr	r5,code; <string\0>; .even
   7: /		arg1
   8: /		arg2
   9: /		...
  10: /
  11: / args specified by %<c> in string.
  12: /   %s:  string
  13: /   %d:  decimal number
  14: /   %o:  octal number
  15: /   %c:  character
  16: /
  17: / args are addresses
  18: / or registers r0-r4
  19: 
  20: .globl  code
  21: 
  22: .globl  putc
  23: .globl  getname
  24: 
  25: code:
  26:         mov     r4,-(sp)
  27:         mov     r3,-(sp)
  28:         mov     r2,-(sp)
  29:         mov     r1,-(sp)
  30:         mov     r0,-(sp)
  31:         mov     r5,r4
  32: 1:
  33:         tstb    (r5)+
  34:         bne     1b
  35:         inc     r5
  36:         bic     $1,r5
  37: 1:
  38:         movb    (r4)+,r0
  39:         beq     1f
  40:         cmp     r0,$'%
  41:         beq     2f
  42:         jsr     r5,putc; obuf
  43:         br      1b
  44: 2:
  45:         movb    (r4)+,r0
  46:         beq     1f
  47:         cmp     r0,$'s
  48:         beq     cstr
  49:         cmp     r0,$'c
  50:         beq     cchr
  51:         cmp     r0,$'d
  52:         beq     cdec
  53:         cmp     r0,$'o
  54:         beq     coct
  55:         cmp     r0,$'n
  56:         beq     cnam
  57:         jsr     r5,putc; obuf
  58:         br      1b
  59: cnam:
  60:         jsr     pc,cget
  61:         mov     r1,r3
  62:         jsr     r5,getname
  63:         mov     $symbuf,r1
  64:         br      2f
  65: cstr:
  66:         jsr     pc,cget
  67: 2:
  68:         movb    (r1)+,r0
  69:         beq     1b
  70:         cmp     r0,$'\n
  71:         beq     2b
  72:         jsr     r5,putc; obuf
  73:         br      2b
  74: cchr:
  75:         jsr     pc,cget
  76:         mov     r1,r0
  77:         jsr     r5,putc; obuf
  78:         mov     r1,r0
  79:         clrb    r0
  80:         swab    r0
  81:         beq     1b
  82:         jsr     r5,putc; obuf
  83:         br      1b
  84: coct:
  85:         jsr     pc,cget
  86:         mov     $8.,r2
  87:         br      2f
  88: cdec:
  89:         jsr     pc,cget
  90:         mov     $10.,r2
  91: 2:
  92:         jsr     pc,2f
  93:         br      1b
  94: 2:
  95:         clr     r0
  96:         dvd     r2,r0
  97:         mov     r1,-(sp)
  98:         mov     r0,r1
  99:         beq     2f
 100:         jsr     pc,2b
 101: 2:
 102:         mov     (sp)+,r0
 103:         add     $'0,r0
 104:         jsr     r5,putc; obuf
 105:         rts     pc
 106: 1:
 107:         mov     (sp)+,r0
 108:         mov     (sp)+,r1
 109:         mov     (sp)+,r2
 110:         mov     (sp)+,r3
 111:         mov     (sp)+,r4
 112:         rts     r5
 113: 
 114: cget:
 115:         mov     (r5)+,r1
 116:         cmp     r1,$4
 117:         blos    1f
 118:         rts     pc
 119: 1:
 120:         asl     r1
 121:         add     $2,r1
 122:         add     sp,r1
 123:         mov     (r1),r1
 124:         rts     pc

Defined functions

cchr defined in line 74; used 1 times
  • in line 50
cdec defined in line 88; used 1 times
  • in line 52
cget defined in line 114; used 5 times
cnam defined in line 59; used 1 times
  • in line 56
coct defined in line 84; used 1 times
  • in line 54
code declared in line 20; defined in line 25; used 4 times
cstr defined in line 65; used 1 times
  • in line 48
Last modified: 1975-07-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 488
Valid CSS Valid XHTML 1.0 Strict