home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1994 May / 1994-05a.d64 / makess.src (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  62 lines

  1. 100 print "source - makess - jim b"
  2. 110 end
  3. 120 *=$2000   ; program start addrs
  4. 130 start ldx #$01  ; from infile...
  5. 140  jsr $ffc6
  6. 150  jsr $ffe4      ; get character...
  7. 160  ldy $90        ; log end-of-file
  8. 170  php
  9. 180  pha
  10. 190  jsr $ffcc      ; disconnect infile
  11. 200  pla
  12. 205 ; put in(NULL) into x;
  13. 206 ; use a to stage modified (NULL)s
  14. 210  jsr $ffd2      ; print character
  15. 220  tax            ; copy to x reg
  16. 225 ; if it's <return>, output '_'
  17. 230  lda #$1f
  18. 240  cpx #$0d       ; if <return>
  19. 250  beq send       ; .. print it
  20. 260  txa
  21. 270  sec
  22. 280  sbc #$40       ; subtract 64..
  23. 290  bcc test2      ; < 64, skip
  24. 300  cpx #$60       ; 64 to 95 ..
  25. 310  bcc send       ; .. yes, send it
  26. 320  cpx #$a0       ; 96 to 159 ..
  27. 330  bcc test2      ; .. yes, skip
  28. 340  cpx #$c0       ; 160 to 191 ..
  29. 350  bcc send       ; .. yes, send it
  30. 355 ; not alpha-group character...
  31. 356 ; (64-95 or 160-191)...
  32. 358 ; test for 96-127; if found,
  33. 359 ; print [ (NULL) - 32 ]
  34. 360 test2 txa   ; this code at 202c
  35. 370  bmi test3  ; if 128 or higher
  36. 380  sec
  37. 390  sbc #$20   ; subtract 32
  38. 400  cpx #$60   ; 96 or higher ..
  39. 410  bcs send  ; .. yes, send it
  40. 415 ; not (NULL) 64-127 or 160-191
  41. 416 ; test for 0 - 64, 128-159
  42. 417 ; if found, print [ (NULL) ]
  43. 420 test3 txa   ; this code at 2036
  44. 430  cpx #$c0
  45. 440  bcc send
  46. 445 ; all that's left is 160-255
  47. 446 ; print [ chr - 128 ]
  48. 450  sbc #$80
  49. 460 send pha    ; at 203d, write file
  50. 470  ldx #$02
  51. 480  jsr $ffc9  ; select outfile
  52. 490  pla
  53. 500  jsr $ffd2  ; send char to file
  54. 510  jsr $ffcc
  55. 520  jsr $ffe1  ; check stop (NULL)
  56. 530  beq stop
  57. 540  plp        ; recall e-o-f signal
  58. 550  beq start  ; (NULL) if not eof
  59. 560  rts
  60. 570 stop plp    ; at 2053
  61. 580  rts
  62.