Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sample.eng.ohio-state.edu!purdue!mentor.cc.purdue.edu!piskacrj From: piskacrj@mentor.cc.purdue.edu (Robert J Piskac) Newsgroups: comp.sys.cbm Subject: Device Error Handling in Assembler Keywords: C= 128 disk drives Message-ID: <10494@mentor.cc.purdue.edu> Date: 16 Apr 91 04:35:13 GMT Organization: Purdue University Lines: 68 I am trying to learn how to handle disk drive errors. Like device not present, file not found and others. Where can i read up on how to handle these errors? The questions I have are why would I get an error after a jsr open was performed? Why would I get an error after a jsr chkin was performed? Where would a file not found error be discovered? How do I read the error channel after an error occurs, do I have to do any clean up before I read the error channel? I included a simple Assembler example that someone can rip apart and show me the correct way. If anyone can help me, I would be greatful! ;================================ slow = $77c7 fast = $77b3 setbnk = $ff68 setlfs = $ffba open = $ffc0 close = $ffc3 chkin = $ffc6 ckout = $ffc9 clrchn = $ffcc chrin = $ffcf readss = $ffb7 setnam = $ffbd istop = $ffe1 chrout = $ffd2 ;============================ start jsr fast jsr openfile rts ;============================ openfile lda #16 ldx #fname jsr setnam ldx #0 jsr setbnk lda #3 ldx #9 ldy #0 jsr setlfs jsr open bcs eofload ; Error in open ldx #3 jsr chkin bcs eofload ; Error in open channel for input jsr chrin pha jsr readss ; end of file or error bne 02$ jsr clrchn ldx #2 jsr ckout pla sta tmpchr jsr chrout jsr istop beq eofload ; stop key pressed 02$ pla eofload jsr clrchn lda #3 jsr close rts