Hi all,

this is S6, the fast(est) 6-Level stack replacement.
It's small and preserves the HP48 look of a stack.
The built-in font is optimized by hand (for size and readability).
Sorry, no UFL support yet since there's no suitable font in UFL format.

It has some enhancements over the most stack displays.
It displays the amount of memory left and indicates the ports status.
If you have a GX, it will show the bank count.
That is, how many banks of 128K you have on your card.
If used in an SX, it will show a '1' if a card is plugged in.
It has no EQ-Stk ability, of course.
That may be nice, but I don't need it.

I used this little thing for years and never had any problems.
So, if you encounter any, please tell me.

For detailed documentation see below.
I copied the source headers to provide an overview of the development.


Hope you like it ;-)


Greetings

Raymond


*****************************************************************************
* Modulname  :	STK6 / IStk
* Modultype  :	Library
* Dest.Comp. :	HP48
* Language   :	System RPL with parts of Machine Code
* Author     :	Raymond Hellstern, Liebigstr.8, 30163 Hannover
* Interface  :	S4.6
* Description:	Just try...
* Keywords   :
*		S4.6	( --> )
*			Toggle between 4-level and 6-level stack
*
*		DISPRN	( $ n --> )	, where n (1<=n<=8) can be a # or %
*			Bang $ directly into ABUFF at given row
*
* Notes	:
*		This shell replaces the built-in standard stack environment
*		by a very fast 6-level stack display and enhanced soft
*		annunciators display. This code is optimized for speed and
*		temporary memory usage. This means a garbage collection will
*		happen a few keystrokes later. As a side effect, code size
*		was reduced, too.
*
*		S6 will be active if CF.LIB is installed.
*		CF.LIB is the general configurator for many operating system
*		extensions.
*
*		IStk will be active if L161 is installed AND _s6 is present
*		AND is set to TRUE.
*		L161 is a key handling library which directs some keys to
*		non-standard locations.
*		Up-Arrow:	call IStk
*		Dn-Arrow:	call GV (from TO.LIB) if GROB on level 1
*					(maybe included here, too)
*				call E  (from TO.LIB) if $ on level 1
*					E is a customized version of StringWriter
*
*		THIS CODE IS COPYRIGHTED 1995 BY :
*
*		Raymond Hellstern of Magic48ges
*
*
* To Do      :
*		Add InputLine w/S6 font & size
*		Add cursor control: Adapt from /CUIR/CURSOR.S
*		Combine key libraries into one (?)
*		Move config code into combined library
*		Make S model compliant (maybe)
*		Force HALT to dispatch to STK6 (not STD stack POL)
*
*
*	1.000	12.03.95	RH	Alpha version
*		15.03.95	RH	Rewrote inner loop (use IRAM)
*		20.03.95	RH	Packed CharMap
*		25.03.95	RH	Some inner loop optimizations
*	1.100	27.03.95	RH	Add highly optimized & enhanced
*					version of 'DispSoftAnn' (See DOC)
*		29.03.95	RH	Move StatusBound into DispSoftAnn
*		01.04.95	RH	Minor packs & speed-ups
*		18.04.95	RH	Fix 'StatBound': clr one row below...
*		11.05.95	RH	Minor fixes: ComVec (B-test AM)
*		16.05.95	RH	Fix font umlaute: , , 
*		10.06.95	RH	Add MC PathStatus !
*		14.06.95	RH	Pack font again. Save > 300 bytes !!!
*		18.06.95	RH	Minor fixes
*		18.07.95	RH	Font fix
*		31.08.95	RH	Add IStk
*				RH	Enable 6-level IStk
*		12.09.95	RH	Chg STK6 toggle (use LAM instead flag)
*		20.12.95	RH	Chg: call rom entries for IStkENTER..
*		21.01.96	RH	Cond'assy for font&edit stuff
*					Rem. IStk (no time to complete)
*		26.07.98	RH	Start port indicator (as in JAVA)
*		18.08.98	RH	Had time to finish port indicators
*		30.08.98	RH	Fix & pack port indicators
*
*****************************************************************************


*******************************************************************************
* BANGROW	The NEW 5x6 font display
*
* ???	: This routine does the hard work of reading and displaying
*	  a complete line of chars (as DISPROWn)
*
* KEYWD	: disprn
*
* IN/OUT: ( $ #row --> )
*
* FEATR : Very fast (~23 ms on a HP48 rev.E)
*	  Only SUPPORTED entries, so runs on ALL HP48's(including GX)
*
* USES	: A,B,C,D,R4,D0,D1,P,ST4,ST5
* CALLS : POP#, SAVPTR, DropLoop, GetStrLenStk
* LEVELS: 4
*
* TO DO :
*
* DESCR.: Mentionned items: BANGROW, S4.6, EC
*
*	  BANGROW incorporates the new display driver for the HP48.
*	  It's the heart of DISPRN and disprn, which are designed
*	  to replace DISPROWn (from DISPLAY.s in the source).
*	  The main differences are the speed and the size (of code, chars...).
*	  For an example look at the usage of disprn in S4.6, the new six-level
*	  stack display which is a full replacement of STK5 and many others.
*	  This stack environment behaves as the normal 4-level display, even
*	  the interrupt-driven clock works.
*	  it's a user interface, NOT a Sys-RPL decompiler;-)
*
*
* Mods: Date            Prog    What
* ---------------------------------------------------------------------------
*       31.03.93        RH      wrote
*	01.04.93	RH	added doc ; Modified to accept bint from stack
*				display real adr & contents
*	14.04.93	RH	Modified to disp new 5x6 font
*				Included font
*	16.04.93	RH	Packed (Saved ~300 Bytes)
*	15.03.95	RH	Completely NEW
*******************************************************************************


*****************************************************************************
**	Display soft annunciators & StatusBound
**
**	( --> )
**
**	mmmmmm G Rxx HLT 12345 RAY A P [1] [##]
**
**
**
**	m	up to 6 digits of available memory (left justified; integer)
**	G	or R for GRAD or RAD. If empty: DEG
**	Rxx	POLAR or SPHERICAL mode. If empty: RECT
**	HLT	HALT indicator.If on, there may be asuspended environment.
**	1-5	State of first five USER flags. Lit when set.
**	RAY	1US, USR. Indicate USER mode state. RAY when NOT in USER mode.
**	A (ALG)	Algebraic entry mode
**	P (PRG)	Program entry mode
**	[1]	Port 1 indicator. [1] means Port 1 is read-only.
**	<1>	Port 1 indicator. [1] means Port 1 is read-write.
**	<-1	Port 1 indicator. [1] means Port 1 is merged.
**
**	[2]	Port 2 indicator. [2] means Port 2 is read-only (S only).
**	<2>	Port 2 indicator. [2] means Port 2 is read-write (S only).
**	<-2	Port 2 indicator. [2] means Port 2 is merged (S only).
**
**	[##]	Port 2 indicator. ## indicates number of banks (G only).
**	<##>	Port 2 indicator. <##> means Port 2 is read-write (G only).
**
**
**
**	Display StatusBound two pixel rows above the 'original' one
**	Many times faster and, of course, shorter
**
*****************************************************************************


*****************************************************************************
** Use IRAM for temporary path$. We need only (up to) 64 chars which will be
** put there in reverse order first, from the rrp where we are to the root,
** and then reversed directly in IRAM and put data into display from there.
**
** This works because the pixel data getter uses only 11*8 nibs (= 44 bytes),
** so there's enough room for the (up to) 64 chars:
**
**		 1	   2	     3	       4	 5	   6
**	1234567890123456789012345678901234567890123456789012345678901234
**
** 1.	{ HOME }
** 2.	{ HOME ABC DEF GHI }
** 3.	_ ABC DEF GHI }		( where '_' represents '...' )
**
** But that's not all. The routine will read up to 64 chars into IRAM,
** then a test will be performed how many chars will fit into a given
** pixel width. There are two pixel widths available: 131 if no clock,
** or 53 pixel if the clock is enabled.
** For character count, brackets and spaces are included.
**
** Alg:
**		DO
**			Get rrp name
**			Write to IRAM reversed
**              	Switch to parent
**		UNTIL (char limit OR home)
**
**		DO
**			Sum up pixel width for each char
**		UNTIL (pixel limit)
**
**		Reverse char order
**		Write out to HB
**
*
** This is the general RAMROMPAIR structure (except SysRRP)
*
*	Link		5
*	RRP Name Field	?
*
*	DORRP		5
*	ROMPART ID	3
*	LAST-RAMWORD	5   ------------+	\
*	0 (No Link)	5		|	  \
*	Name Field 1	    <---+	|	   \
*	Object 1		|	|	    \
*				|	|	     \
*	Link Field 1	5   ----+	|	      \
*	Name Field 2	    <---+	|	       \
*	Object 2		|	|		> RAMPART
*				|	|	       /
*	Link Field 2	5   ----+	|	      /
*	...				|	     /
*					|	    /
*	Link Field X-1	5		|	   /
*	Name Field X		<-------+	  /
*	Object X				_/
*
*****************************************************************************

