danwinslow Posted December 13, 2005 Share Posted December 13, 2005 (edited) In this snippet of code ( the comments are mine ) : SENDBYT TAX ; save char to be sentWPUT LDA IRQST ; loop AND #$10 ; until serial output data needed is true ( i.e., send completed ) BNE WPUT ; end loop LDA #$EF ; 1110 1111 STA IRQEN ; enable everything except serial output data needed (?) LDA #$D0 ; 1101 0000 STA IRQEN ; disable serial input data needed and timer interrupts TXA ; put send char back in A STA SEROUT ; put it (again) into xmit slot LDX IRQST ; load IRQ status BPL ERR128 ; if N=0 goto ERR128 ( checking for break key? ) The BPL at the end looks like it is trying to detect a break key press..the preceding LDX from IRQ status would have bit 7 set if a break keypress had occured...which would cause the N flag to be *set*, not cleared...so the BPL seems like it is wrong. So what am I missing? Edited December 13, 2005 by danwinslow Quote Link to comment Share on other sites More sharing options...
DanBoris Posted December 13, 2005 Share Posted December 13, 2005 The bits in IRQST get set to 0 when the specific event occurs, not 1. So when the break key is pressed, bit 7 will be 0. Dan Quote Link to comment Share on other sites More sharing options...
danwinslow Posted December 13, 2005 Author Share Posted December 13, 2005 (edited) I was wondering about that. The docs I have say otherwise, but obviously they are not correct, or I didn't read them correctly. Thanks. Edited December 13, 2005 by danwinslow Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.