Michael Grunditz wrote:
>> Frankly, I have no idea about Atari hardware. But I don't understand
>> what you're trying to do anyway, sorry.
> In lack of a proper source level debugger I would like to do printf
> like debugging. If it is possible to print to the serial port I can
> add loads of printouts to the modules / moduleloader.
Ah, I see. Well, this is how QMON accesses the hardware:
io_setup
lea io_mfptab,a0 ; set up mfp registers
lea at_mfp,a1
moveq #io_mfpend-io_mfptab-1,d0
io_mfp
move.b (a0)+,(a1)
addq.l #2,a1
dbra d0,io_mfp
rts
io_mfptab
dc.b 0 ; no output data
dc.b mfp.acte ; active edge
dc.b mfp.ddir ; data direction
dc.b 0,0,0,0,0,0,0,0 ; no interrupts
dc.b $68 ; software end of interrupt (should be automatic)
dc.b 0,0,1 ; no timers ABC and serial port D 9600
dc.b 0,0,0,2 ; no timers ABC and serial port D 9600
io_mfpend
ds.w 0
io_setio
moveq #$fffffff0,d0
and.b mfp_cdct+at_mfp,d0
addq.b #1,d0
move.b d0,mfp_cdct+at_mfp
move.b #2,mfp_ddat+at_mfp
move.b #mfp.npty+mfp.lstp+mfp.8bit+mfp.adiv,mfp_uctl+at_mfp ; set usart
; no parity, 1.5 stop bits, 8 bit async
move.b #mfp.rxen,mfp_rstt+at_mfp ; receiver enabled
move.b #mfp.txen,mfp_tstt+at_mfp ; transmitter enabled
bclr #mfp..rxi,mfp_rxe disable interrupts
bclr #mfp..txi,mfp_txe
bclr #mfp..rxi,mfp_rxm and mask
bclr #mfp..txi,mfp_txm
rts
*
* send string
*
io_ssprt
moveq #0,d1 ; set count
ioss_loop
tst.w d2 ; end of string?
ble.s io_ok
ioss_wait
btst #mfp..txr,mfp_tstt+at_mfp; check status
beq.s ioss_wait ; ... wait
btst #mfp..cts,mfp_cts ; clear to send
bne.s ioss_wait ; ... no
move.b (a1)+,mfp_sdat+at_mfp ; write output
subq.w #1,d2
addq.w #1,d1
bra.s ioss_loop ; ... next
io_ok
moveq #0,d0
rts
Marcel
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm