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.

49 lines
448B

  1. .PAGE 'CHKSUM
  2. *= $BF00
  3. SEI
  4. LDX #$FF
  5. TXS
  6. CLD
  7. LDA #0
  8. STA CCHKSM
  9. CMP CCHKSM
  10. CHKPRO
  11. BNE CHKPRO
  12. LDA #$C0
  13. JSR GENCHK
  14. STA CCHKSM
  15. LDA #0
  16. STA ECHKSM
  17. CMP ECHKSM
  18. BNE CHKPRO
  19. LDA #$E0
  20. JSR GENCHK
  21. STA ECHKSM
  22. JMP *
  23. ;
  24. GENCHK ;.A=ADDRESS
  25. CLC
  26. PHA
  27. STA TEMP+1
  28. LDA #0
  29. STA TEMP
  30. LDX #32
  31. LDY #0
  32. CHK1
  33. ADC (TEMP)Y
  34. INY
  35. BNE CHK1
  36. ;
  37. INC TEMP+1
  38. DEX
  39. BNE CHK1
  40. ;
  41. ADC #0
  42. STA TEMP+1
  43. PLA
  44. SEC
  45. SBC TEMP+1
  46. SBC #0 ;.A=CHECKSUM BYTE
  47. RTS
  48. .END