Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Useful 6 Byte routine ...

1 view
Skip to first unread message

Craig Bower

unread,
Dec 7, 2004, 5:42:58 PM12/7/04
to
Hi All,

I'm back to fooling around in the monitor ... and here's a handy routine
comprised of 6 lowly bytes!

2000:A9 05 LDA #$05
2002:20 47 F8 JSR $F847
2005:60 RTS

Does anyone know why this is so good?

And Mr Michael J.Mahon, heh hold off posting an answer till a few
others have taken a shot at it! As I'm sure you'll know what this is
good for!

:)

Later,
Craig


Paul R. Santa-Maria

unread,
Dec 7, 2004, 11:24:15 PM12/7/04
to
Craig Bower wrote:
> I'm back to fooling around in the monitor ... and here's a handy routine
> comprised of 6 lowly bytes!
>
> 2000:A9 05 LDA #$05
> 2002:20 47 F8 JSR $F847
> 2005:60 RTS
>
> Does anyone know why this is so good?

Calling GBASCALC with a value of five?
I admit that I see nothing special in
doing that.

You can make it five bytes if you change
the JSR to JMP and delete the RTS.

--
Paul R. Santa-Maria
Monroe, Michigan USA

Michael J. Mahon

unread,
Dec 8, 2004, 4:53:04 AM12/8/04
to
Craig Bower wrote:

Since Paul already pointed out that this is a call to GBASCALC,
I'll note that I find BASCALC ($FBC1) more useful, since it is the
same routine, but sets up BASL,BASH (instead of their lo-res
graphics counterparts) so that COUT1 can print to the specified line.

I find BASCALC a useful entry point, though not "guaranteed" in
the original documents, since such a subroutine or a table is needed
to address line "n" on the Apple screen.

-michael

New Applesoft BASIC interface for NadaNet networking!
Home page: http://members.aol.com/MJMahon/

Craig Bower

unread,
Dec 8, 2004, 6:46:24 PM12/8/04
to
"Michael J. Mahon" <mjm...@aol.com> wrote in message
news:20041208045304...@mb-m28.aol.com...

> I find BASCALC a useful entry point, though not "guaranteed" in
> the original documents, since such a subroutine or a table is needed
> to address line "n" on the Apple screen.

Well Bravo fellas!

Both excellent answers! FWIW: the $05 is just used as an
example of a line in the routine. The real glory comes when you
change the $05 to whatever line you need to address.

If you remember a *long* while back, I was trying to sort out a way to
sequentially access the Lo-Resolution screen from Assembly. Well,
GBASCALC is my salvation. Instead of having to store a data table
pointing to the beginning locations of each screen line, I simple load
the ACC with whatever line I need to write to - 0-23 (1-24 VTAB)
and call GBASCALC. It stores the address lo-byte then hi-byte
in the zero page, which can now be indexed with Y from $0-$27
to get our HTAB. Immediate control over any spot and any 'plot'
on the Text or Lo-resolution screen.

And of course, lol, MJM schooled me on the answer! :)

Right on!

Later,
Craig


NNTP...@flashmail.com

unread,
Dec 9, 2004, 8:51:02 AM12/9/04
to
Just asking for clarification here, but is the only significant
difference between GBASCALC and BASCALC that GBASCALC makes you specify
the line you want and BASCALC just assumes the line you want based on
current cursor position?

NNTP...@flashmail.com

unread,
Dec 9, 2004, 9:02:16 AM12/9/04
to

John B. Matthews

unread,
Dec 9, 2004, 10:24:16 AM12/9/04
to
In article <1102600199....@z14g2000cwz.googlegroups.com>,
"NNTP...@flashmail.com" <NNTP...@flashmail.com> wrote:

I don't think so; both routines expect the line number in A. The
only difference I see is the base address storage: BASCALC sets up
BASL/H, and GBASCALC sets up GBASL/H. That's essential if you want
to have mixed text and lo-res graphics.

F847: 48 141 GBASCALC PHA
F848: 4A 142 LSR
F849: 29 03 143 AND #$03
F84B: 09 04 144 ORA #$04
F84D: 85 27 145 STA GBASH
F84F: 68 146 PLA
F850: 29 18 147 AND #$18
F852: 90 02 148 BCC GBCALC
F854: 69 7F 149 ADC #$7F
F856: 85 26 150 GBCALC STA GBASL
F858: 0A 151 ASL
F859: 0A 152 ASL
F85A: 05 26 153 ORA GBASL
F85C: 85 26 154 STA GBASL
F85E: 60 155 RTS

FBC1: 48 577 BASCALC PHA
FBC2: 4A 578 LSR
FBC3: 29 03 579 AND #$03
FBC5: 09 04 580 ORA #$04
FBC7: 85 29 581 STA BASH
FBC9: 68 582 PLA
FBCA: 29 18 583 AND #$18
FBCC: 90 02 584 BCC BSCLC2
FBCE: 69 7F 585 ADC #$7F
FBD0: 85 28 586 BSCLC2 STA BASL
FBD2: 0A 587 ASL
FBD3: 0A 588 ASL
FBD4: 05 28 589 ORA BASL
FBD6: 85 28 590 STA BASL
FBD8: 60 591 RTS

--
John
jmatthews at wright dot edu
www dot wright dot edu/~john.matthews/

NNTP...@flashmail.com

unread,
Dec 9, 2004, 2:51:37 PM12/9/04
to
Google Groups hiccupped and said the message would be queued fof later.
I didn't see the 'queued' part and rehit the post button.

0 new messages