Title: | Atari ST, TT, & Falcon |
Notice: | Please read note 1.0 and its replies before posting! |
Moderator: | FUNYET::ANDERSON |
Created: | Mon Apr 04 1988 |
Last Modified: | Tue May 06 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 1433 |
Total number of notes: | 10312 |
Hello friends, I'm trying to rpogram interrupts but get 2 bombs when I press a key. Here's what I'm doing: MOVE.L KBVECT,-(SP) ;Interrupt routine address MOVE.W #6,-(SP) ;Keyboard MOVE.W #13,-(SP) ;XBIOS MFPINT TRAP #14 ;XBIOS call ADDQ.L #8,SP ;Cleanup MOVE.W #6,-(SP) ;Enable keyboard interrupts MOVE.W #13,-(SP) ;XBIOS JENABINT TRAP #14 ;XBIOS Call ADDQ.L #4,SP ;Cleanup KBVECT: Some routine RTS I'm probably doing something very basically wrong but not being a programmer I don't see why I'm getting the bombs. Any help, in simple language please, would be greatly appreciated. Thanks. ...Howard
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
680.1 | Address rather than contents ? | 1075::FORSTER | Thu Nov 23 1989 06:03 | 13 | |
It may be a typo on your part, but shouldn't MOVE.L KBVECT,-(SP) be MOVE.L #KBVECT,-(SP) or PEA KBVECT | |||||
680.2 | ex | SUBURB::JAMESH | Nit Picking is my Business | Thu Nov 23 1989 08:03 | 5 |
Thanks for your reply. I took the instruction from the Abacus ST Internals page 178 which actually shows: move.l vector,-(sp). I'll try again tonight with #KBVECT. Thanks again. ...Howard | |||||
680.3 | Not so easy | HAM::LITSCH | Fri Nov 24 1989 06:23 | 31 | |
Hello Howard! Creating an own interrupt service routine is especially difficult for the ST. Besides the problem mentioned in the previous reply, there are more of them: - The BIOS already uses interrupt-driven keyboard-input. If you change that vector, you essentially disable all standard keyboard input. - Not only keystrokes, but also mouse, joystick, and keyboard-clock send data through the very same line, so you have to handle them as well. - The 6850s for keyboard and MIDI share the same interrupt line, you have to handle them both. - It may happen that another input arrives while you are handling the current one. This will NOT create another interrupt because of the edge-triggered nature of them. You have to do a loop until there is no more data in any of the 6850s. Another bug in your code: Interrupt routines have to end using RTE, not RTS. Watch out for this: ALL registers (except SR, the 68k handles this for you) MUST be restored to their old values before leaving the routine, so use > KBVECT: movem.l d0-d7/a0-a6,-(a7) > Some routine > movem.l (a7)+,d0-d7/a0-a6 > RTS Depending of your use of registers you may leave out the unaltered ones in the movem instructions. Jens |