Path: news.uiowa.edu!hobbes.physics.uiowa.edu!newsrelay.iastate.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!swrinde!news.uh.edu!news.sccsi.com!nuchat!yob!jeff.brielmaier From: jeff.brielmaier@yob.com (Jeff Brielmaier) Newsgroups: comp.sys.apple2 Subject: Programming *ERROR* in BA Message-ID: <5250.678.uupcb@yob.com> Date: 10 May 95 05:08:00 GMT Distribution: world Organization: Ye Olde Bailey BBS - Houston, TX - 713-520-1569 Reply-To: jeff.brielmaier@yob.com (Jeff Brielmaier) References: Lines: 57 To: dalloff@freenet.columbus.oh.us DA>As I have posted here, I've been trying to write a file-processing program DA>to handle certain text files. As strictly an Applesoft program, it works DA>great, but it is a little slow. For a dramatic speed improvement, I want DA>to have a machine-language string builder to read data from the file. I DA>wrote a bit of machine code to do it, and it works great under DOS 3.3, but DA>mysteriously fails under ProDOS. Apple stated that "things" would be different under the wonderful world of ProDOS :) .....[Soapbox here].... DA>And people wonder why I hate ProDOS so much. Sorry to here it. I enjoy programming under ProDOS myself. Here is my "Input anything" kludge for BASIC.SYSTEM. It's not pretty, but it works. Hope this helps you.... 10 Y$="a" <-- The FIRST variable defined MUST be a string variable. This variable will be used by the 'input-anything' hack (it does not have to be called Y$) ...... 1000 ?D$"open text":?d$"read text" <-- Open file for reading 1010 call 768 <-- Get the line of input from the file 1020 y$=y$+"" <-- This is required to move the string up into Applesoft's variable table.... ......do rest of code here..... <<< The assembly code for the 'input anything' hack >>> 0300 20 6F FD JSR $FD6F ;Get a line of text from the file 0303 A0 02 LDY #$02 ;Set length of string read from file 0305 8A TXA 0306 91 69 STA ($69),Y 0308 A9 00 LDA #$00 ;Set address of string variable [1st 030A C8 INY ;variable in the variable table] to 030B 91 69 STA ($69),Y ;$200 030D A9 02 LDA #$02 030F C8 INY 0310 91 69 STA ($69),Y 0312 BD 00 02 LDA $0200,X ;Force any hi-bits on text off 0315 29 7F AND #$7F 0317 9D 00 02 STA $0200,X 031A CA DEX 031B 10 F5 BPL $0312 031D 60 RTS ;Return to Applesoft * KingQWK 1.05 # [PK] * main (){ puts(" C you later"); return 0;} ---- +------------------------------------------------------------------------+ |Ye Olde Bailey BBS Zyxel 713-520-1569(V.32bis) USR 713-520-9566(V.34/FC)| | Houston,Texas yob.com Home of alt.cosuard | +------------------------------------------------------------------------+