"A. Luna" wrote: > Hello all. > > Can anyone point me in the right direction where I may find information on > programming/controlling the Apple Super Serial Card via 6502 Assembly Language? > > Thanks in advance for any help you can provide! > > Art... Art, If you are using a 6551 ACIA, you need 4 contigious locations some where in the memory map. fetch these gifs: http://www.6502.org/datazip/6551.zip and/or http://www.6502.org/datazip/g65sc51f.zip Here is an early rev of an SSC driver I hashed out, its rough, does not use most of the variables declared, and may contain a few name space bugs. * * serial drivers * * written in ORCA/M * ssc.dvr * beta() 010192 20:44:59 rev 1 * 021792 16:35:53 rev 2 * 030392 02:22:47 rev 3 * * Super Serial Card driver routines * * rev 1 (written on the fly while waiting for an interview) * rev 2 remove indexed access and went with direct access and * added the slot changer routine * rev 3 added in interrupt processor * Notes: * * The SSC is run with receive interupts and will heed CTS * the SSC must assert RTS to enable the transmitter * THE SSC does not do DCD correctly, the 6551(A and 65c51) does, with the * SSC we normally use DSR to monitor/emulate DCD. * the DTR routine sets the command register * the setbps routine sets the control register * standard stuff = 65c02 off 65816 off keep sscdvr org DriverOrigin * SSC driver routines * copyright 1991 beta() * * * serial/network * serial drivers for a SSC (or fully compatible clone) in any A2 slot. * Basic driver services are a interrupt driven ring input buffer. * * * zero page and other required memory areas * temp gequ $8006 temp2 gequ $8007 dcdstatus gequ $8008 Head gequ $8009 Input ring buffer pointers Tail gequ $800a Size gequ $800b status gequ $800c current status flags ctlflag gequ $800d both gequ $800e LOSTCALL gequ $800f PortStatus gequ $8010 * addresses are preset to slot 2, so you need not do a slot command * if its loaded with a ssc in slot 2 SSCSTATUS gequ $c0A9 ssc status register SSCDATA gequ $c0A8 ssc data register SSCCMD gequ $c0Aa ssc command register SSCCTL gequ $c0Ab ssc control register hangup gequ $8000 set to the address of the hangup routine RingBuffer data ds 256 end ssc start the ssc driver stuff jmp init init serial port jmp rread raw read a byte jmp rwrite raw write a byte jmp dcd check for dcd jmp dtr control dtr jmp setbps set bit rate jmp setslot set slot parameters jmp do_interrupt process interrupt end end of jump table * * init () * * initialize the ssc, setup default parameters and interupt routine * clear all state flags and status, installer patched for defaults * init start using ssc_data sei stop interupts lda #$05 set bps to 9600 (initial) jsr setbps clc jsr dtr drop dtr and init 6551 ldy #0 initclr jsr rread read status/data to clr dey 256 times... bne initclr sty Head zero ring buffer head/tail/size sty Tail sty Size cli restart interupts sec jmp dtr assert DTR end * * rread (a: byte) * * raw read a byte into A from the SSC * rread start xstat1 entry lda SSCSTATUS see if a char is ready to be read and #%00001000 is char there to read? clc default is no beq nocready xdata1 entry lda SSCDATA get the char into a sec we got one nocready rts end * * rwrite (a:byte) * * raw write a byte in A to the SSC * * note: can be locked if the xmit register is never cleared * also does not support any handshaking, will always try to send the char * rwrite start pha save the char xstat2 entry wrdy lda SSCSTATUS check xmit register status and #%00010000 beq wrdy pla get the char to send xdata2 entry sta SSCDATA send it rts end * * setbps (a:byte) * * set bit rate, a is a index into the table: * 0,300,600,1200,2400,4800,9600,19200,38400,0,0,0,0,0,0,0 * where the bps is 300*(the index value) * if the value is declared as "0" (zero) then drop dtr and reset to default * setbps start using ssc_data cmp #0 check for a zero (hangup command) bne bps jsr hangup hangup and re-init jmp init bps ror a move lsb into carry and #$7 remove all unneeded bits tax set x to index lda bpstbl,x get byte from table bcs skipror if C = 0 pick hi-nibble ror a ror a ror a ror a move hi-nibble to working position skipror and #$0f remove unused bits ora #$10 set internal baud rate flag xctl1 entry sta SSCCTL set new speed rts end * * dcd (status:carry) * * check for the presence of DCD on the serial port * note that the serial drivers use the DSR line to monitor the DCD signal * so you either need a cable moving the DCD signal to the DSR input on the * SSC (along with the DSR signal to the DCD input) or you need to * program your modem to have DCD asserted all the time '(& C0)' and have DSR * track the presence of carrier signal '(& S1)' * * note IF either DCD or DSR become de-asserted the system will think you are * offline, also note that you can still fool the state machine to thinking * you are online of you want * dcd start using ssc_data xstat3 entry lda SSCSTATUS fetch the current status altdcd entry and #%01100000 mask all but the DCD/DSR bits beq online if BOTH are clear, we're online NoDCD lda #%10000000 set carrier loss flag ora dcdstatus sta dcdstatus sec we lost them online rts end * * DTR (carry:flag) * * DTR set/reset DTR * if carry is clear then de-assert DTR * if carry is set then assert DTR * dtr start lda #$08 clear dtr bit adc #$0 set dtr if carry set xcmd1 entry sta SSCCMD rts end * * do_Interrupt * process interupt chain, call inbound if its ours * return to prodos if it isint (-- may change to eat it instead) * do_interrupt start cld needed for ProDOS php save A/P registers pha we are in interupt processing xstat4 entry lda SSCSTATUS get status info sta PortStatus save for reference bpl not_mine skip the rest if its not ours tya save the balance of the registers pha for safety txa pha lda #$08 get status mask and PortStatus mask it beq NotReady no char present, maybe CTL interupt xdata3 entry lda SSCDATA fetch char waiting and add to input buffer ldx Head get index to head of buffer sta RingBuffer,X store the character inc Head bump the head index inc Size also bump ring char count NotReady lda PortStatus check for CTL interupt jsr altdcd was it Carrier loss? pla restore X,Y tax pla tay sec we processed the interrupt dc h'a5' a lda (zpage) instruct, skip next not_mine clc we didn't do anything on the int pla restore A/P plp rts return to prodos end * * setslot * reset slot info inside driver * and set current slot info setslot start sei stop all interupts and #%00000111 asl a scale slot to create offset asl a asl a asl a adc #$88 tax set x to offset value stx xdata1+1 stx xdata2+1 stx xdata3+1 inx stx xstat1+1 stx xstat1+1 stx xstat2+1 stx xstat3+1 inx stx xcmd1+1 inx stx xctl1+1 jmp init reinit port end ssc_data data bpstbl dc h'0 6 8 a c e f f f' ; reset,3,12,24,48,96,19.2,38.4,57 nowhere dc h'00' end