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.

errorhandler 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. .PAG 'ERROR HANDLER'
  2. ;***************************************
  3. ;* STOP -- CHECK STOP KEY FLAG AND *
  4. ;* RETURN Z FLAG SET IF FLAG TRUE. *
  5. ;* ALSO CLOSES ACTIVE CHANNELS AND *
  6. ;* FLUSHES KEYBOARD QUEUE. *
  7. ;* ALSO RETURNS KEY DOWNS FROM LAST *
  8. ;* KEYBOARD ROW IN .A. *
  9. ;***************************************
  10. NSTOP LDA STKEY ;VALUE OF LAST ROW
  11. CMP #$7F ;CHECK STOP KEY POSITION
  12. BNE STOP2 ;NOT DOWN
  13. PHP
  14. JSR CLRCH ;CLEAR CHANNELS
  15. STA NDX ;FLUSH QUEUE
  16. PLP
  17. STOP2 RTS
  18. .SKI 5
  19. ;************************************
  20. ;* *
  21. ;* ERROR HANDLER *
  22. ;* *
  23. ;* PRINTS KERNAL ERROR MESSAGE IF *
  24. ;* BIT 6 OF MSGFLG SET. RETURNS *
  25. ;* WITH ERROR # IN .A AND CARRY. *
  26. ;* *
  27. ;************************************
  28. ;
  29. ERROR1 LDA #1 ;TOO MANY FILES
  30. .BYT $2C
  31. ERROR2 LDA #2 ;FILE OPEN
  32. .BYT $2C
  33. ERROR3 LDA #3 ;FILE NOT OPEN
  34. .BYT $2C
  35. ERROR4 LDA #4 ;FILE NOT FOUND
  36. .BYT $2C
  37. ERROR5 LDA #5 ;DEVICE NOT PRESENT
  38. .BYT $2C
  39. ERROR6 LDA #6 ;NOT INPUT FILE
  40. .BYT $2C
  41. ERROR7 LDA #7 ;NOT OUTPUT FILE
  42. .BYT $2C
  43. ERROR8 LDA #8 ;MISSING FILE NAME
  44. .BYT $2C
  45. ERROR9 LDA #9 ;BAD DEVICE #
  46. ;
  47. PHA ;ERROR NUMBER ON STACK
  48. JSR CLRCH ;RESTORE I/O CHANNELS
  49. ;
  50. LDY #MS1-MS1
  51. BIT MSGFLG ;ARE WE PRINTING ERROR?
  52. BVC EREXIT ;NO...
  53. ;
  54. JSR MSG ;PRINT "CBM I/O ERROR #"
  55. PLA
  56. PHA
  57. ORA #$30 ;MAKE ERROR # ASCII
  58. JSR BSOUT ;PRINT IT
  59. ;
  60. EREXIT PLA
  61. SEC
  62. RTS
  63. .END