The text of a manual · part 23 of 38
PEN*KEY 6100 Computer Programmer's Reference Guide: Section 6: Conversions and Interfaces, pages 197 to 206
Pages 197 to 206 of 328, from PEN*KEY 6100 Computer Programmer's Reference Guide
The original document is the PDF (1.2 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Norand 6100
Page 197
SECTION 6
Conversions and Interfaces
INT 13h, Function AH = 04h: Verify Sectors BIOS The sector block checks for the requested sectors are verified. 6. Conversions and Interfaces
On Entry: AH = 04h AL = Number of sectors DH = Track number DL = Drive number CH = Cylinder number CL = Sector number ES:BX = Buffer address On Return: Carry = Set (if AH is nonzero) AH = Disk status AL = Number of sectors actually transferred INT 13h, Function AH = 08h: Read Drive Parameters BIOS A fixed format is all that is supported for any drive. This function reports the native format for any given drive. On Entry: AH = 08h DL = Drive number On Return: AH = Error code if carry set = 1 Carry = Set of invalid drive AX = 0 if no error BX = 5 if no error CX = 7F08h = 128 cylinders, 8 sectors per track DH = 0 = One head per cylinder DL = 3 = Number of floppy drives INT 13h, Function AH = 15h: Get Disk Type BIOS Returns AH = 01 (floppy with NO changeĆline support ) as long as the drive numĆ ber is valid. On Entry: AH = 15h DL = Drive number On Return: Carry = Set if invalid drive (error code = 1 if carry set) AH = Type code: 00h = No such drive 01h = Floppy without changeĆline support 02h = Floppy with changeĆline support 03h = Hard disk CX:DX = Number of 512Ćbyte sectors PEN*KEY R 6100 Computer Programmer’s Reference Guide
6-61
Page 198
Conversions and Interfaces
SECTION 6
INT 13h, Function AH = 16h: Detect Disk Change
6. Conversions and Interfaces
BIOS Verifies that the specified PC Card drive is available. This procedure returns disk change for PC Cards if they are present. It returns not ready if the PC Card is not present. Call Function 15h first to see whether the drive supports a change line. On Entry: AH = 16h DL = Drive number On Return: AH = Type code: 00h = No such drive 01h = Floppy without changeĆline support 02h = Floppy with changeĆline support 03h = Hard disk CX:DX = Number of 512Ćbyte sectors Carry = Set if invalid drive or media changed (Error code = 1 if carry set) Clear if no media change AH = Drive status 00h = No media change 01h = Invalid drive 06h = Media changed or change line not supported 80h = Card is not present INT 13h, Function AH = 18h: Set Media Type BIOS On Entry: AH = 18h DL = Drive number CH = Lower 8 bits of highest cylinder number CL = Sectors per track (bits 0-5) top 2 bits of highest cylinder number (bits 6, 7) On Return: CX:DX = Number of 512Ćbyte sectors Carry = 0 (if no error) AH = 0 1 (if error) AH = Type code: 00h = No such drive 01h = Floppy without changeĆline support 02h = Floppy with changeĆline support 03h = Hard disk INT 13h, Function AH = DAh: Disable RAM Drive BIOS Reprograms the memory controller to disable access to the RAM associated with the RAM drive. On Entry: AH = 0DAh DL = 0 On Return: AH =0 6-62
PEN*KEY R 6100 Computer Programmer’s Reference Guide
Page 199
SECTION 6
Conversions and Interfaces
INT 13h, Function AH = EAh: Enable RAM Drive
On Entry: AH = 0EAh DL = 0 On Return: AH = 0 INT 13h, Function AH = ECh: Enable Checksum BIOS Copies the following RAM drive signature into the reserved portion of the RAM drive logical boot sector. _RamDriveSignature label byte db “Norand RamDrive”,0 db 0,0, 0Fh, 0FFh,0FFh,0FFh db 0F0h, 3Ch,99h,0C3h, 55h,0AAh
On Entry: AH = 0ECh ES:SI = Pointer to global descriptor table (GDT): offset 00h = Uninitialized, null descriptor 08h = Uninitialized, is made into GDT descriptor 10h = Uninitialized, descriptor for source of move 18h = Uninitialized, descriptor for destination of move 20h = Uninitialized, used by BIOS 28h = Uninitialized, is made into SS descriptor 0 On Return: Carry = 0 (if no error) 1 (if error) AH = Return code 00h = Normal return 01h = Parity error 02h = Interrupt error 03h = Address line 20 gating failed
PEN*KEY R 6100 Computer Programmer’s Reference Guide
6-63
6. Conversions and Interfaces
BIOS Reprograms the memory controller to enable access to the RAM associated with the RAM drive.
Page 200
Conversions and Interfaces
SECTION 6
Serial Communications Services: Interrupt 14h INT 14h, Function AH = 00h: Initialize Communications Port 6. Conversions and Interfaces
BIOS, 4000API Programs the Baud Rate Register and Byte Format Register for the selected port and return values of the Line Status Register and Modem Status Register. On Entry: AH = 00h DX =Communications port number AL = Communications parameters: Bits 7, 6, 5: Baud Rate 000 = 110 bps 001 = 150 bps 010 = 300 bps 011 = 600 bps 100 = 1200 bps 101 = 2400 bps 110 = 4800 bps 111 = 9600 bps Bits 4,3: Parity 00 = NO parity 10 = ODD parity 11 = EVEN parity Bit 2: Stop Bits 0 = 1 stop bit 1 = 2 stop bits Bits 1, 0: Word Length 10 = 7Ćbit word length 11 = 8Ćbit word length On Return: AH = Line status register: 7 = Timeout (if set, other bits are meaningless) 6 = Transmit shift register empty 5 = Transmit holding register empty 4 = Unused (break detected) 3 = Framing error 2 = Parity error 1 = Overrun error 0 = Data ready AL = Modem status register: 7 = Carrier detect (CD) 6 = Ring Indicator (RI) 5 = Data Set Ready (DSR) 4 = Clear To Send (CTS) 3 = Delta CD 2 = Delta trailing edge RI 1 = Delta DSR 0 = Delta CTS
6-64
PEN*KEY R 6100 Computer Programmer’s Reference Guide
Page 201
SECTION 6
Conversions and Interfaces
INT 14h, Function AH = 01h: Send a Character
On Entry: AH = 01h DX = Communications port number AL = Character to be sent On Return: AH = Line status as for Function 00h DTR and RTS are raised and DSR and CTS are expected within a timeout period specified by an array at 40:7C. INT 14h, Function AH = 02h: Receive a Character BIOS, 4000API Receives a character in register AL via the communications port specified by DX. DTR is raised, RTS is dropped, and DSR is expected within a timeout period speĆ cified by an array at 40:7C. When DSR is received, a character is expected withĆ in the receive buffer within the timeout period. If a timeout occurs, the timeout bit is set in AH. If a character is received, it is returned in AL. The value of the Line Status Register is returned in AH. On Entry: AH = 02h DX = Communications port number On Return: AH = Line status as for Function 00h AL = Character received DTR and RTS are raised and DSR and CTS are expected within a timeout period specified by an array at 40:7C. INT 14h, Function AH = 03h: Get Port Status BIOS, 4000API Returns the current line and modem status for the communications port speciĆ fied by DX. The value of the Line Status Register is returned in AH. The value of the Modem Status Register is returned in AL. On Entry: AH = 03h DX = Communications port number On Return: AH = Line status (same as Function 00h) AL = Modem status (same as Function 00h)
PEN*KEY R 6100 Computer Programmer’s Reference Guide
6-65
6. Conversions and Interfaces
BIOS, 4000API Transmits the character in register AL via the communications port specified by DX. DTR and RTS are raised, and DSR and CTS are expected within a timeout period specified by an array at 0:7C. Once DSR and CTS are received, the charĆ acter to be sent is placed in the transmit buffer register. The value of the Line Status Register is returned in AH.
Page 202
Conversions and Interfaces
SECTION 6
INT 14h, Function AH = 04h: Extended Initialize
6. Conversions and Interfaces
BIOS, 4000API Programs the Baud Rate Register and Byte Format Register for the selected port and return values of the Line Status Register and Modem Status Register. On Entry: AH = 04h DX = Communications port number BH =Parity setting: 0 = None 1 = Odd 2 = Even BL = Stop bits: 0 = One 1 = Two CH =Word length: 2 = 7 bits 3 = 8 bits CL = Baud rate: 0 = 110 1 = 150 2 = 300 3 = 600 4 = 1200 5 = 2400 6 = 4800 7 = 9600 8 = 19200 9 = 38400 10 = 57600 11 = 115200 12 = 125000 13 = 250000 14 = 500000 On Return: AH = Line status (same as Function 00h) AL = Modem status (same as Function 00h) This is a nonstandard PC function. It may not be available in every PC BIOS. Use caution where portability is a concern.
6-66
PEN*KEY R 6100 Computer Programmer’s Reference Guide
Page 203
SECTION 6
Conversions and Interfaces
INT 14h, Function AH = 05h: Extended Port Control
6. Conversions and Interfaces
4000API On Entry: AH = 05h AL = 0 = Read modem control register 1 = Write modem control register BL = Modem control register value (if write): 7 = Ignore modem control signals, COM1 only 6-2 = Reserved 1 = RTS 0 = Data terminal only DX = Communications port number On Return: AH = Line status (same as Function 00h) AL = Modem status (same as Function 00h) BL = Modem control register value (if read) This is a nonstandard PC function. It may not be available in every PC BIOS. Use caution where portability is a concern. INT 14h, Function AH = FFh: Port Power Off or On 4000API Turns off the communications port driver power. On Entry: AH = 0FFh DX = Communications port number AL = Turn communications port power 0 = Off 1 = On On Return: None This is a nonstandard PC function. It may not be available in every PC BIOS. Use caution where portability is a concern.
PEN*KEY R 6100 Computer Programmer’s Reference Guide
6-67
Page 204
Conversions and Interfaces
SECTION 6
System Services: Interrupt 15h INT 15h, Function AX = 0100h: Create a Task 6. Conversions and Interfaces
4000API Creates a task and inserts the new task into the ready list. On Entry: AH = 01h AL = 00h ES:BX = Context pointer On Return: CX = New task identifier The context pointer (ES:BX) points at a structure that looks like the following Code Fragment: context struc dival dw sival dw bpval dw dw bxval dw dxval dw cxval dw dw esval dw dsval dw ipval dw csval dw dw context ends
? ? ? ? ? ? ? ? ? ? ? ? ?
;di register contents for new task ;si register contents for new task ;bp register contents for new task ;does not care ;bx register contents for new task ;dx register contents for new task ;cx register contents for new task ;does not care ;es register contents for new task ;ds register contents for new task ;ip register contents for new task ;cs register contents for new task ;does not care csval:ipval specifies the code segment and instruction pointer where the child task begins execution; the parent task MUST provide them. The child task always inherits the flags register from the parent. Create returns a task ID that is computed with the following equation (ES:BX is the value passed to the create task function): Task_id = ((es << 4) + bx) >> 4;
When a newly created task is activated, SS (stack segment) is set to the passed value of ES (extra segment); SP (stack pointer) is set to the passed value of BX. The task context is then popped off the stack into the processor registers and an IRET is executed to pass control to the task. Thus, the new tasks SS:SP point at the of the context passed during the create command. INT 15h, Function AX = 0101h: Delete a Task 4000API On Entry: AH = 01h AL = 01h CX = Task identifier (0 means delete current task) On Return: CX = Task identifier (0 if task not found) ES:BX = Released TCB address 6-68
PEN*KEY R 6100 Computer Programmer’s Reference Guide
Page 205
SECTION 6
Conversions and Interfaces
INT 15h, Function AX = 0102h: Return Information About a Task
It is not possible to obtain the TCB address for the current task. The TCB exists on the task stack only when the task is ready or pending (not running). On Entry: AH = 01h AL = 02h CX = Task ID (0 for currently active task) On Return: CX = Task identifier (0 if task not found) ES:BX = TCB address or pointer to multitasking data area for active task. SI = (Modified) DI = (Modified) INT 15h, Function AX = 0103h: Disable Task Switching 4000API On Entry: AH = 01h AL = 03h On Return: None INT 15h, Function AX = 0104h: Enable Task Switching 4000API On Entry: AH = 01h AL = 04h On Return: None INT 15h, Function AX = 0105h: Reset Multitasker 4000API Purges the ready list and the pend list. Resets current task identifier to zero. Take this drastic measure only when resetting all hardware and firmware. On Entry: AH = 01h AL = 05h On Return: None
PEN*KEY R 6100 Computer Programmer’s Reference Guide
6-69
6. Conversions and Interfaces
4000API Provided for diagnostic purposes. Because TCBs may move on every task switch, lock task switching prior to making this call and unlock after the information has been extracted. It is possible for the running task to obtain its task ID by calling with CX = 0.
Page 206
Conversions and Interfaces
SECTION 6
INT 15h, Function AX = 0106h: Pend on Mailbox with Optional Timeout
6. Conversions and Interfaces
4000API On Entry: AH = 01h AL = 06h ES:BX = Mailbox pointer DX:CX = Timeout value in milliseconds; 0 means no timeout On Return: AX = (Undefined) DX:CX = Message, if available; 0 otherwise " NOTE:
INTERRUPT ROUTINES MUST NOT ISSUE THIS CALL.
INT 15h, Function AX = 0107h: Accept Message from Mailbox (No Pend) 4000API On Entry: AH = 01h AL = 07h ES:BX = Mailbox pointer On Return: AX = (Undefined) DX:CX = Message, if available; 0 otherwise INT 15h, Function AX = 0108h: Post Message to Mailbox 4000API On Entry: AH = 01h AL = 08h ES:BX = Mailbox pointer DX:CX = Message On Return: DX:CX = Zero if mailbox was empty, operation successful; previous message if mailbox overrun INT 15h, Function AX = 0109h: Pend on Queue with Optional Timeout 4000API On Entry: AH = 01h AL = 09h ES:BX = Pointer to queue DX:CX = Timeout value in milliseconds; 0 means no timeout On Return: AX = (Undefined) DX:CX = Pointer to queue message node if no timeout; 0 if timeout error " NOTE:
6-70
INTERRUPT ROUTINES MUST NOT ISSUE THIS CALL.
PEN*KEY R 6100 Computer Programmer’s Reference Guide