;------------------------------------------------------------------
;
;	TITLE:
;	HEADLINE.ASM
;
;	AUTHOR:
;	Robert C. Kuhman
;	Sysop of the "Cro'sNest" (c)1982 RCP/M - RBBS.
;
;	PURPOSE:
;	To produce large size "HEADLINE" printouts in 5 X 7 matrix
;	character blocks.  UPPER and lower Case characters are ok,
;	as well as all numerals,  and all punctuation marks of the
;	ASCII character set.   Control codes may be represented as
;	"^?" (up-arrow/caret plus the letter).  The program allows
;	the user to enter up to  7 lines of up to  16  characters.
;	Should the user erroneously exceed the line length allowed
;	(determined by the printer width),  a message prompt calls
;	attention to that fact,  and  offers the  option to retype
;	the line.   The built-in "HELP" function can  be displayed
;	after the SIGNON message, and is also the default when the
;	program is not correctly executed.  Once  the  seven lines
;	of text have printed (a full page),  the program formfeeds
;	to the next  page boundary,  and "quietly"  returns to the
;	CP/M prompt (no warm boot).
;
;	SUBMIT USAGE:
;	HEADLINE.COM can be called and executed as part of a "SUB"
;	file for batch processing of HEADLINE titles.  Please note
;	that SUBMIT.COM can  be patched at location  (0370 hex) to
;	disable the lower-case to UPPER-CASE translation function.
;	Use DDT.COM to replace the (5F hex) found at that location
;	with (FF hex), and save the file (10 records of 128 bytes)
;	under a new name, like:  "SUB.COM" (or something similar).
;	As an example, to print a HEADLINE title for a listing  of
;	this file, one could create "HEADLINE.SUB" as follows. The
;	"SUB" file will execute the full 7 lines of 16 characters.
;
;	(Example generated with the CP/M text editor, ED.COM)
;	Notes	1) (space) means, enter a space here with editor.
;		2) (space) acts as a null command line.
;		3) This example assumes use of a 132 column printer.
;		4) Careful. Don't exceed 16 characters per line.
;
;	A>ED HEADLINE.SUB		;Execute ED.COM
;
;	NEWFILE
;	    : *i			;Insert mode "i"
;	  01:  XSUB			;Run XSUB.COM
;	  02:  HEADLINE ?		;Run HEADLINE.COM, show help
;	  03:  ****************		;1st HEADLINE to print
;	  04:  (space)			;2nd HEADLINE to skip
;	  05:   "HEADLINE.ASM"   	;3rd HEADLINE to print
;	  06:   as of 11/12/83		;4th HEADLINE to print
;	  07:  By Robert Kuhman		;5th HEADLINE to print
;	  08:  (space)			;6th HEADLINE to skip
;	  09:  ****************		;7th HEADLINE to print
;	  10:				;^Z to exit Insert mode
;	    : *e			;"e" to exit ED.COM
;	
;	A>SUB HEADLINE			;Process "SUB" file
;	execution begins,...
;
;	ASSOCIATED FILES:
;	1) HL.DOC		(Brief description of HEADLINE)
;	2) HL.CRC		(CRC check list)
;	3) HL080.COM		(Ready to run on  80 column printer)
;	4) HL132.COM		(Ready to run on 132 column printer)
;	5) HEADLINE.ASM		(8080/Z80 CP/M 2.2 source code)
;	6) SUB.SUB		(SUMBIT file patch for "SUBMIT.COM")
;	7) DEMO.SUB		(Demonstration of character set)
;	8) HEADLINE.SUB		(Prints 5x7 block title for listing)
;	9) HEADLINE.LBR		(LU library of the above files)
;      10) CRC.COM		(CRC v5.0 program)
;
;	CREDITS:
;	Conceptually based on BANNER.ASM (original author unknown),
;	as implemented by Richard Conn, now rewritten with many new
;	features, thus the program was renamed.
;
;	COPYRIGHT STATUS:
;	Copyright (c) 1983 by the author,  Robert C. Kuhman, all
;	rights reserved.  Released to the PUBLIC DOMAIN for non-
;	profit use only.
;
;	ASSEMBLY:
;	Assemble with either "ASM.COM" or "MAC.COM".
;
;	SYSTEM REQUIREMENTS:
;	A CP/M 2.2 computer supporting an 80 (or 132) column printer.
;
;	REVISIONS:
;	Original version 1.00 by the author on 11/12/83.
;
;------------------------------------------------------------------
;
;	VERSION AND REVISION NUMBERS
;
VERS:	EQU	100		;VERSION GETS FORMATTED X.XX
MONTH:	EQU	11		;MONTH OF LAST REVISION
DAY:	EQU	12		;DAY
YEAR:	EQU	83		;YEAR
;
TRUE:	EQU	-1
FALSE:	EQU	NOT TRUE
;
;	*** USER DEFINED EQUATES ***
;
STDCPM:	EQU	TRUE		;TRUE = 100H LOAD
;
;	SELECT PRINTER WIDTH CAPABILITY
;
COL080:	EQU	TRUE		;TRUE = 80  COLUMN PRINTER
COL132:	EQU	NOT COL080	;IF FALSE ABOVE, 132 COLUMNS
;
;	SET TO THIS EQUATE TO TRUE IF CLEAR SCREEN IS DESIRED.
;	MODIFY CS1: AND CS2: TO SUIT YOUR TERMINAL TYPE.
;
CLS:	EQU	FALSE		;TRUE = CLEAR SCREEN
;
	 IF	CLS		;CLEAR SCREEN (SET FOR H19)
CS1:	EQU	1BH		;CLEAR SCREEN OR LEAD-IN CHAR
CS2:	EQU	45H		;CLEAR AND/OR HOME CURSOR/ OR NULL
	 ENDIF			;CLS
;
;	*** END OF USER DEFINED EQUATES ***
;
	 IF 	STDCPM
BASE:	EQU	0000H		;STD 100H LOAD
	 ENDIF
;
	 IF	NOT STDCPM
BASE:	EQU	4200H		;NON STD BASE ADDR
	 ENDIF
;
	 IF	NOT CLS		;NO CLEAR SCREEN
CS1:	EQU	00H		;NULL
CS2:	EQU	00H		;NULL
	 ENDIF			;NO CLS
;
	 IF	COL080		;80 COLUMN PRINTER
MAXCHR:	EQU	10		;10 CHARS MAX
	 ENDIF
;
	 IF	COL132		;132 COLUMN PRINTER
MAXCHR:	EQU	16		;16 CHARS MAX
	 ENDIF
;
;	MISC EQUATES
;
CONINB:	EQU	1		;CONSOLE INPUT BYTE
CONOUT:	EQU	2		;CONSOLE OUTPUT BYTE 
LOUT:	EQU	5		;LIST OUTPUT 
BDOS:	EQU	0005H		;BDOS SERVICE CALL ADDR
PBUFL:	EQU	09H		;PRINT BUFFERED LINE
CONINL:	EQU	0AH		;CONSOLE INPUT LINE
FCB:	EQU	005CH		;FILE CONTROL BLOCK
;
;	ASCII CHARACTER DEFINITIONS
;
BELL:	EQU	07H		;BELL
BS:	EQU	08H		;BACKSPACE
TAB:	EQU	09H		;TAB
LF:	EQU	0AH		;LINE FEED
FORMF:	EQU	0CH		;FORMFEED
CR:	EQU	0DH		;CARRIAGE RETURN
;
;	PROGRAM BEGINS HERE
;
	ORG	BASE+100H	;ORIGIN
;
	JMP	START		;GET PAST MESSAGES
;
;	ASSEMBLE COPYRIGHT INTO HEX FILE FOR LOAD
;
CYRGHT:	DB	'Copyright 1983 Robert C. Kuhman'
;
;	SIGNON MESSAGE
;
SIGNON:	DB	CS1,CS2,'HEADLINE.COM v'
	DB	VERS/100+'0','.',VERS MOD 100/10+'0'
	DB	VERS MOD 10+'0',' as of '
	DB	MONTH/10+'0',MONTH MOD 10+'0','/'
	DB	DAY/10+'0',DAY MOD 10+'0','/'
	DB	YEAR/10+'0',YEAR MOD 10+'0',CR,LF
	DB	'(Print title block HEADLINE.)',CR,LF
	DB	'Enter Control-C to ABORT.',CR,LF
	DB	LF
CNTMSG:	DB	'Any key to continue, else ''?'' for HELP. '
	DB	'$'
;
;	HELP MESSAGE
;
HLPMSG:	EQU	$		;MARKER
	 IF	CLS		;CLEAR SCREEN
	DB	CS1,CS2
	 ENDIF			;CLEAR
;
	 IF	NOT CLS
	DB	CR
	 ENDIF
;
	DB	'H E A D L I N E  -  H E L P               ',CR,LF
	DB	'---------------------------',CR,LF,LF
	DB	'Print a large (5x7) matrix  block title.',CR,LF
	DB	'Do up to 7 lines of up to '
	DB	MAXCHR/10+'0',MAXCHR MOD 10+'0'
	DB	' characters.',CR,LF
;
	DB	'Both UPPER/lower case characters are OK.',CR,LF
	DB	'Numbers  and  punctuation  marks are OK.',CR,LF
	DB	'Control codes are entered as "^+letter".',CR,LF
	DB	'"ESCape" is entered as "^[" (two chars).',CR,LF
	DB	'Press "BACKSPACE" to backup 1 character.',CR,LF
	DB	'Do "Control-X"  to backup and redo line.',CR,LF
	DB	'Enter "Control-C" to ABORT this program.',CR,LF
	DB	LF
	DB	'$'
;
;	MISC MSGS
;
HEADCS:	DB	CS1,CS2
;
HEADER:	DB	CR,'H E A D L I N E   M E S S A G E           ',CR,LF
	DB	'===============================',CR,LF
	DB	'$'
;
	 IF	COL080		;80 COLUMN PRINTER
RULER:	DB	'Line length Ruler ||1234567890|| ',CR,LF,'$'
;
BOUNDS:	DB	CR
	DB	'                  ||          ||'
	DB	'      '	;6 SPACES TO CLEAR "TOO LONG" MSG
	DB	CR
	 ENDIF			;COL080
;
;...
;
	 IF	COL132		;132 COLUMN PRINTER
RULER:	DB	'Line length Ruler ||1234567890123456|| ',CR,LF,'$'
;
BOUNDS:	DB	CR
	DB	'                  ||                ||'
	DB	CR
	 ENDIF			;COL132
;
LINE:	DB	'HEADLINE - #0'
NUMBER:	DB	'0:   ||','$'
;
TOOLNG:	DB	BELL,CR
	DB	'Too long!  Try again, press any key.  ',BS
	DB	'$'
;
EXTMSG:	DB	LF,'Output complete, back to CP/M.'
CRLF:	DB	CR,LF,'$'
;
;	MAIN PROGRAM BEGINS HERE
;
START:	LXI	H,0		;SAVE STACK PTR
	DAD	SP		;HL=OLD SP
	SHLD	STACK
	LXI	SP,STACK	;NEW STACK
	LDA	FCB+1		;HELP NEEDED?
	CPI	20H		;IF NOT A SPACE
	JNZ	HLP		;GIVE HELP.
	LXI	D,SIGNON	;PT TO MSG
	CALL	DISPLY		;SND TO CON:
	CALL	GETINP		;GET RESPONSE
	CPI	'?'		;HELP?
	JNZ	NHLP		;NO HELP NEEDED
HLP:	LXI	D,HLPMSG	;PT TO MSG
	CALL	DISPLY		;SND TO CON:
	JMP	HEAD		;SKIP OVER
NHLP:	LXI	D,HEADCS	;PT TO MSG
	JMP	DSPLY		;SND TO CON:
HEAD:	LXI	D,HEADER	;NO CS IF HELP CAME FIRST
DSPLY:	CALL	DISPLY		;SND TO CON:
;
;	INITIALIZE LINE COUNTER, AS AN ASCII ZERO (30H)
;
	LXI	D,NUMBER	;POINT TO LINE COUNT BYTE
	MVI	A,30H		;ASCII '0'
	STA	NUMBER
;
;	PREPARE UP TO SEVEN LINES OF INPUT
;
SEVLIN:	LXI	H,NUMBER	;POINT TO START OF MSG
	MOV	A,M		;GET FIRST BYTE INTO 'A'
	INR	A		;INCREMENT ITS VALUE BY ONE
	CPI	'8'		;SEVENTH LINE DONE (7+1)?
	JZ	EXIT		;QUIT.
	STA	NUMBER		;PRESENT LINE COUNT
	LXI	D,CRLF		;PT TO MSG
	CALL	DISPLY		;SND TO CON:
	LXI	D,RULER		;PT TO MSG
	CALL	DISPLY		;SND TO CON:
AGAIN:	LXI	D,BOUNDS	;PT TO MSG
	CALL	DISPLY		;SND TO CON:
;
;	INITIALIZE THE ENTIRE LINE INPUT BUFFER
;
ZERO:	LXI	H,INPBUF	;POINT TO INPUT BUFFER
	MVI	E,00H		;FIRST LOOP
MORE:	MVI	A,0		;LOAD A ZERO
	MOV	M,A		;ZERO THE ADDRESS
	INX	H		;NEXT ADDRESS
	INX	D		;NEXT COUNT
	MOV	A,E		;COUNT INTO 'A'
	CPI	MAXCHR+1	;DONE?
	JC	MORE		;DO ANOTHER?
;
;	GET HEADLINE, MAXCHR LONG, POINT TO ADDR WITH 'DE'
;
	LXI	D,INLINE	;LINE INPUT BUFFER
	MVI	C,CONINL	;GET INPUT LINE
	CALL	BDOS		;BDOS SERVICE
;
;	PRINT HEADLINE CONTAINED IN BUFFER (INPCNT=CHAR CNT)
;
HDLN:	LXI	H,INPCNT	;POINT TO COUNT OF INPUT BUFFER
	MOV	A,M		;GET COUNT OF CHARS INPUTTED
	CPI	MAXCHR+1	;BEYOND CHAR LIMIT?
	JC	HDLN1		;CONTINUE IF NOT
	LXI	D,TOOLNG	;PT TO MSG
	CALL	DISPLY		;SND TO CON:
	CALL	GETINP		;PAUSE FOR RESPONSE
	JMP	AGAIN		;RETRY
;
HDLN1:	INX	H		;PT TO FIRST CHAR
	ADD	L		;ADD TO LOW-ORDER BYTE
	MOV	L,A		;PT TO BYTE
	MVI	M,0		;STORE <NULL>
	MVI	D,80H		;PT TO MSB+1
NEXLIN:	LXI	H,INPCNT+1	;SET PTR TO FIRST CHAR
	MOV	A,M		;CHECK FOR NO CHARS
	ORA	A		;ENDING ZERO?
	JZ	P4CRLF		;4 CRLF'S IF SO
	SHLD	NEXTCH
	CALL	PRCRLF		;NEW LINE
	MOV	A,D		;GET BIT PTR
	RRC			;ROTATE
	ANI	7FH		;MASK OUT MSB
	MOV	D,A		;SET BIT PTR
	JZ	P1CRLF		;NEW LINE AND THEN EXIT
NEXCHR:	PUSH	H		;GET NEXT CHARACTER
	PUSH	D
	PUSH	B
	LHLD	NEXTCH		;GET NEXT CHAR POINTER
	MOV	A,M		;GET CHAR
	INX	H		;PT TO NEXT
	SHLD	NEXTCH
	ANI	7FH		;MASK MSB IF ANY
	POP	B
	POP	D
	POP	H
;
	MOV	C,A		;CHAR IN C
	ORA	A		;DONE?
	JZ	NEXLIN		;DO NEXT LINE IF SO
;
;	COMPUTE POINTER TO TABLE ENTRY OF CHAR IN REG A
;	ON INPUT, A=CHAR; ON OUTPUT, HL=PTR TO TABLE ENTRY (1ST BYTE)
;
CONV:	PUSH	B		;SAVE BC
	PUSH	D		;SAVE DE
	SUI	20H		;CONVERT <SP> TO 0
	JC	CONV2		;INVALID CHAR
	CPI	7FH-20H		;IN RANGE?
	JC	CONV1		;INVALID CHAR
	STC			;SET CARRY FOR INVALID CHAR
	POP	D		;RESTORE DE
	POP	B		;RESTORE BC
	JMP	CONV2		;SKIP OVER
CONV1:	MOV	E,A		;VALUE IN E
	MVI	D,0		;VALUE IN DE
	MOV	H,D		;VALUE IN HL
	MOV	L,E
	DAD	H		;VALUE * 2
	DAD	H		;VALUE * 4
	DAD	D		;HL = VALUE * 5
	LXI	D,CHARS		;POINT TO BEGINNING OF TABLE
	DAD	D		;HL PTS TO ELEMENT IN TABLE
	POP	D		;RESTORE DE
	POP	B		;RESTORE BC
	ORA	A		;CLEAR CARRY
;
CONV2:	JC	NEXCHR		;SKIP IF ERROR
;
;	PRINT 5 CHARS FOLLOWED BY TWO SPACES
;	CHAR IN C ACCORDING TO THE ENTRY PTED TO BY HL
;	BIT MASK IS IN D
;
LIST:	PUSH	B		;SAVE BC (C=CHAR)
	MVI	B,5		;5 BYTES/CHAR
LIST1:	MOV	A,M		;GET BIT SET
	ANA	D		;MASK FOR BIT IN QUESTION
	JZ	LIST3		;IF ZERO, PRINT <SP>
	CALL	LSTOUT		;PRINT CHAR IN C
LIST2:	INX	H		;PT TO NEXT BYTE
	DCR	B		;COUNT DOWN
	JNZ	LIST1
	MVI	C,20H		;PRINT THREE SPACES
	CALL	LSTOUT
	CALL	LSTOUT
	CALL	LSTOUT
	POP	B		;RESTORE BC
	JMP	NEXCHR		;SKIP IF ERROR
LIST3:	MOV	E,C		;SAVE CHAR
	MVI	C,20H		;PRINT <SP>
	CALL	LSTOUT
	MOV	C,E		;GET CHAR
	JMP	LIST2
;
P4CRLF:	CALL	PRCRLF		;4 <CR> <LF>
	CALL	PRCRLF
	CALL	PRCRLF
P1CRLF:	CALL	PRCRLF		;1 <CR> <LF>
	JMP	SEVLIN		;DO ANOTHER
;
EXIT:	LXI	D,EXTMSG	;PT TO MSG
	CALL	DISPLY		;SND TO CON:
	MVI	C,FORMF		;FORMFEED
	CALL	LSTOUT		;SEND TO PRTR
	LHLD	STACK		;GET OLD STACK POINTER
	SPHL			;LOAD SP
	RET			;QUIET RETURN TO CP/M
;
;	SUPPORT ROUTINES
;
;...
;
;	SEND CR AND LF TO LIST DEVICE
;
PRCRLF:	MVI	C,CR
	CALL	LSTOUT
	MVI	C,LF		;FALL THRU TO LSTOUT
;
;	SEND CHARACTER IN 'C' TO LIST DEVICE
;
LSTOUT:	PUSH	H
	PUSH	B
	PUSH	D
	MOV	E,C
	MVI	C,LOUT		;OUTPUT TO LST:
	CALL	BDOS
	POP	D
	POP	B
	POP	H
	RET
;
;	SEND CHARACTER IN 'C' TO CONSOLE
;
BYTEO:	PUSH	H
	PUSH	B
	PUSH	D
	MOV	E,C
	MVI	C,CONOUT		;OUTPUT TO CONSOLE
	CALL	BDOS
	POP	D
	POP	B
	POP	H
	RET
;
DISPLY:	PUSH	H
	PUSH	B
	PUSH	D
	MVI	C,PBUFL		;PRINT BUFFERED LINE
	CALL	BDOS
	POP	D
	POP	B
	POP	H
	RET
;
;	GET CHARACTER INPUT FROM CONSOLE
;
GETINP:	PUSH	H
	PUSH	B
	PUSH	D
	MVI	C,CONINB	;GET CONSOLE INPUT
	CALL	BDOS
	POP	D
	POP	B
	POP	H
	RET
;
;	CHARACTER TABLE
;	THE CHARACTERS REPRESENTED IN THIS TABLE ARE IN A 5X7 FORMAT
;	AND WILL PRINT AS PER THIS EXAMPLE:
;
;
;	  *	00100   R	6
;	* * *	10101	E	5
;	 ***	01110	A	4
;	  *	00100	D	3
;	 ***	01110		2
;	* * *	10101	D	1
;	  *	00100	O	0
;		^^^^^	W
;		21712	N	^
;		24F42		B
;		HHHHH		I
;				T
;
;
;	"CHARACTER DEFINITION MAPS"
;	(DRAWN IN MIRROR-IMAGE, VIEWED FROM THE RIGHT)
;	"1"S MAKE UP THE IMAGE OF THE CHARACTER
;
CHARS:	DB	00000000b		;<SP>
	DB	00000000b
	DB	00000000b
	DB	00000000b
	DB	00000000b
;
	DB	00000000b		;EXCLAMATION MARK
	DB	00000000b
	DB	01111101b
	DB	00000000b
	DB	00000000b
;
	DB	00000000b		;"
	DB	01110000b
	DB	00000000b
	DB	01110000b
	DB	00000000b
;
	DB	00010100b		;#
	DB	01111111b
	DB	00010100b
	DB	01111111b
	DB	00010100b
;
	DB	00010010b		;$
	DB	00101010b
	DB	01111111b
	DB	00101010b
	DB	00100100b
;
	DB	01100011b		;%
	DB	01100100b
	DB	00001000b
	DB	00010011b
	DB	01100011b
;
	DB	00000010b		;&
	DB	00110101b
	DB	01001101b
	DB	00110010b
	DB	00000101b
;
	DB	00000000b		;'
	DB	00010000b
	DB	00100000b
	DB	01000000b
	DB	00000000b
;
	DB	00011100b		;(
	DB	00100010b
	DB	01000001b
	DB	00000000b
	DB	00000000b
;
	DB	00000000b		;)
	DB	00000000b
	DB	01000001b
	DB	00100010b
	DB	00011100b
;
	DB	00100010b		;*
	DB	00010100b
	DB	01111111b
	DB	00010100b
	DB	00100010b
;
	DB	00001000b		;+
	DB	00001000b
	DB	00111110b
	DB	00001000b
	DB	00001000b
;
	DB	00000000b		;,
	DB	00000001b
	DB	00000110b
	DB	00000000b
	DB	00000000b
;
	DB	00001000b		;-
	DB	00001000b
	DB	00001000b
	DB	00001000b
	DB	00001000b
;
	DB	00000000b		;.
	DB	00000011b
	DB	00000011b
	DB	00000000b
	DB	00000000b
;
	DB	00000010b		;/
	DB	00000100b
	DB	00001000b
	DB	00010000b
	DB	00100000b
;
	DB	00111110b		;0
	DB	01000101b
	DB	01001001b
	DB	01010001b
	DB	00111110b
;
	DB	00010001b		;1
	DB	00100001b
	DB	01111111b
	DB	00000001b
	DB	00000001b
;
	DB	00100001b		;2
	DB	01000011b
	DB	01000101b
	DB	01001001b
	DB	00110001b
;
	DB	00100010b		;3
	DB	01000001b
	DB	01001001b
	DB	01001001b
	DB	00110110b
;
	DB	00001100b		;4
	DB	00010100b
	DB	00100100b
	DB	01111111b
	DB	00000100b
;
	DB	01111010b		;5
	DB	01001001b
	DB	01001001b
	DB	01001001b
	DB	01000110b
;
	DB	00111110b		;6
	DB	01001001b
	DB	01001001b
	DB	01001001b
	DB	00100110b
;
	DB	01000001b		;7
	DB	01000010b
	DB	01000100b
	DB	01001000b
	DB	01110000B
;
	DB	00110110b		;8
	DB	01001001b
	DB	01001001b
	DB	01001001b
	DB	00110110b
;
	DB	00110000b		;9
	DB	01001001b
	DB	01001001b
	DB	01001001b
	DB	00111110b
;
	DB	00000000b		;:
	DB	00000000b
	DB	00110110b
	DB	00000000b
	DB	00000000b
;
	DB	00000000b		;;
	DB	00000001b
	DB	00010110b
	DB	00000000b
	DB	00000000b
;
	DB	00001000b		;<
	DB	00010100b
	DB	00100010b
	DB	01000001b
	DB	00000000b
;
	DB	00010100b		;=
	DB	00010100b
	DB	00010100b
	DB	00010100b
	DB	00010100b
;
	DB	00000000b		;>
	DB	01000001b
	DB	00100010b
	DB	00010100b
	DB	00001000b
;
	DB	00100000b		;?
	DB	01000000b
	DB	01001101b
	DB	01010000b
	DB	00100000b
;
	DB	00111110b		;@
	DB	01000001b
	DB	01011101b
	DB	01010101b
	DB	00111101b
;
	DB	00111111b		;A
	DB	01001000b
	DB	01001000b
	DB	01001000b
	DB	00111111b
;
	DB	01111111b		;B
	DB	01001001b
	DB	01001001b
	DB	01001001b
	DB	00110110b
;
	DB	00111110b		;C
	DB	01000001b
	DB	01000001b
	DB	01000001b
	DB	00100010b
;
	DB	01111111b		;D
	DB	01000001b
	DB	01000001b
	DB	01000001b
	DB	00111110b
;
	DB	01111111b		;E
	DB	01001001b
	DB	01001001b
	DB	01001001b
	DB	01000001b
;
	DB	01111111b		;F
	DB	01001000b
	DB	01001000b
	DB	01001000b
	DB	01000000b
;
	DB	00111110b		;G
	DB	01000001b
	DB	01000001b
	DB	01001001b
	DB	01001110b
;
	DB	01111111b		;H
	DB	00001000b
	DB	00001000b
	DB	00001000b
	DB	01111111b
;
	DB	01000001b		;I
	DB	01000001b
	DB	01111111b
	DB	01000001b
	DB	01000001b
;
	DB	00000010b		;J
	DB	00000001b
	DB	00000001b
	DB	00000001b
	DB	01111110b
;
	DB	01111111b		;K
	DB	00001000b
	DB	00010100b
	DB	00100010b
	DB	01000001b
;
	DB	01111111b		;L
	DB	00000001b
	DB	00000001b
	DB	00000001b
	DB	00000001b
;
	DB	01111111b		;M
	DB	00100000b
	DB	00010000b
	DB	00100000b
	DB	01111111b
;
	DB	01111111b		;N
	DB	00110000b
	DB	00001000b
	DB	00000110b
	DB	01111111b
;
	DB	00111110b		;O
	DB	01000001b
	DB	01000001b
	DB	01000001b
	DB	00111110b
;
	DB	01111111b		;P
	DB	01001000b
	DB	01001000b
	DB	01001000b
	DB	00110000b
;
	DB	00111110b		;Q
	DB	01000001b
	DB	01000101b
	DB	01000010b
	DB	00111101b
;
	DB	01111111b		;R
	DB	01001000b
	DB	01001100b
	DB	01001010b
	DB	00110001b
;
	DB	00110010b		;S
	DB	01001001b
	DB	01001001b
	DB	01001001b
	DB	00100110b
;
	DB	01000000b		;T
	DB	01000000b
	DB	01111111b
	DB	01000000b
	DB	01000000b
;
	DB	01111110b		;U
	DB	00000001b
	DB	00000001b
	DB	00000001b
	DB	01111110b
;
	DB	01110000b		;V
	DB	00001100b
	DB	00000011b
	DB	00001100b
	DB	01110000b
;
	DB	01111111b		;W
	DB	00000001b
	DB	00001110b
	DB	00000001b
	DB	01111111b
;
	DB	01100011b		;X
	DB	00010100b
	DB	00001000b
	DB	00010100b
	DB	01100011b
;
	DB	01110000b		;Y
	DB	00001000b
	DB	00000111b
	DB	00001000b
	DB	01110000b
;
	DB	01000011b		;Z
	DB	01000101b
	DB	01001001b
	DB	01010001b
	DB	01100001b
;
	DB	01111111b		;[
	DB	01000001b
	DB	01000001b
	DB	01000001b
	DB	00000000b
;
	DB	00100000b		;\
	DB	00010000b
	DB	00001000b
	DB	00000100b
	DB	00000010b
;
	DB	00000000b		;]
	DB	01000001b
	DB	01000001b
	DB	01000001b
	DB	01111111b
;
	DB	00010000b		;^
	DB	00100000b
	DB	01000000b
	DB	00100000b
	DB	00010000b
;
	DB	00000001b		;_
	DB	00000001b
	DB	00000001b
	DB	00000001b
	DB	00000001b
;
	DB	00000000b		;`
	DB	01000000b
	DB	00100000b
	DB	00010000b
	DB	00000000b
;
	DB	00000010b		;a
	DB	00010101b
	DB	00010101b
	DB	00001111b
	DB	00000001b
;
	DB	01111111b		;b
	DB	00001001b
	DB	00001001b
	DB	00001001b
	DB	00000110b
;
	DB	00001110b		;c
	DB	00010001b
	DB	00010001b
	DB	00010001b
	DB	00010001b
;
	DB	00000110b		;d
	DB	00001001b
	DB	00001001b
	DB	00001001b
	DB	01111111b
;
	DB	00001110b		;e
	DB	00010101b
	DB	00010101b
	DB	00010101b
	DB	00001001b
;
	DB	00001000b		;f
	DB	00001000b
	DB	00111111b
	DB	01001000b
	DB	01001000b
;
	DB	00001000b		;g
	DB	00010101b
	DB	00010101b
	DB	00010101b
	DB	00011110b
;
	DB	01111111b		;h
	DB	00001000b
	DB	00001000b
	DB	00001000b
	DB	00000111b
;
	DB	00000000b		;i
	DB	00000000b
	DB	00010111b
	DB	00000000b
	DB	00000000b
;
	DB	00000010b		;j
	DB	00000001b
	DB	00000001b
	DB	00000001b
	DB	00101110b
;
	DB	00111111b		;k
	DB	00000100b
	DB	00001010b
	DB	00010001b
	DB	00000000b
;
	DB	00000000b		;l
	DB	01000001b
	DB	01111111b
	DB	00000001b
	DB	00000000b
;
	DB	00011111b		;m
	DB	00010000b
	DB	00011111b
	DB	00010000b
	DB	00011111b
;
	DB	00011111b		;n
	DB	00001000b
	DB	00010000b
	DB	00010000b
	DB	00001111b
;
	DB	00001110b		;o
	DB	00010001b
	DB	00010001b
	DB	00010001b
	DB	00001110b
;
	DB	00011111b		;p
	DB	00010100b
	DB	00010100b
	DB	00010100b
	DB	00001000b
;
	DB	00001000b		;q
	DB	00010100b
	DB	00010100b
	DB	00010100b
	DB	00011111b
;
	DB	00011111b		;r
	DB	00001000b
	DB	00010000b
	DB	00010000b
	DB	00010000b
;
	DB	00001001b		;s
	DB	00010101b
	DB	00010101b
	DB	00010101b
	DB	00010010b
;
	DB	00001000b		;t
	DB	00001000b
	DB	00111110b
	DB	00001001b
	DB	00001001b
;
	DB	00011110b		;u
	DB	00000001b
	DB	00000001b
	DB	00000001b
	DB	00011111b
;
	DB	00011000b		;v
	DB	00000110b
	DB	00000001b
	DB	00000110b
	DB	00011000b
;
	DB	00011111b		;w
	DB	00000001b
	DB	00011111b
	DB	00000001b
	DB	00011111b
;
	DB	00010001b		;x
	DB	00001010b
	DB	00000100b
	DB	00001010b
	DB	00010001b
;
	DB	00011001b		;y
	DB	00000101b
	DB	00000101b
	DB	00000101b
	DB	00011110b
;
	DB	00010001b		;z
	DB	00010011b
	DB	00010101b
	DB	00011001b
	DB	00010001b
;
	DB	00001000b		;{
	DB	00110110b
	DB	01000001b
	DB	01000001b
	DB	00000000b
;
	DB	00000000b		;|
	DB	00000000b
	DB	01110111b
	DB	00000000b
	DB	00000000b
;
	DB	00000000		;}
	DB	01000001b
	DB	01000001b
	DB	00110110b
	DB	00001000b
;
	DB	00100000b		;~
	DB	01000000b
	DB	00100000b
	DB	00010000b
	DB	00100000b
;
;	BUFFERS
;
	DS	50
STACK:	EQU	$		;MARKER
	DS	2
NEXTCH:	DS	2
MAXLEN:	EQU	MAXCHR+1	;NUMBER OF CHARS ALLOWED IN LINE
;
INLINE:	DB	MAXLEN		;MAX CHARS ALLOWED IN INPUT BUFFER
INPCNT:	DS	1		;THE COUNT OF INPUTTED CHARS
INPBUF:	DS	MAXCHR		;TEMPORARY BUFFER FOR EACH HEADLINE
;
	DS	1		;ONE EXTRA FOR OVERFLOW CHAR
;
	END			;END OF PROGRAM
