programmer >> Useful 6 Byte routine ...

by Craig Bower » Wed, 08 Dec 2004 06:42:58 GMT

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



programmer >> Useful 6 Byte routine ...

by mjmahon » Wed, 08 Dec 2004 17:53:04 GMT



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/

programmer >> Useful 6 Byte routine ...

by Craig Bower » Thu, 09 Dec 2004 07:46:24 GMT


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

programmer >> Useful 6 Byte routine ...

by NNTPmail@flashmail.com » Thu, 09 Dec 2004 21:51:02 GMT

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?

programmer >> Useful 6 Byte routine ...

by NNTPmail@flashmail.com » Thu, 09 Dec 2004 22:02:16 GMT

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?

programmer >> Useful 6 Byte routine ...

by John B. Matthews » Thu, 09 Dec 2004 23:24:16 GMT

In article < XXXX@XXXXX.COM >,



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/

programmer >> Useful 6 Byte routine ...

by NNTPmail@flashmail.com » Fri, 10 Dec 2004 03:51:37 GMT

Google Groups hiccupped and said the message would be queued fof later.
I didn't see the 'queued' part and rehit the post button.

Similar Threads

1. 6502 assembly: invert bytes, horizontal flip, and rotate bytes

2. 6502 assembly: invert bytes, horizontal flip, and rotate bytes

I'll look in my reference manuals, but I thought it would be an
interesting discussion:

for illustration, an area of the screen 3 bytes tall by 5 bytes wide
(3 pixels X 35 pixels)

12345
12345
12345


I would like to do the following with this area of the screen:

1)invert the bits...  1's become 0's,   0's become 1's

2)horizontally flip the image

3)move the image one pixel to the left or right


invert:

??????

horizontal flip:

1 (76543210) 2 (76543210) 3 (76543210) 4 (76543210) 5 (76543210)

5 (01234567) 4 (01234567) 3 (01234567) 2 (01234567) 1 (01234567)

the bytes will need their bits reversed (ROtated ?)
and then need to be stored into different locations

I know that bit 7 doesn't get displayed....


************************************************8
move image left/right by one pixel:

I will have to ROtate the bytes

if moving image LEFT, must start on right
side of image, progress to left...

lda byte5
ROL
lda byte4
ROL
lda byte3
ROL
lda byte2
ROL
lda byte1
ROL
lda byte0
ROL

Rich

3. Useful shipping info

4. Useful manuals for some Apple II hardware.

Does anyone need the following softcopies of these manuals?

1.  AE PC Transporter User's manual
2. CP/M Appli-Card Installation and User's manual
3. Disc Quest v.13
4. Second Sight VGA Card Developer Manual.
5. AE Audio Animator User Manual

Tom.

5. This software is useful for CMMI and Bussiness Process Management

6. Autokeys macro: how can you get the "normal" access key behaviour after the autokeys routine

Hi

How do you get the Access to perform the regular operation on a trapped
autokey.  For example, imagine I wanted to trap ctl-c and all I wanted to do
was pop a msg box up, and then have Access do whatever it regularly does
with ctl-c ie let my autokeys trap and do something, and then let Access get
the trapped keys as per normal as if the Autokeys macro wasnt there.

Is this possible?

Thanks
AC


7. Use Access VBA to run an Excel sub routine

8. writing an error routine in case it doesn't save both files

This macro is dangerous.  It works nicely but if the file isn't there or the 
name gets changed then it writes the text file to the original instead of a 
copy.  Can you help me write an error routine?  Something like if the 
original name changes or sheet1 name changes then a big error message that 
this file is corrupted start over something like that?

thanks,

Sub saveIndesign()
'Appends date to filename so as to not write over an existing file

' saveIndesign Macro

Const fPath As String = "Mac OS X:"
Const fName As String = "Indesign"
Const fName1 As String = "SSP"






    'do the save first as a txt file


ActiveWorkbook.SaveAs Filename:=fPath & fName & Format(Now, 
"yyyymmdd_hhmmss") & ".txt"
   
   'then save as a normal workbook or the existing file will be changed to a 
text file which is not what you want
   
ActiveWorkbook.SaveAs Filename:=fPath & fName1 & Format(Now, 
"yyyymmdd_hhmmss") & ".xls", FileFormat:=xlWorkbookNormal

MsgBox "2 Files Saved  " & fName & fPath & Format(Now, "yyyymmdd_hhmmss") & 
" ; " & fName1 & fPath & Format(Now, "yyyymmdd_hhmmss")



End Sub