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