• Aucun résultat trouvé

Terminal Output

Dans le document Reference Manual and Programming Guide (Page 64-70)

Chapter 4. Customizing IBM 7171 Tables

4.3 Terminal Definition Table Information

4.3.4 Terminal Output

Keyboard extension techniques depend on the manufacturer's assignment of control sequences to the supplied edit function keys. On the IBM 3101, where all function keys transmit sequences beginning with ESC, the ESC key itself is ambig-uous and should therefore be avoided as a manual sequence introducer. Therefore, the ERASE EOS key is recommended as the first key of two key sequences. Other terminals assign control characters to the edit function keys (BS for Cursor Left, LF for Cursor Down, etc.). On such terminals the use of ESC is recommended as a function introducer key.

Once the function introducer is chosen, there are some recommended guidelines for selecting the second key of the two stroke sequence for keyboard extension. One consideration is placement on the keyboard. The top row of the keyboard is com-monly used, in conjunction with the function introducer, to represent the first 12 PF keys. This was chosen because some models of real 327x terminals have PF keys in this location. It is also useful to assign the second twelve PF key values to the task of function introducer followed by the second row of the keyboard (QWERTYUIOP). But this is not always possible since these characters may be used in escape sequences generated by other keys on the terminal. For example, some terminals have a BACKTAB key which sends ESC-I. If ESC is the function introducer, the user must choose between using the BACKTAB key for its natural meaning and using ESC-I as PF 20. In some environments it may be possible to take advantage of the case (ESC-I is BACKTAB, ESC-i is PF 20), but this would be risky.

When followed by a keyboard function key, the function introducer is sometimes used to mean "more" (DELETE means Delete Character, Function-DELETE means ERASE EOF), or "opposite" (Function-TAB means BACKTAB), or

"looks like" (Function-Semicolon is Field Mark because FM prints as a semicolon on most 327x models). But, in the final analysis many choices are a matter of per-sonal preference.

Control Sequence Strings and Pointers

Each terminal must perform certain hardware functions upon receiving a character sequence. Normally we think these functions occur when the associated key is pressed on the keyboard. However, on a full duplex terminal, the function is per-formed only after a string has been transmitted from the keyboard to the IBM 7171, and another string has been sent back to the terminal.

The IBM 7171 is not required to send back the same string that the keyboard transmitted. For example, it is convenient to simply associate keys with the func-tions printed on them. Thus if there already is a key marked HOME it is natural to use it to emulate the 327x HOME function. In a full screen application, however, the 327x HOME key requests that the cursor be positioned at the first unprotected position on the screen. When the user presses the HOME key on an IBM 3101, a two character sequence "ESC H" is sent to the IBM 7171. If the 7171 simply echoed back these two characters, the cursor would be positioned by the IBM 3101 at the upper left corner of the screen. Instead, a four character sequence "ESC Y row col," which positions the cursor at the screen address associated with the first logically unprotected character position, is sent. This mapping of input string to different output strings is performed by IBM 7171.

Chapter 4. Customizing IBM 7171 Tables

4-11

These output strings are called Control Sequence Strings (CSS). They are specific to each terminal and must be found in the terminal manufacturer's specification manual. There are 19 defined Control Sequence Strings, but CSSs 7 and 8 are not used.

Following is a list of each of the CSSs and their meanings:

1. Reposition is required to generate the terminal specific control character sequence to position the cursor. When it is received by the terminal, the cursor is positioned according to the data sent in the string. As such some characters or character strings in this control string are variable and must be dynamically generated using the current cursor position. The dynamic generation of cursor position is performed by the routines shown in the following figure:

X'FE'

Character column value Character row value

User generated column value User generated row value Hardcopy terminal positioning

Figure 4-2. Cursor Positioning Routine Names

a. The two routines BINX and BINY each form a one byte binary position by adding the cursor base value to the column or row number. This is the most common cursor positioning method. The following table gives the hex values generated by BINX and BINY for different possible cursor base values.

b. The ANSI X3.64 standard for terminal control sequences defines instead the use of character text strings for numeric values. In this scheme, column 20 would be represented in the proper control string context by the ASCII character string "20" (X' 3230'). The two routines CHARX and

CHARY will produce such numeric character parameters for terminals that conform to this convention. When this form of addressing is used, the cursor base should be specified as the number (not the character) zero or one. The following table gives the hex values generated by CHARX and CHARY for different possible cursor base values.

4-12

IBM 7171 Reference Manual and Programming Guide

c.

USERX and USERY invoke user supplied cursor positioning routines. The user may add a new cursor positioning algorithm to support a non-standard terminal. These routines must be entered as executable INTEL 80186 object code. A new Terminal Definition Table must be created in

NY-RAM with a modified cursor positioning CSS string. When the cursor positioning control string contains X ' F6 ' , the IBM 7171 will call a user supplied cursor x-positioning routine located in NY -RAM. The column value (zero base, e.g. the first column = X' 0000' ) is passed to a special USERX routine via the AX register. Similarly, if the control string con-tains X' F4', a call to a user supplied cursor y-positioning routine occurs and the row value (zero base, e.g. the first row

=

X' 0000 ' ) is passed to a USERY routine via the AX register. The user routines must return the con-verted x or y data to be sent to the terminal in the AX and DX registers.

On return the user must load the CX register with a count of the number of bytes (0 to 4) to be sent to the terminal and issue a return instruction.

The byte contained in AL will be sent first, followed by AH, DL, and DH, until the count contained in CX is exhausted. For example, to position the cursor to the third line on a display, the IBM 7171 loads X ' 0002' into the AX register and calls the user supplied y-positioning routine. If the ter-minal requires a X' 22' to perform this movement, the routine would return X' 22' in AL and a byte count of X' 0001' in CX. In this case data returned in registers AH, DL, and DH are ignored. All registers are saved before the call to the user routine and restored after the return.

The user may enter his routines using the "Store to CPU Board Memory"

command of the Maintenance Facility. The interface to these customized cursor positioning routines is defined below.

segment: offset

USERX offset address USERX segment address USERY offset address USERY segment address The user must modify the offset addresses to point to his routines which must be located in an unused part of NY-RAM. The segment addresses do not need to be changed. The offset addresses as delivered point to a dummy routine in ROM at X' DCOO:71BA' which sets the byte count in register CX to zero and does a return. For example, to add a USERX routine at X' DCOO:400' and a USERY routine at X' DCOO:420' enter the following Store commands using the Maintenance Facility:

s DCOO:2F6 0004

Chapter 4. Customizing mM 7171 Tables

4-13

s DCOO:2FA 2004

s DCOO:400 <object code for USERX, X' CB' return>

s DCOO:420 <object code for USERY, X' CB' return>

d. HARDCOPY invokes a routine which attempts to provide a useful approx-imation to cursor positioning on a hardcopy terminal, which is assumed to respond in the usual way to ASCII CR and LF. Cursor left and right are both used as defined in CSS 5 and 6 and any change of row causes move-ment down the page.

2. Erase to End of Line is the terminal defined control sequence to generate the standard erase to end of line function.

3. Local Print is sent to terminals which can print an image of the screen to a hardcopy device connected to an auxiliary printer port of the terminal. It will invoke the local print function on this type of terminal when the appropriate input sequence has been recognized.

4. Tone is the control sequence string that generates an audible alarm ("beep").

5. Cursor Left is the control sequence string to move the cursor on the screen one character position to the left.

6. Cursor Right is the control sequence string to move the cursor on the screen one character position to the right.

7. -- not used -- . 8. -- not

used--9. Signal Insert Mode is a string which is sent to the terminal when the user has entered insert mode. 327x terminals have insert mode indicators. Transmitting the terminal defined "Signal Insert Mode" CSS to an ASCII terminal should generate an equivalent indication for the insert status on that terminal. Some terminals have one or more lights or indicators which can be turned on or off under program control. On other terminals, the cursor might be set to blink when in insert mode but not to blink normally.

10. Signal End Insert Mode is a string which should turn off the insert mode indi-cator when the terminal user leaves insert mode.

11. Disconnect is a string sent to the terminal on a host initiated or keyboard initi-ated line drop.

12. Clear Screen is the control sequence that clears the display screen and selects the default screen size.

13. Terminal Initialize is a string which is sent to the terminal at initial connection (dial up, or power on) after the terminal type has been determined, or on receipt of a Master Reset sequence from the terminal. For example, on a ter-minal conforming to ANSI X3.64 it might be appropriate to send the RIS (Reset to Initial State) control function to clear any inappropriate protected fields, partial screens, insert or other modes, and other logical states left over from a previous session with another computer system.

4-14

IBM 7171 Reference Manual and Programming Guide

14. megal ASCII Character is a character or string which is written to the terminal to represent an unprintable character. The TDTs supplied with the distributed system use a colon (:) for this purpose. However, on certain terminals it may be desirable to choose a less ambiguous character. For instance, if the user has only Model 2x versions of the IBM 3101 terminal, a suitable alternate choice might be:

ESC,E (X I 1B45 I)

which writes an unusual graphic character (normally called the "SEND MARK") that produces a unique display. On the other hand, on the IBM 3101 Model Ix it is possible to display a square blot on the screen with the more complicated

DLE,STX,DEL,DLE,ETX (X I 10027F1003 I)

Although this string contains five control characters, it produces the required result to be the illegal character token: it displays something unusual in the screen position, occupies only one space on the screen, has no effect on the characters which follow or precede it, and when done it has advanced the cursor one position to the right. Screen wrap at end of line is also handled properly.

15. megal APL Character is a special string for displaying illegal characters in APL mode. The normal setting for this string is:

n,BS,z (X I 6E087 A I )

The lower case here is misleading. The control sequence strings are never translated by the APL mode setting, so lower case prints as upper case. "N"

overstruck with "Z" produces a fairly solid blot on most APL terminals.

16. APL ON provides a string which may exist on terminals to turn APL mode on to permit display of both APL and normal ASCII characters on the same screen image.

17. APL OFF turns APL mode off again.

APL ON/OFF provides two strings which may exist on terminals to turn APL mode on and off dynamically to permit display of both APL and normal ASCII characters on the same screen image. On most terminals with dynamic APL capability, the control character SO (Shift Out) turns APL mode on and SI (Shift In) turns it off. However, it is possible that some other terminals would use another control sequence for this purpose.

18. Display Mode is a string that the IBM 7171 uses to support highlighting and basic color (see "Graphic Rendition Strings" on page 4-16 for details).

19. Alternate Clear Screen is the control sequence that clears the display screen and selects the alternate screen size.

Chapter 4. Customizing IBM 7171 Tables

4-15

Graphic Rendition Strings

SGR stands for Set Graphic Rendition and is borrowed from the ANSI X3.64 standard document where it is the name given to the control string which performs the highlight/color function. For this string to be invoked, the X' 0800' FLAGS bit must be set ON in the terminal header of the given terminal type (see "Terminal Header Information" on page 4-28). The SGR string in conjunction with the eighteenth Control Sequence String defines the display modes highlighting and/or basic color.

Special routines (BINFLD and CHARFLD) are called from the eighteenth CSS.

Each routine operates in conjunction with the SGR string for this terminal type and the attributes of the current field to perform the highlight/color function.

On an IBM 3277 or 3278 the only form of alternate display available is highlighting, and therefore only the highlight attribute is important. On the 3279, however, there is a mode of operation called basic color in which four different colors are assigned to the unprotected unhighlighted, unprotected highlighted, protected unhighlighted, and protected highlighted fields. The IBM 7171 can support this philosophy of display, but requires more flexibility than the 3279 hardware pro-vides.

For one thing, while every color CRT has 6 colors plus black and white, there are substantial differences between the brightness of different choices. On most screens, blue is too dark to be read against a black background. Red is better, but is still uncomfortable to read. Yellow may be difficult to distinguish from green, and white is difficult to distinguish from cyan. Thus, selecting a usable set of four distinguishable colors can result in different choices for different devices. Further-more, there are alternate modes of display, such as reverse video, blink, or under-score, which may be used even on a monochrome terminal to achieve four

distinguishable field display modes. Finally, different applications may require dif-ferent choices of the four display options.

To accommodate these requirements, each terminal type is associated with an SGR string which supplies a primary and an alternate graphic rendition of the four pos-sible combinations of protect and highlight field attributes. A fifth parameter is supplied for nondisplay fields.

The field attribute of the current display field is used to index into the first

(primary) or second (alternate) half of the SGR string to find the parameter which sets the terminal to the right mode. The index values are:

o

Nondisplay

1 Normal intensity unprotected 2 High intensity unprotected 3 Normal intensity protected 4 High intensity protected

The selection of the first or second half of the SGR string is made by the setup functions "Primary/Alternate Display of Attributes" in 3.1.6, "Setup Functions"

on page 3-3.

The value of the byte selected in the SGR string can be used in the eighteenth CSS in one of two ways. If BINFLD (X' EE ' ) is specified in the string, the contents of the byte are substituted into that position in· the string directly as an ASCII

char-4-16

IBM 7171 Reference Manual and Programming Guide

Dans le document Reference Manual and Programming Guide (Page 64-70)