[net.micro.cbm] id AA14043; Fri, 24 Feb 84 03:06:52 pst

lipman@decwrl.UUCP (02/24/84)

Message-Id: <8402241106.AA14043@decwrl.ARPA>
Date: Friday, 24 Feb 1984 03:04:35-PST
From: vogon::goodenough  (speling courtesy of clapped out VT100)
To: net.micro.cbm
Subject: FP rounding and ASCII to screen codes

Looking at the code again, I think I have to agree with genrad!al (sorry,
you didn't post your name!), although for FSTO I have been using $BBD7 like
Ray, and not $BBD4.  It looks as though for the sake of accuracy I should
change to the lower address.  As Al (?) says, where this is called internally,
$BBD4 is used.  I haven't used F1 to F2 directly, as I regard that as
'internal' - I work with memory variables, using (A,Y) addressing.

The code you want for the Commodore 'ASCII' to screen codes, Ray, starts at
$E716.  This is the start of the meat of the CHROUT routine after it has
determined that the CMD device is the screen.  It doesn't translate via
lookup - it does bit-juggling.  The fragment of interest is (char in A, then
stored in $D7 temp):

	E723	LDA	$D7
	E725	BPL	E72A
	E727	JMP	E7D4	; does something special if bit 7 set
	E72A	CMP	#$0D	; CR?
	E72C	BNE	E731
	E72E	JMP	E891	; end of line stuff
	E731	CMP	#$20
	E733	BCC	E745	; br if < space (checks control codes)
	E735	CMP	#$60
	E737	BCC	E73D	; br if < [ (i.e. ! thru Z)
	E739	AND	#$DF	; else clear bit 5 (chars [ thru ...)
	E73B	BNE	E73F	; (unconditional br, I guess)
	E73D	AND	#$3F	; clear bits 7,6 for ! thru Z
	E73F	...

Heaven knows why they bother!

By the way, you referred to your 4th article which I never received - we
had trouble with our gateway a little while back.  Perhaps you could re-post
it, or if no-one else missed it, then please send it directly.

Jeff.