Path: news.uiowa.edu!uunet!news.mathworks.com!news.alpha.net!uwm.edu!vixen.cso.uiuc.edu!news.uoregon.edu!cie-2.uoregon.edu!nparker From: nparker@cie-2.uoregon.edu (Neil Parker) Newsgroups: comp.sys.apple2 Subject: Re: P8/6502 question Date: 5 May 1995 09:05:25 GMT Organization: University of Oregon Campus Information Exchange Lines: 69 Message-ID: <3ocpol$o2v@pith.uoregon.edu> References: <3oao6s$ae0@acme.freenet.columbus.oh.us> NNTP-Posting-Host: cie-2.uoregon.edu In article <3oao6s$ae0@acme.freenet.columbus.oh.us> dalloff@freenet.columbus.oh.us (Dave Althoff) writes: >[...munch, crunch, chomp, yum yum...] Under DOS 3.3, I can open a >file using Applesoft, then issue a READ instruction, then my 6502 program >can collect characters from the file by calling RDCHAR (which calls >the DOS character input routine pointed to by KSW). Does this work in P8, >or do I have to locate and read the buffer manually? It ought to work in P8. Keep in mind, though, that DOS 3.3 give you the characters from the file with the high bit set, and ProDOS gives you the high bits clear. >Also, (I know, I COULD look this up...but this is faster and easier!) once >I read a string into the input buffer ($200), how can I transfer it into >an Applesoft string from 6502? In other words, how can I find Q1$ and >assign the data in the buffer to it. If it helps, I'm limiting the input >string to 81 characters. Here's an input-anything subroutine that might help: INPUTTKN EQU $84 ;INPUT token FORPNT EQU $85 ;ptr for COPYTEMP CHRGET EQU $B1 ;get next byte from pgm text IN EQU $0200 ;input buffer INLIN EQU $D52C ;get line of input, mask hi bit COPYTEMP EQU $DA9A ;make temp str descr permanent CHKSTR EQU $DD6C ;make sure var is str PTRGET EQU $DFE3 ;get var from pgm text ERRDIR EQU $E306 ;give ?ILLEGAL DIRECT ERROR STRLIT EQU $E3E7 ;save str & build temp descr ORG $0300 0300:C9 84 CMP #INPUTTKN ;is next token INPUT? 0302:D0 1E BNE EXIT ;if not, quit 0304:20 06 E3 JSR ERRDIR ;make sure prog is running 0307:20 B1 00 JSR CHRGET ;gobble INPUT token 030A:20 E3 DF JSR PTRGET ;get var name 030D:20 6C DD JSR CHKSTR ;make sure it's a string 0310:85 85 STA FORPNT ;save pointer to var for COPYTEMP 0312:84 86 STY FORPNT+1 0314:20 2C D5 JSR INLIN ;get line of input 0317:A0 02 LDY #>IN 0319:A9 00 LDA #