<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Tue, 30 Nov 2004 16:48:30 +0000 (GMT)
From   : Andrew W <a.weston2@...>
Subject: Re: ...at line ___

In <URL:news:local.misc> on Sun 28 Nov, Pete Turnbull wrote:

> > Then:
> > > ..scan1 LDA&75:CMP#39:BEQ scan4
> > > ..scan5 CMP#79:BEQ scan4
> > > ..scan6 CMP#119:BNE scan2
> > > ..scan4
> > LDA&76       \ a flag that's set once per loop
> > CMP#0
> 
> You don't really need the CMP#0 because LDA sets/clears the Zero flag.
> 
> > BNE scan2    \IF?&76=0 go to this bit:
> 
> This looks OK too...
> 
> > STY&72               \ temporarily store Y counter - goes from 0 to
> &8A
> >
> > LDY&75:LDA(&84),Y:CMP#32:BEQ scan3    \  IF(tx5%?(?&75))<>32
> >
> > LDA#1:STA&76:LDA&77:STA&71:LDY&72    \ ?&76=1:?&71=?&77
> 
> You don't need the LDY&72 in the line above, since it will fall through
> to the line below if you remove the JMP.
> 
> > JMP scan2
> > .scan3 LDY&72         \ restore Y counter if necessary
> 
> You don't need the JMP and you can remove "LDY&72" from the end of the
> previous section.
> 
Thanks -  it seems to be the JMP and LDY&72 that were causing it to fail
although I don't understand why as when I remove them the code works.
It's basically a simple word-wrap that scans a section of text for
characters at the end of the line and if there are characters there it
sets a flag (&76) and calls another section of machine code to add
spaces at the last known space on the line and repeats this process
until there are no characters at the end of the line.
(tx5% is the text buffer which hold ASCII that has just been
decompressed).


regards,


A.Weston
-- 
Staffordshire, UK of GB&NI. 
reply to: a . wes ton 2@ u  k onlin e . c  o. u k  [ommitting spaces]
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>