home *** CD-ROM | disk | FTP | other *** search
/ Between Heaven & Hell 2 / BetweenHeavenHell.cdr / 500 / 471 / rccl189 < prev    next >
Text File  |  1987-03-02  |  2KB  |  54 lines

  1. /
  2. /  BOOT                 Adapted by   :  Vincent Hayward
  3. /                                       School of Electrical Engineering
  4. /                                       Purdue University
  5. /                       from unknown origin
  6. /       Dir     : boot
  7. /       File    : boot.s
  8. /       Remarks : This little bootstrap reads chars through the serial line
  9. /                 build words and path them into memory.
  10. /                 First word is word count, last is checksum
  11. /       Usage   : make install
  12. /
  13. /
  14.     .=077000^.
  15. start:  mov     $start,sp       / stack
  16.     mov     $177560,r1      / rcsr of 11 dl connection
  17.     mov     $177562,r3      / rbuf of 11 dl connection
  18.  
  19.     clr     r2              / chks = 0
  20.     clr     r5              / address = 0
  21.     jsr     pc,getw         / read WORD count into loc 0.
  22.     mov     -(r5),r4        / get word count, reset loc
  23. boot1:  jsr     pc,getw         / read word into mem.
  24.     add     -(r5),r2        / add chks
  25.     cmp     (r5),(r5)+      / advance loc
  26.     dec     r4              / can't use sob here...
  27.     bgt     boot1           / cdp doesn't have it
  28.     jsr     pc,getw         / get chks
  29.     sub     -(r5),r2         / is chks
  30.     bit     $77777,r2
  31.     beq     1f              / ok
  32.     0                       / halt
  33. 1:      mov     $7,6(r1)        / tell it's finished, ring a bell
  34.     jsr     pc,nap
  35.     mov     $76,6(r1)       / >
  36.     jsr     pc,nap
  37.     mov     $157,6(r1)      / o
  38.     jsr     pc,nap
  39.     mov     $153,6(r1)      / k
  40.     mov     $2000,pc        / goto loc 2000
  41.  
  42. getw:   tstb    (r1)            / read two bytes from host to mem
  43.     bpl    getw
  44.     movb    (r3),(r5)+      / low byte, directly to mem
  45. 1:      tstb    (r1)            / get second byte
  46.     bpl     1b
  47.     movb    (r3),(r5)+      / high byte
  48.     rts    pc
  49.  
  50. nap:    mov     $1000,r4        / time count
  51. 1:      dec     r4              / count down
  52.     bgt     1b
  53.     rts     pc
  54.