[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Programming *ERROR* in BA



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      |
+------------------------------------------------------------------------+