1: / moo
   2: 
   3:         jsr     r5,mesg; <MOO\n\0>; .even
   4: 
   5: game:
   6:         jsr     r5,mesg; <new game\n\0>; .even
   7:         mov     $act,r1
   8: 1:
   9:         movb    $-1,(r1)+
  10:         cmp     r1,$act+4.
  11:         bne     1b
  12:         mov     $act,r1
  13: 1:
  14:         jsr     r5,rand; 10.
  15:         mov     $act,r2
  16: 2:
  17:         cmpb    r0,(r2)+
  18:         beq     1b
  19:         cmp     r2,$act+4
  20:         bne     2b
  21:         movb    r0,(r1)+
  22:         cmp     r1,$act+4
  23:         bne     1b
  24:         clr     nguess
  25:         jmp     loop
  26: 
  27: error:
  28:         jsr     r5,mesg; <bad guess\n\0>; .even
  29:         mov     $ibuf,r1
  30: 1:
  31:         cmpb    (r1)+,$'\n
  32:         beq     loop
  33:         cmp     r1,$ibuf+5
  34:         bne     1b
  35: 1:
  36:         jsr     pc,flush
  37: 
  38: loop:
  39:         clr     ncows
  40:         clr     nbulls
  41:         jsr     r5,mesg; <? \0>; .even
  42:         clr     r0
  43:         mov     $ibuf,r1
  44: 1:
  45:         movb    $-1,(r1)+
  46:         cmp     r1,$ibuf+5
  47:         bne     1b
  48:         mov     $ibuf,r1
  49: 1:
  50:         jsr     pc,getc
  51:         movb    r0,(r1)
  52:         sub     $'0,r0
  53:         cmp     r0,$10.
  54:         bhis    error
  55:         mov     $ibuf,r2
  56: 2:
  57:         cmpb    r0,(r2)+
  58:         beq     error
  59:         cmp     r2,$ibuf+4
  60:         bne     2b
  61:         movb    r0,(r1)+
  62:         mov     $act,r2
  63: 2:
  64:         cmpb    r0,(r2)+
  65:         bne     3f
  66:         inc     ncows
  67: 3:
  68:         cmp     r2,$act+4
  69:         bne     2b
  70:         cmp     r1,$ibuf+4
  71:         bne     1b
  72:         jsr     pc,getc
  73:         cmp     r0,$'\n
  74:         bne     error
  75:         mov     $ibuf,r1
  76:         mov     $act,r2
  77: 1:
  78:         cmpb    (r1)+,(r2)+
  79:         bne     2f
  80:         inc     nbulls
  81:         dec     ncows
  82: 2:
  83:         cmp     r1,$ibuf+4
  84:         bne     1b
  85:         mov     nbulls,r0
  86:         jsr     pc,decml
  87:         jsr     r5,mesg; < bulls; \0>; .even
  88:         mov     ncows,r0
  89:         jsr     pc,decml
  90:         jsr     r5,mesg; < cows\n\0>; .even
  91:         cmp     nbulls,$4
  92:         beq     1f
  93:         inc     nguess
  94:         jmp     loop
  95: 1:
  96:         mov     nguess,r0
  97:         jsr     pc,decml
  98:         jsr     r5,mesg; < guesses\n\n\0>; .even
  99:         jmp     game
 100: 
 101: act:    .=.+4
 102: ibuf:   .=.+6
 103: ncows:  .=.+2
 104: nbulls: .=.+2
 105: nguess: .=.+2

Defined functions

act defined in line 101; used 9 times
error defined in line 27; used 3 times
game defined in line 5; used 1 times
  • in line 99
ibuf defined in line 102; used 10 times
loop defined in line 38; used 3 times
nbulls defined in line 104; used 4 times
ncows defined in line 103; used 4 times
nguess defined in line 105; used 3 times
Last modified: 1987-08-04
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1784
Valid CSS Valid XHTML 1.0 Strict