Don't you just hate it when you fall at the first hurdle? I'm trying to write something to the serial port on my D64. I know the port works because if I do a "POKE &HFF04,67", a letter C appears on my terminal (I've also checked with Chatview under Flex). So, inspired by Duncan's example on P337 of "Inside the Dragon", I wrote this to initialise my modem:
Code: Select all
CHARIN EQU $8006 ; Read a character
CHAROUT EQU $B54A ; Write a character
SERIN EQU $802A ; read serial
SEROUT EQU $802D ; write serial
SERPORT EQU $FF04 ; the raw port
org $5500
ldx #atcommand
writeloop lda ,x+
cmpa #$00
beq endprog
jsr SEROUT
bra writeloop
endprog rts
atcommand fcc /ATDTstuff/,$0D,$00
And, of course, when I run it, nothing happens! This is a D64 running Tormod's DLOAD ROM. What have I missed? If I replace SEROUT with CHAROUT, my code appears on the screen, so I know that's okay. It all looks okay under Xroar/GDB too (although I can't debug the serial port easily in Xroar). Utterly mystified.
Many thanks in advance!