home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 97 / 097.d81 / instr.s < prev    next >
Text File  |  2022-08-26  |  1KB  |  125 lines

  1. open =$ffc0
  2. readst =$ffb7
  3. setlfs =$ffba
  4. setnam =$ffbd
  5. load =$ffd5
  6. getin =$ffe4
  7. clrchn =$ffcc
  8. close =$ffc3   ;a
  9. chrin =$ffcf
  10. chkout =$ffc9  ;x
  11. chkin =$ffc6   ;x
  12. plot =$fff0
  13. chrout =$ffd2
  14. color'pointer =243
  15. screen'line'pointer =209
  16. print'number =$bdcd ;x,a
  17. clear'line =59903
  18. background =53281
  19. border =53280
  20. unlisten =$ffae
  21. clall =$ffe7
  22. loc1 =253
  23. loc2 =$22
  24.  
  25. .org $cd00
  26. .obj "instr cd00"
  27. jmp start
  28. jmp continue
  29.  
  30. start jsr get'string
  31. stx loc1
  32. sty loc1+1
  33. sta len1
  34.  
  35. jsr get'string
  36. sta len2
  37. stx orig
  38. sty orig+1
  39.  
  40. lda #0
  41. sta 251
  42.  
  43. lda len2
  44. sec
  45. sbc len1
  46. sta diff
  47.  
  48. lda len1
  49. cmp len2
  50. bcc search
  51. rts
  52.  
  53. search ldy #0
  54. loop lda (loc1),y
  55. and #127
  56. sta temp
  57. lda (loc2),y
  58. and #127
  59. cmp temp
  60. bne failed
  61. iny
  62. cpy len1
  63. bcc loop
  64. cmp temp
  65. beq +
  66.  
  67. rts
  68.  
  69. + lda loc2
  70. sec
  71. sbc orig
  72. clc
  73. adc #1
  74. sta 251
  75. cmp len2
  76. bcc +
  77. beq +
  78. lda #0
  79. sta 251
  80. + lda loc2
  81. sta storage
  82. lda loc2+1
  83. sta storage+1
  84. stx tempx
  85. rts
  86.  
  87. failed dex
  88. bne +
  89.  
  90. rts
  91.  
  92. + inc loc2
  93. bne +
  94. inc loc2+1
  95. + ldy #0
  96. jmp loop
  97.  
  98. continue lda #0
  99. sta 251
  100. lda storage
  101. sta loc2
  102. lda storage+1
  103. sta loc2+1
  104. ldx tempx
  105. bne failed
  106. rts
  107.  
  108. ;***** get string from BASIC ****
  109.  
  110. get'string jsr $aefd
  111. jsr $ad9e
  112. jsr $b6a3
  113.  
  114. ldx $22
  115. ldy $23
  116. rts
  117.  
  118. len1 .byt 0
  119. len2 .byt 0
  120. temp .byt 0
  121. diff .byt 0
  122. orig .word 0
  123. storage .byt 0,0
  124. tempx .byt 0
  125.