Path: ns-mx!iowasp.physics.uiowa.edu!ceres.physics.uiowa.edu!zaphod.mps.ohio-state.edu!usc!snorkelwacker.mit.edu!mintaka!ogicse!usenet!jacobs.CS.ORST.EDU!parkern From: parkern@jacobs.CS.ORST.EDU (Neil Parker) Newsgroups: comp.sys.apple2 Subject: Re: Quadram APIC-A //e compatibility & code debugging Summary: machine-language kludge for interface Message-ID: <1991Mar31.112001.28943@lynx.CS.ORST.EDU> Date: 31 Mar 91 11:20:01 GMT References: <50a3ec40.20b6d@apollo.HP.COM> Sender: @lynx.CS.ORST.EDU Reply-To: parkern@jacobs.CS.ORST.EDU (Neil Parker) Organization: The Universal Society for the Prevention of Reality Lines: 85 Nntp-Posting-Host: jacobs.cs.orst.edu In article <50a3ec40.20b6d@apollo.HP.COM> mort@apollo.HP.COM (Stephen Moriarty) writes: >[...stuff about non-functional APIC-A parallel interface card...] >Failing that, I'd like to debug the firmware. I've listed it out >from the Apple monitor. If I had a printer interface, I could get >a hardcopy ;(. Sorry for posting two separate followups to the same article, but I didn't think of this until after I sent the first article off on its way to net-land... In spite of the monitor-dump garbage you've been getting, it may still be possible to get printouts of simple stuff like BASIC or machine-language listings, assuming your interface works like most other parallel interfaces. 1. Make sure the interface is in slot 1. 2. Enter the following machine language program into the monitor: 300:A9 B 85 36 A9 3 85 37 4C EA 3 2C C1 C1 30 FB 310:48 29 7F 8D 90 C0 68 60 Check your work by typing "300L"--you should see something like this: 0300- A9 0B LDA #$0B 0302- 85 36 STA $36 0304- A9 03 LDA #$03 0306- 85 37 STA $37 0308- 4C EA 03 JMP $03EA 030B- 2C C1 C1 BIT $C1C1 030E- 30 FB BMI $030B 0310- 48 PHA 0311- 29 7F AND #$7F 0313- 8D 90 C0 STA $C090 0316- 68 PLA 0317- 60 RTS 3. Activate the printer by giving the BASIC command "CALL 768" if you're using DOS 3.3, or "PR#A$30B" if you're using ProDOS. If everything works out, all your commands should start going to the printer instead of the screen. Note that this simple driver does none of the fancy things that the interface can do--i.e. no control-I 80N is available. If everything comes out on one line, try to find a DIP switch on your printer to turn on automatic line feed after carriage return. If your printer doesn't have such a switch, add the following machine code to the driver: 316:C9 D D0 4 A9 A D0 F5 68 60 The modified driver should look like this when you type "300L": 0300- A9 0B LDA #$0B 0302- 85 36 STA $36 0304- A9 03 LDA #$03 0306- 85 37 STA $37 0308- 4C EA 03 JMP $03EA 030B- 2C C1 C1 BIT $C1C1 030E- 30 FB BMI $030B 0310- 48 PHA 0311- 29 7F AND #$7F 0313- 8D 90 C0 STA $C090 0316- C9 0D CMP #$0D 0318- D0 04 BNE $031E 031A- A9 0A LDA #$0A 031C- D0 F5 BNE $0313 031E- 68 PLA 031F- 60 RTS If your interface works like every other parallel interface I've ever seen, then one of these drivers ought to work. In most parallel interfaces, the byte at $CnC1 (n=slot number) is negative when the printer is busy and positive when it's ready for data, and the data is written by storing it at $C0n0 (n=slot number+8). Good luck! - Neil Parker -- Neil Parker No cute ASCII art...no cute quote...no cute parkern@jacobs.cs.orst.edu disclaimer...no deposit, no return... parker@corona.uoregon.edu (This space intentionally left blank: )