• Keine Ergebnisse gefunden

CONSOLE AND PRINTER INPUT/OUTPUT SUBROUTINES

Im Dokument first title (Seite 81-85)

3) READY 3.2 POWER-ON

4.3 MOOS SHARED SUBROUTINES

4.3.1 CONSOLE AND PRINTER INPUT/OUTPUT SUBROUTINES

Micropo1is Program Development Software packages perform input and output through the following subroutines. These routines link the system with the device handlers described in Chapter II under configuring for

supported devices.

The device handler routines start with a vector table whose address is

@CIOTABLE for the console, and @LIOTABLE for the printer. The routines in this section enter the drivers by indirectly accessing these tables using @CONSOLEADDR. and @LISTADOR which are buffers that hold pointers to the actual location of @CIOTABLE and @LIOTABLE. By changing the two bytes at locations @CONSOLEAOOR or @LISTAODR the user can have spec;a1 purpose drivers in memory at the same time as the standard drivers.

4.3.1.1 @CIN - CONSOLE INPUT

The @CIN routine waits for input from the system console. It strips parity and changes ASCII codes SF (backarrow) and 7F (rubout) into 08 (backspace). It returns the input character (7 bit ASCII) in the B register, with the carry flag clear (NC). It preserves the HL, DE, and C registers.

4.3.1.2 @COUT - CONSOLE OUTPUT

The @COUT routines waits until the console stream is ready and then outputs a character. It changes carriage returns into a carriage return followed by the number of nulls associated with the device attached to the console stream. It changes ASCII code 08 hex (backspace) into a SF (backarrow).

If the wrap logic for the device assigned to the console stream is enabled a line feed ana a carriage return nulls sequence will be output when the

Rev. 8 9/78 4-18

number of characters on the line equals the width. Refer to the ASSIGN command in the MOOS executive. It expects the character (7 bit ASCII) in the B register. It returns the carry flag set (C) if a printer attention condition occurs. and sets the assignment to ASSIGN 1 1. and ASSIGN 2 2. Refer to the ASSIGN command in the MOOS executive. It preserves the HL, DE. and BC registers.

4.3.1.3 @CBRK - CONSOLE CHECK BREAK

The @CBRK routine checks the console device for the input of a cancel (control C), or a 'pause (control S). It returns the zero flag set (Z) and the CANCELED message code in the A register if a CONTROL C (03) is

input. It preserves the HL. DE, and C registers. On pause (control S) the routine loops, waiting for another character to be input. Entry of any character other than control S will terminate the pause and return to the call er.

4.3.1.4 @CDIN - CONSOLE DEVICE INPUT

The @COIN routine waits for input from the console device. It returns the character (8 bits including parity) in the B register, with the carry flag clear (NC). It preserves the DE, HL, and C registers.

4.3.1.5 @CDOUT - CONSOLE DEVICE OUTPUT

The @CDOUT routine'waits until the console device is ready to receive a byte and then outputs it. It expects the byte for output in the B register.

It preserves the DE, HL. and BC registers. It returns the carry flag c1 ear

(Ne). '

4.3.1.6 @CDBRK - CONSOLE DEVICE BREAK CHECK

The @CDBRK routine checks the console input ready status. If an input, is ready it gets the input. Otherwise it returns immediate1~. It ret~rns

the zero flag set (Z) and the input character (8 bits inc1uaing parity) in the B register if there was an input. It preserves the DE, HL, and C registers. If there was no input the @CDBRK routine returns the zero flag

clear (NZ), and the B register is unchanged.

4.3.1.7 @CDINIT - CONSOLE DEVICE INITIALIZATION

The @CDINIT routine initializes the console interface device. it preserves the HL. DE, and BC registers. It returns the carry flag clear (NC).

4.3.1.8 @LOUT - LIST OUTPUT

The @LOUT routine waits until the list stream ;s ready to receive and then outputs a character. It changes carriage returns into a carriage return followed by the number of nulls associated with the device attached to the list stream. It changes ASCII code 08 hex (backspace) into a SF (backarrow). If the wrap logic for the device assigned to the list stream is enabled a 1; ne feed and a ca rri age return null s seGuence wi,11 . be. output

4-19

Rev. 8 9/78

when the number of characters on the line equals the width. Refer to the ASSIGN command in the MOOS executive. It expects the character (7 bit ASCII) in the B register. It returns the carry flag set (e) if a printer attention condition occurs, and sets the assignment to ASSIGN 1 1, and ASSIGN 2 2. Refer to the ASSIGN command in the MOOS executive.

It preserves the HL, DE. and Be registers.

4.3.1.9 @LATN - LIST ATTENTION

The @LATN routine checks the list stream for a printer attention condition.

It returns the carry flag set (C) if a printer attention condition occurs, and sets the assignment to ASSIGN 1 1, and ASSIGN 2 2. Refer to the ASSIGN command in the MOOS executive. It preserves the HL. DE, and BC registers.

4.3.1. 10 @LDOlJL::...LIST DEVICE OUTPUT

The @LDOUT routine waits until the list device is ready to receive a byte and then outputs it. It expects the byte for output in the B register.

It preserves the DE, HL, and Be registers. It returns the carry flag set (C) if a printer attention occurs.

4.3.1.11 @LDATN - LIST DEVICE ATTENTION

The @LDATN routine checks the list device for a printer attention condition.

It returns the carry flag set (C) if a printer attention condition occurs.

It preserves the HL, DE, and BC registers.

4.3.1.12 @LDINIT - LIST DEVICE INITIALIZATION

The"@LDINIT routine initializes the list device. It preserves the HL, DE.

and

Be

registers. It returns the carry flag clear (NC).

4.3.1.13 @CCRLF - CONSOLE LINE FEED CARRIAGE RETURH

The @CeRLF routine outputs a line feed carriage return and nulls to the console stream. It returns the carry flag set (e) if a printer attention condition occurs, and changes the assignment to ASSIGN 1 1, and ASSIGN 2 2.

Refer to the ASSIGN command in the MOOS executive. It preserves the HL, DE. and BC registers.

4.3.1.14 @LCRLF - LIST LINE FEED CARRIAr,E RETURN

The @LeRLF routine outputs aline feed carriage return and nulls to the

list output stream. It returns the carry flag set (C) if a printer attention condition occurs, and changes the assignment to ASSIGN 1 1, and ASSIGN 2 2.

Refer to the ASSIGN command in the MOOS executive. It preserves the HL, DE, and BC registers.

4.3.1.15 @ASSIGN - ASSIGN

The @ASSIGN routine assigns the physical device to specified logical stream(s) and sets the width and nul1count associated with the device. It expects the

physical device number in the E register, the logical stream mask in the D

Rev. 7 3/78 4-20

register, the width in the C register, the nullcount (nulls+l) in the B register, and the number of parameters passed in the H register. No

registers are preserved. (Refer to the ASSIGN command in the executive for a detailed discussion of physical device assignment to logical output

streams).

4.3.1.16 @CILINE - CONSOLE INPUT LINE

The @CILINE routine outputs a specified prompt message to the console and then buffers up to 132 characters of input text from the console device. It provides the standard backspace (rubout) and line cancel (CNTL/X) controls during the line entry process. The text line input is terminated by a carriage return. (Note: The carriage return is not echoed to the console). It expects the address of a string of text to be output as a prompt in the HL registers. The message pointed to must be properly terminated with a byte code of 0 through IF hex or the high order eight bit of the last byte set. It returns the input line ;n @INBUFF. and the number of input characters including the terminating carriage return in the B register. It preserves the HL. DE. and C registers. Any control char-acters input during the line entry process are echoed to the console str.eam but not entered into @INBUFF.

4.3.1.17 @HEXOUT - HEXAOECI~~L OUTPUT

The @HEXOUT routine converts an unsigned 8 bit binary value in the A

register to a hex number and outputs the number to the console. It returns the carry flag set (C) if a printer attention condition occurs, and changes the assignment to ASSIGN 1 1, and ASSIGN 2 2. Refer to the ASSIGN command in the MOOS executive; It preserves the HL, DE, and C registers.

4.3.1.18 @HEXADOOUT - HEXADECI~mL ADDRESS OUTPUT

The @HEXADOOUT routine converts an unsigned 16 bit binary value in the HL registers to a hex number and outputs the number to the console followed

by one space character. It returns the carry flag set (C) if a printer attention condition occurs, and changes the assignment to ASSIGN 1 1, and ASSIGN 2 2. Refer to the ASSIGN command in the MOOS executive. It preserves the HL, DE. and C registers.

4.3.1.19 @HEXOUTSPC - HEXADECIMAL OUTPUT WITH SPACE

The @HEXOUTSPC routine converts an unsigned 8 bit binary value in the Hl registers to a hex number and outputs the number to the console followed by one space character. It returns the carry flag set (C) if a printer attention condition occurs, and changes the assignment to ASSIGN 1 1, and ASSIGN 2 2. Refer to the ASSIGN command in the MOOS executive. It preserves the HL. DE, and C registers.

4.3.1.20 @SPACEOUT - SPACE OUTPUT

The @SPACEOUT routine outputs a space (20 hex) to the console stream.

It returns the carry flag set (C) if a printer attention condition occurs, and changes the assignment to ASSIGN 11, and ASSIGN 2 2. Refer to the ASSIGN command in the MOOS executive. It preserves the HL. DE. and C registers.

4-21 Rev. 8 9/78

4.3. 1.21 @NLINEOUT - NEW LINE OUTPUT

The @NLINEOUT routine outputs a carriage return line feed and a line of text to the console stream. It expects the address of the beginning of the text line in the HL registers. The message pointed to must be properly terminated with a byte code in the range g through IF hex or the high order eighth bit of the last byte set. It returns the carry flag clear (NC) in all cases. It preserves the HL, DE, and C registers.

4.3.1.22 @LINEOUT - LINE OUTPUT

The @LINEOUT routine outputs a line of text to the console stream. It expects the address of the beginning of the text line in the HL registers.

The message pointed to must be properly terminated with a byte code in the range g through IF hex or the high order ei~hth bit of the last byte set. It returns the carry flag clear (NC) in all cases. It preserves the HL, DE, and C registers.

Im Dokument first title (Seite 81-85)