reeder@reed.UUCP (Doug Reeder) (05/26/91)
I am working on an assembly program that uses vertical blanking
interrupts. It works fine on IIc's and IIe's with mouse cards, but it
crashes badly when I try to run it on a gs. It crashes immediately upon
running. It's not a slot location problem, and I disable interrupts before
calling the mouse firmware. It even works on an LC IIe emulator. What
should I be looking for in the way of differences between VBL (and/or mouse
routines) on 8bit and 16bit machines? I have consulted all of the Tech
notes listed in the index under the topic VBL. Thanks for any help!
* this code is written in the ORCA/M dialect of 65C02 assembler and is
* a fragment, not a complete program.
ptr gequ $6
stz ptr
lda #$C7 ;slot 7
sta ptr+1
checkcard anop
ldy #$0C
nextloc anop
lda (ptr),y
sta buffer,y
dey
bne nextloc
lda buffer+$05
cmp #$38
bne nextcard
lda buffer+$07
cmp #$18
bne nextcard
lda buffer+$0B
cmp #$01
bne nextcard
lda buffer+$0C
cmp #$20 ;mouse
bne nextcard
bra FoundCard
nextcard anop
dec ptr+1
lda ptr+1
cmp #$C0
bne checkcard
jmp PrintErr
FoundCard anop
lda ptr+1 ;this is slotX
sta slotX
sta SetMouse+2
sta ServeMouse+2
sta ReadMouse+2
sta InitMouse+2
and #%00001111
sta slot
asl a
asl a
asl a
asl a
sta slotY
; jsr PrintByte
; jsr CROut
lda #$12
sta ptr
lda (ptr)
sta SetMouse+1
inc ptr
lda (ptr)
sta ServeMouse+1
inc ptr
lda (ptr)
sta ReadMouse+1
lda #$19
sta ptr
lda (ptr)
sta InitMouse+1
*
* set up interrupt handler
lda #2
sta INT_PL
ALLOC INT_PL
bcc SetSSC
jsr PrintByte
jmp PrintErr
* set up card to generate interrupts
SetSSC anop
sei
ldx slotX
ldy slotY
jsr InitMouse
ldx slotX
ldy slotY
lda #$08
jsr SetMouse
cli
* start main loop
jmp main
* variables (none at present)
end
**************************** Mouse Interrupt Handler
MouseInt start
using common
; using TrigTables
StatusByte equ $778 ;indexed by slot
cld
INC2 $300
jsr ServeMouse
bcc FromMouse
rts ;carry bit already set
FromMouse anop
ldx slot
lda #%00001000 ;VBL Interrupt
bit StatusByte,x
bne IsVBL
clc
rts
IsVBL anop
* the meat of the interrupt routine goes here
;ExitInt anop
clc
rts
--
Doug Reeder USENET: ...!tektronix!reed!reeder
Internet: reeder@reed.EDU BITNET: reeder@reed.BITNET
I'm looking for a grad school or a job as a research assistant where I can work
on tethers for space propulsion or robotics, in particular, walking machines.