home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / source / salloc / getwd.s < prev    next >
Encoding:
Text File  |  1975-05-13  |  747 b   |  57 lines

  1. .globl    getword
  2. .globl    putword
  3. .globl lookword
  4. .globl alterword
  5. .globl alterchar
  6. .globl    putchar
  7. .globl    lookchar
  8. .globl    w, r, a, l
  9. /
  10. /    routine to put a word onto the string
  11. /    mov    ...,r1
  12. /    mov    ...,r0
  13. /    jsr    pc,putword
  14. putword:
  15.     jsr    pc,putchar
  16.     swab    r0
  17.     jsr    pc,putchar
  18.     swab    r0
  19.     rts    pc
  20. /
  21. /
  22. /    routine to look at a word from the string
  23. /    mov    ...,r1
  24. /    jsr    pc,lookword
  25. /    mov    r0,...
  26. lookword:
  27.     jsr    pc,lookchar
  28.     bes    1f
  29.     movb    r0,nchar
  30.     inc    r(r1)
  31.     jsr    pc,lookchar
  32.     bes    1f
  33.     movb    r0,nchar+1
  34.     dec    r(r1)
  35.     mov    nchar,r0
  36. 1:    rts    pc
  37. /
  38. /
  39. /    routine to get a word from the strng
  40. /
  41. getword:
  42.     jsr    pc,lookword
  43.     bes    1f
  44.     add    $2,r(r1)
  45. 1:    rts    pc
  46. /
  47. /
  48. /    routine to alter a word in the string
  49. /
  50. alterword:
  51.     jsr    pc,alterchar
  52.     swab    r0
  53.     jsr    pc,alterchar
  54.     swab    r0 
  55.     rts    pc
  56. nchar:    .=.+2
  57.