You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

memrw.src 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. .page 'mem-rd,wrt
  2. ; memory access commands
  3. ; "-" must be 2nd char
  4. mem lda cmdbuf+1
  5. cmp #'-
  6. bne memerr
  7. ;
  8. lda cmdbuf+3 ; set address in temp
  9. sta temp
  10. lda cmdbuf+4
  11. sta temp+1
  12. ;
  13. ldy #0
  14. lda cmdbuf+2
  15. cmp #'R
  16. beq memrd ; read
  17. jsr killp ; kill protect
  18. cmp #'W
  19. beq memwrt ; write
  20. cmp #'E
  21. bne memerr ; error
  22. ; execute
  23. memex jmp (temp)
  24. memrd
  25. lda (temp),y
  26. sta data
  27. lda cmdsiz
  28. cmp #6
  29. bcc m30
  30. ;
  31. ldx cmdbuf+5
  32. dex
  33. beq m30
  34. txa
  35. clc
  36. adc temp
  37. inc temp
  38. sta lstchr+errchn
  39. lda temp
  40. sta cb+2
  41. lda temp+1
  42. sta cb+3
  43. jmp ge20
  44. m30
  45. jsr fndrch
  46. jmp ge15
  47. memerr lda #badcmd ; bad command
  48. jmp cmderr
  49. memwrt ; write
  50. m10 lda cmdbuf+6,y
  51. sta (temp),y ; transfer from cmdbuf
  52. iny
  53. cpy cmdbuf+5 ; # of bytes to write
  54. bcc m10
  55. rts
  56. ; .end