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 783B

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. .SKIP
  25. MEMRD
  26. LDA (TEMP),Y
  27. STA DATA
  28. LDA CMDSIZ
  29. CMP #6
  30. BCC M30
  31. ;
  32. LDX CMDBUF+5
  33. DEX
  34. BEQ M30
  35. TXA
  36. CLC
  37. ADC TEMP
  38. INC TEMP
  39. STA LSTCHR+ERRCHN
  40. LDA TEMP
  41. STA CB+2
  42. LDA TEMP+1
  43. STA CB+3
  44. JMP GE20
  45. M30
  46. JSR FNDRCH
  47. JMP GE15
  48. .SKIP
  49. MEMERR LDA #BADCMD ;BAD COMMAND
  50. JMP CMDERR
  51. .SKIP
  52. MEMWRT ;WRITE
  53. M10 LDA CMDBUF+6,Y
  54. STA (TEMP),Y ;TRANSFER FROM CMDBUF
  55. INY
  56. CPY CMDBUF+5 ;# OF BYTES TO WRITE
  57. BCC M10
  58. RTS
  59. .SKIP
  60. .END