H 1 9 L I B R A R Y Version H01.00 Date: March 22, 1980 System: H11 - HT-11 Author Duncan N. Tanner Livermore, Ca 94550 ABSTRACT H19 Library contains a collection of H11 assembly language subroutines for controlling the functions of the Heath/Zenith H19 terminal. H19 mnemonics as well as more conventional names are used for the function calls. The subroutines are useable in both HT-11 assembly language and HT-11 Fortran. They are NOT useable in BASIC. Page 2 INTRODUCTION The H19LIB subroutines allow use of most of the H19 features with the Heath Escape sequences. The mnemonics in the Heath H19 Operation Manual are used for most of the subroutine names. Calling the subroutine causes the correct escape sequence to be sent to the terminal. Additional subroutines combine functions to provide special functions unique to the H19 terminal. The subroutine library is divided into the following categories: Cursor control functions Erasing and editing Terminal configuration Modes of operation Graphics 25th line input-output Function keys SUBROUTINE USAGE The subroutines may be called from either PDP-11 assembly language or from HT-11 Fortran programs. ASSEMBLY LANGUAGE Most of the routines require no parameters and the call is simply: JSR PC,SUB where SUB is the subroutine name. Each subroutine name must also be included in a .GLOBL line in your program. Some subroutines require parameters or data which is passed to or from the subroutine. The description and type (character or integer) for each parameter is provided. The subroutines use the standard HT-11 and RT-11 Fortran subroutine calling sequence. Registor R5 is used to point to the parameter list. The subroutine will change R5 so it must be re-initialized each time the subroutine is called. An example of the subroutine usage is one which will enable the 25th line and move the cursor to the start of the line is shown below. MOV #LIST1, R5 ;Pointer to parameter list JSR PC, HSM ;Enable 25th line MOV #LIST, R5 ;Pointer to parameter list JSR PC, HDCA ;Call HDCA to move cursor ------- ------- LIST1: .WORD 1,ONE LIST: .WORD 2,ILIN,ICOL ;Parameter list ILIN: .WORD 25. ;Line 25 ICOL: .WORD 1 ;Column 1 ONE: .WORD 1 ;Number 1, enable 25th line. Page 3 The list contains the number of parameters followed by the locations of the parameters. NOTE: the list contains the location of the parameter not the value. In some cases the subroutine has two names. an example is CLEAR and HCD. Both are calls to the same subroutine which clears the screen. FORTRAN Fortran call sequence is like the call to any subroutine. the example above would appear as: CALL HSM(1) CALL HDCA(25,1) Page 4 CURSOR FUNCTIONS HCUH Sends cursor to home position. HOME Same as HCUH HCUF Move cursor forward one position HCUB Move cursor back one position HCUD Move cursor down one line HCUU Move cursor up one line HRI Move cursor up to the same horizontal position on the preceeding line. HCPR Gets current cursor position. Call is: CALL HCPR(ILINE,ICOL) ILINE - The line number ( 1 to 25 ) ICOL - The column number (1 to 80) HSCP Save current cursor position in terminal HRCP Restore cursor position to previously saved position. HDCA Direct cursor addressing. Moves cursor to point specified. Call is: CALL HDCA(ILINE,ICOL) ILINE - Line number ( 1 to 25 ) ICOL - Column number ( 1 to 80 ) POINT Same as HDCA. CALL POINT(ILINE,ICOL) ERASING and EDITING HCD Clears the display CLEAR Same as HCD HBD Erase from top of screen down to and including the cursor position. HEOP Erase to end of page. HEL Erase entire line HEBL Erase line from beginning to and including the cursor position. HEOL Erase to end of line. HIL Insert line HDL Delete line HDCH Delete character HEIM Enter insert character mode HERM Exit insert character mode Page 5 CONFIGURATION HRAM Reset to power-up configuration HRESET Same as HRAM HSM Sets modes The call is: CALL HSM(IMODE) IMODE= 1 Enable the 25th line. 2 No key click. 3 Hold screen mode 4 Block cursor 5 Cursor off 6 Keypad shifted 7 Alternate keypad mode 8 Auto line feed on receipt of CR 9 Auto CR on receipt of line feed HRM Reset modes The call is: CALL HRM(IMODE) IMODE= 1 Disable 25th line 2 Enable key click 3 Exit hold screen mode 4 Underscore cursor 5 Cursor on 6 Keypad unshifted 7 Exit alternate keypad mode 8 No auto line feed 9 No auto CR HEAM Enter ANSI Mode. NOTE: No other ANSI modes are supported in H19LIB. MODES of OPERATION HEHS Enter hold screen mode HXHS Exit hold screen mode HERV Enter reverse video mode HXRV Exit reverse video mode HEGM Enter graphics mode HXGM Exit graphics mode HEKS Enter keypad shifted mode HXKS Exit keypad shifted mode HAKM Enter alternate keypad mode HXAM Exit alternate keypad mode Page 6 Additional Functions HDK Keyboard disabled HEK Keyboard enabled HEWA Wraparound at end of line HXWA Discard characters at end of line GRAPHICS HBOX Draws a single line box of the size specified. Call is: CALL HBOX(ILINE1,ICOL1,ILINE2,ICOL2) ILINE1 - Line number of top of box ICOL1 - Column number of left side of box ILINE2 - Line number of bottom of box ICOL2 - Column number of right side of box HXBOX Replaces a box drawn by HBOX with spaces, thus erasing it. Call is: CALL HXBOX(ILINE1,ICOL1,ILINE2,ICOL2) The parameters are the same as for HBOX. 25TH LINE INPUT-OUTPUT WRIT25 This subroutine writes a message on the 25th line. The routine saves the current cursor position, enables the 25th line and writes text to the line in the starting position specified. The cursor is then returned to the previous position. The 25th line can be written in normal or reverse video, but it always returns to normal video. The call sequence is: CALL WRIT25(ISTR,MODE,IPOSN) ISTR A character string array to be sent to the 25th line. It must end with a zero byte (null character). In assembly language the .ASCIZ directive will produce this. In Fortran the text may be placed in the call as a parameter by surrounding it with ' . An example is CALL WRIT25('MESAGE',0,1) MODE An optional integer parameter indicating normal or reverse video. MODE=0 is normal video, the default. MODE=1 is reverse video. IPOSN An optional integer parameter between 1 and 80 indicating the starting position for the character string. If this parameter is omitted IPOSN=1 is assumed. Parameters MODE and IPOSN may be omitted, however if IPOSN is included then MODE is also required. Page 7 CLR25 This routine clears the entire 25th line. IMODE determines the form of the clear. IMODE=0 it is cleared. IMODE=1 the 25th line is filled with reverse video spaces. CALL CLR25(IMODE) GET25 This routine gets a string of characters from the 25th line. An optional string prompt may be included. CALL GET25(ISTR,IPRMPT) ISTR A character string array which receives the characters from the terminal. The string is terminated with a zero byte (null character). IPRMPT An optional character array which contains a prompt for the 25th line. If IPRMPT is included the 25th line is cleared prior to displaying the prompt. If IPRMPT is omitted no writing is done to the 25th line. Any previous characters in the line could confuse the user. PCLR25 This routine does a partial clear of the 25th line. Spaces are written from ICOL1 to ICOL2. CALL PCLR25(ICOL1,ICOL2) Page 8 FUNCTION KEYS HFIN Function key and character string input. All the Heath H19 function keys are supported in the Heath Escape Sequence mode. Function keys are decoded and returned as an integer value. Lower case input is also enabled. CALL HFIN(ISTR,IMODE) ISTR is a character string array sized to allow the longest line expected from the terminal plus one. The H19 allows 80 characters per line so we need to allow for 81. characters. This size is needed only if you expect a full line. ISTR contains the characters from the terminal except for valid escape sequences. Valid escape sequences are those corresponding to the H19 function keys. ISTR is terminated with a zero (NULL character). The function key is a line terminator. This means that you can type any characters before the function key, and the function key acts like a RETURN. A RETURN is also a line terminator as it is normally. If no function key is typed and a RETURN is entered the characters are returned and IMODE is set to zero. The RUBOUT and Control U do their usual thing. Normally none of the function key escape sequences are echoed back to the terminal. The cursor control functions can be enabled by calling subroutine HCURON (JSR PC,HCURON or CALL HCURON). After HCURON is called the cursor control function keys will be echoed and IMODE will be set. A call to HCUROF will disable the echo of the cursor functions. The default is HCUROF. IMODE is an integer indicating which function key, if any, was entered. -1 indicates an invalid escape sequence. The sequence is returned in ISTR 0 Means that no escape sequences were entered. ISTR contains any characters entered. NOTE: a zero in the first byte of ISTR means that only a RETURN was typed. A number greater than zero represents a function key as follows: Page 9 HFIN (continued) FUNCTIONS IMODE FUNCTION 1 F1 function key 2 F2 function key 3 F3 function key 4 F4 function key 5 F5 function key 6 Not used 7 F7 function key (blue) 8 F8 function key (red) 9 F9 function key (gray) ALTERNATE KEYPAD MODE IMODE KEY 10 0 key 11 1 key 12 2 key 13 3 key 14 4 key 15 5 key 16 6 key 17 7 key 18 8 key 19 9 key 20 . key 21 ENTER key SHIFTED KEYPAD - These functions are echoed if HCURON was called. IMODE KEY 31 1 (IL) insert line 32 2 (down arrow) cursor down 33 3 (DL) delete line 34 4 left arrow 35 5 HOME 36 6 right arrow 37 7 (IC) enter insert character mode 38 8 up arrow 39 9 (DC) delete character 40 7 exit insert character mode ERASE KEY 41 ERASE 42 SHIFT ERASE HCURON Enables cursor control escape sequence echoing with the routine HFIN. HCUROF Disables cursor control escape sequence echoing with the routine HFIN. Page 10 I N D E X 25th Line . . . . . . 6 Additional Functions . 6 CLEAR . . . . . . . . 4 CLR25 . . . . . . . . 7 Configuration . . . . 5 Cursor Functions . . . 4 Editing . . . . . . . 4 Erasing . . . . . . . 4 Function Keys . . . . 8 GET25 . . . . . . . . 7 Graphics . . . . . . . 6 HAKM . . . . . . . . . 5 HBD . . . . . . . . . 4 HBOX . . . . . . . . . 6 HCD . . . . . . . . . 4 HCPR . . . . . . . . . 4 HCUB . . . . . . . . . 4 HCUD . . . . . . . . . 4 HCUF . . . . . . . . . 4 HCUH . . . . . . . . . 4 HCUROF . . . . . . . . 9 HCURON . . . . . . . . 9 HCUU . . . . . . . . . 4 HDCA . . . . . . . . . 4 HDCH . . . . . . . . . 4 HDK . . . . . . . . . 6 HDL . . . . . . . . . 4 HEAM . . . . . . . . . 5 HEBL . . . . . . . . . 4 HEGM . . . . . . . . . 5 HEHS . . . . . . . . . 5 HEIM . . . . . . . . . 4 HEK . . . . . . . . . 6 HEKS . . . . . . . . . 5 HEL . . . . . . . . . 4 HEOL . . . . . . . . . 4 HEOP . . . . . . . . . 4 HERM . . . . . . . . . 4 HERV . . . . . . . . . 5 HEWA . . . . . . . . . 6 HFIN . . . . . . . . . 8, 9 HIL . . . . . . . . . 4 HOME . . . . . . . . . 4 HRAM . . . . . . . . . 5 HRCP . . . . . . . . . 4 HRESET . . . . . . . . 5 HRI . . . . . . . . . 4 HRM . . . . . . . . . 5 HSCP . . . . . . . . . 4 HSM . . . . . . . . . 5 Page 11 HXAM . . . . . . . . . 5 HXBOX . . . . . . . . 6 HXGM . . . . . . . . . 5 HXHS . . . . . . . . . 5 HXKS . . . . . . . . . 5 HXRV . . . . . . . . . 5 HXWA . . . . . . . . . 6 Modes of Operation . . 5 PCLR25 . . . . . . . . 7 POINT . . . . . . . . 4 WRIT25 . . . . . . . . 6 Page 12