INT 1A - PCMCIA v2 Card Services - API(Application Program[ming] Interface) The defined set of calls which a program may make to interact with or request services of the operating system or environment under which it is running.  Because the inputs and outputs of the calls are well-defined, a program using the API can continue using the identical calls even if the internal organization of the program providing the API changes.
	AH = AFh
	AL = function
	    00h close memory
	    01h copy memory
	    02h deregister client
	    03h get client information (see #00702)
	    04h get configuration information (see #00704)
	    05h get first partition
	    06h get first region
	    07h get first tuple (see #00711)
	    08h get next partition
	    09h get next region
	    0Ah get next tuple
	    0Bh	get Card Services information (see #00700)
	    0Ch get status
	    0Dh	get tuple data (see #00712)
	    0Eh	get first client (see #00701)
	    0Fh get/register Erase Queue
	    10h	register client (see #00713)
	    11h reset function
	    12h map logical socket
	    13h map logical window
	    14h map memory page
	    15h map physical socket
	    16h map physical window
	    17h modify window
	    18h open memory
	    19h read memory
	    1Ah register MTD
	    1Bh release I/O
	    1Ch release IRQ(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated. (see #00715)
	    1Dh release window
	    1Eh release configuration (see #00716)
	    1Fh request I/O (see #00717)
	    20h request IRQ(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated. (see #00718)
	    21h reqeust window (see #00720)
	    22h request socket mask
	    23h return SS entry
	    24h write memory
	    25h deregister Erase Queue
	    26h check Erase Queue
	    27h modify configuration
	    28h register timer
	    29h set region
	    2Ah get next client
	    2Bh validate CIS
	    2Ch request exclusive access (see #00723)
	    2Dh release exclusive access (see #00723)
	    2Eh get event mask
	    2Fh release socket mask
	    30h request configuration (see #00724)
	    31h set event mask
	    32h add Socket Service
	    33h replace Socket Service
	    34h vendor-specific
	    35h adjust resource information
	    36h access configuration register
	    37h get first window
	    38h get next window
	    39h get memory page
	    3Ah request DMAsee Direct Memory Access
	    3Bh release DMAsee Direct Memory Access
	further details not yet available
Return: ??? = result code (see #00698)
SeeAlso: AH=AEh


(Table 00698)
Values for PCMCIA Card Services result codes:
 00h	successful
 01h	invalid adapter number
 02h	bad value for attribute field
 03h	bad value for base system memory address
 04h	invalid EDC generator specified
 05h	(reserved for historical reasons)
 06h	invalid IRQ(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated. level specified
 07h	invalid PCIBM PC Card memory array offset
 08h	invalid page number specified
 09h	unable to complete read request
 0Ah	invalid size specified
 0Bh	invalid socket number
 0Ch	(reserved for historical reasons)
 0Dh	invalid window or interface type
 0Eh	invalid Vcc power level specified
 0Fh	invalid Vpp1 or Vpp2 power level specified
 10h	(reserved for historical reasons)
 11h	invalid window number
 12h	unable to complete write request
 13h	(reserved for historical reasons)
 14h	no PCIBM PC Card in socket
 15h	service not supported by implementation
 16h	unsupported processor mode
 17h	specified speed not available
 18h	busy -- retry later
 19h	undefined error (general failure)
 1Ah	storage medium write protected
 1Bh	argument length in (E)CX is invalid
 1Ch	bad value(s) in argument packet
 1Dh	configuration has already been locked
 1Eh	requested resource already in use
 1Fh	no more items of requested type available
 20h	out of resources
 21h	invalid client handle
 22h	unsupported client version


(Table 00699)
Values for Card Services CallbackA call to a specified function made by the operating system or operating environment when a request (usually an asynchronous request) completes.  This permits the calling program to continue operating while the request is processed yet still be aware of its completion immediately without the need to constantly poll the request's status. See also Callout. Event codes:
 01h	battery dead
 02h	battery low
 03h	card locked
 04h	card has become ready
 05h	card removed
 06h	card unlocked
 07h	motorized ejection complete
 08h	ejection requested
 09h	insertion complete
 0Ah	insertion requested
 0Bh	power management: resume
 0Ch	power management: suspend
 0Dh	exclusive access granted
 0Eh	exclusive access requested
 0Fh	perform physical reset
 10h	physical reset requested
 11h	card has been reset
 12h	MTD request (read/write/etc)
 14h	request for client info
 15h	timer has expired
 16h	Socket Service was modified
 17h	write-protected
 18h	attention requested
 40h	card insertion
 80h	reset complete
 81h	erase complete
 82h	registration complete


Format of Card Services Information:
Offset	Size	Description	(Table 00700)
 00h	WORD	length of information record in bytes
 02h	WORD	signature
 04h	WORD	number of sockets
 06h	WORD	revision level
 08h	WORD	Card Services level
 0Ah	WORD	offset of vendor string
 0Ch	WORD	length of vendor string
 0Eh	WORD	number of functions
 10h 255 BYTEs	vendor string
SeeAlso: #00702


Format of Card Services Client structure:
Offset	Size	Description	(Table 00701)
 00h	WORD	PCMCIA socket number
 02h	WORD	client attributes


Format of Cards Services Client Information:
Offset	Size	Description	(Table 00702)
 00h	WORD	maximum length of data in bytes (180)
 02h	WORD	(ret) length of returned data
 04h	WORD	attributes (see #00703)
 06h	WORD	revision level (BCD(Binary Coded Decimal) A method of data storage where two decimal digits are stored in each byte, one in the upper four bits and the other in the lower four bits.  Since only the values 0 through 9 are used in each half of a byte, BCD values can be read as decimal numbers on a hexadecimal display of memory or a file.)
 08h	WORD	Card Services level (BCD(Binary Coded Decimal) A method of data storage where two decimal digits are stored in each byte, one in the upper four bits and the other in the lower four bits.  Since only the values 0 through 9 are used in each half of a byte, BCD values can be read as decimal numbers on a hexadecimal display of memory or a file.)
 0Ah	WORD	revision date (DOS packed date format) (see #01666)
 0Ch	WORD	offset to name
 0Eh	WORD	length of name
 10h	WORD	offset to vendor string
 12h	WORD	length of vendor string
 14h 80 BYTEs	buffer for name
 64h 80 BYTEs	buffer for vendor string
SeeAlso: #00700,#00704


Bitfields for Card Services client attributes:
Bit(s)	Description	(Table 00703)
 0	memory client
 1	MTD client
 2	I/O client
 3	all clients can share this card
 4	only one client can use this card at a time
SeeAlso: #00702


Format of Card Services configuration information:
Offset	Size	Description	(Table 00704)
 00h	WORD	socket (usually 0000h)
 02h	WORD	attributes (see #00705)
 04h	BYTE	Vcc value
 05h	BYTE	Vpp1 value
 06h	BYTE	Vpp2 value
 07h	BYTE	interface type (see #00706)
 08h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	base address of configuration registers
 0Ch	BYTE	card's Status register setting (if present)
 0Dh	BYTE	card's Pin register setting (if present)
 0Eh	BYTE	card's Socket/Copy register setting (if present)
 0Fh	BYTE	card's Option register setting (if present)
 10h	BYTE	bitmap of present card configuration registers
 11h	BYTE	first device type
 12h	BYTE	function code
 13h	BYTE	SysInit mask
 14h	WORD	manufacturer code
 16h	WORD	manufacturer information
 18h	BYTE	valie card register values
 19h	BYTE	IRQ(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated. number assigned to PCIBM PC Card
 1Ah	WORD	IRQ(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated. attributes (see #00708)
 1Ch	WORD	base port address (for I/O range 1)
 1Eh	BYTE	number of contiguous ports (for I/O range 1)
 1Fh	BYTE	bitmap of port attributes (for I/O range 1) (see #00709)
 20h	WORD	base port address (for I/O range 2)
 22h	BYTE	number of contiguous ports (for I/O range 2)
 23h	BYTE	bitmap of port attributes (for I/O range 2) (see #00709)
 24h	BYTE	number of I/O address lines decoded (16-bit PCIBM PC Card only)
 25h	BYTE	extended status register setting (if present)
 26h	BYTE	bitmap of DMAsee Direct Memory Access attributes (see #00710)
		(note: value at call is used to set!)
 27h	BYTE	assigned DMAsee Direct Memory Access channel
 28h	BYTE	number of I/O windows in use on logical socket
 29h	BYTE	number of memory windows in use on logical socket
SeeAlso: #00703,#00724


Bitfields for Card Services Configuration attributes:
Bit(s)	Description	(Table 00705)
 0	exclusive
 1	IRQ(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated. active
 2	CardBus card
 3-5	reserved (0)
 6	DMAsee Direct Memory Access channel is active
 7	reserved (0)
 8	valid client
 9	overwrite voltage value
 10-15	reserved (0)
SeeAlso: #00704


Bitfields for Card Services Configuration interface type:
Bit(s)	Description	(Table 00706)
 0	memory interface
 1	I/O and memory interface
 2	CardBus interface
 3-7	reserved (0)
SeeAlso: #00704


Bitfields for Card Services Configuration registers:
Bit(s)	Description	(Table 00707)
 0	option value is value
 1	status value
 2	pin-replacement value
 3	copy value
 4	extended status value
 5-7	reserved (0)
SeeAlso: #00704


Bitfields for Card Services Configuration IRQ(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated. attributes:
Bit(s)	Description	(Table 00708)
 1-0	sharing
	00 no sharing
	01 time-multiplex sharing
	10 dynamic sharing
	11 reserved
 2	force pulse mode
 3	first used together
 4-7	reserved
 8	pulse IRQ(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated. has been assigned
 9-15	reserved
SeeAlso: #00704,#00709,#00710,#00715,#00718


Bitfields for Card Services Configuration Port attributes:
Bit(s)	Description	(Table 00709)
 0	shared I/O ports
 1	"CS_FirstCommonUsedCard"
 2	force alias access
 3	=1 sixteen-bit I/O
	=0 eight-bit I/O
 7-4	reserved (0)
SeeAlso: #00704,#00708,#00710,#00717


Bitfields for Card Services Configuration DMAsee Direct Memory Access attributes:
Bit(s)	Description	(Table 00710)
 1-0	sharing mode
	00 no sharing
	01 time-multiplex sharing
	10 dynamic sharing
	11 reserved
 3-2	DMAsee Direct Memory Access request signal
	00 reserved
	01 DMARQ uses pin SPKR#
	10 DMARQ uses pin IOIS16#
	11 DMARQ uses pin INPACK#
 4	DMAsee Direct Memory Access size
	0 eight bits
	1 sixteen bits
 7-5	reserved (0)
SeeAlso: #00704,#00708,#00709


Format of Card Services Tuple information:
Offset	Size	Description	(Table 00711)
 00h	WORD	logical socket number
 02h	WORD	attributes
		bit 0: return Link tuples
 04h	BYTE	code value of desired tuple
 05h	BYTE	reserved (0)
 06h	WORD	(ret) TupleFlags
 08h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	(ret) -> Card Services Link State Information
 0Ch	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	(ret) -> Card Services CIS State Information
 10h	BYTE	(ret) code for tuple
 11h	BYTE	(ret) link value for tuple
SeeAlso: #00712


Format of Card Services GetTupleData record:
Offset	Size	Description	(Table 00712)
 00h	WORD	logical socket
 02h	WORD	attributes
 04h	BYTE	code value of desired tuple
 05h	BYTE	offset into tuple from link byte
 06h	WORD	flags
 08h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	-> Link
 0Ch	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	-> CIS
 10h	WORD	(call) maximum amount of data to return (0004h)
 12h	WORD	(ret) amount of data returned
 14h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	(ret) tuple data
SeeAlso: #00711


Format of Card Services Client Registration record:
Offset	Size	Description	(Table 00713)
 00h	WORD	attributes
 02h	WORD	event mask
 04h	WORD	client data (passed to client event handler in DI)
--- 16-bit code ---
 06h	WORD	client data selector (passed to event handler in DS)
 08h	WORD	client data offset (passed to event handler in SI)
 0Ah	WORD	reserved
--- 32-bit code ---
 06h	WORD	reserved
 08h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	client data offset (passed to event handler in ESI)
------
 0Ch	WORD	expected Card Services version (0210h for v2.10)


Bitfields for Card Services client event codes:
Bit(s)	Description	(Table 00714)
 0	change in write-protect status
 1	change in card lock
 2	ejection request
 3	insertion request
 4	battery is dead
 5	battery low
 6	change in Ready
 7	change in Card Detect
 8	power management change
 9	reset
 10	Socket Services updated
 11	extended status change
SeeAlso: #00713


Format of Card Services ReleaseIRQ record:
Offset	Size	Description	(Table 00715)
 00h	WORD	logical socket number
 02h	WORD	attributes (see #00708)
 04h	BYTE	assigned IRQ(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated. number to be released


Format of Card Services Release Configuration record:
Offset	Size	Description	(Table 00716)
 00h	WORD	logical socket number


Format of Card Services Request I/O record:
Offset	Size	Description	(Table 00717)
 00h	WORD	logical socket number
 02h	WORD	base port 1
 04h	BYTE	size of port range 1
 05h	BYTE	attributes for port range 1 (see #00709)
 06h	WORD	base port 2
 08h	BYTE	size of port range 2
 09h	BYTE	attributes for port range 2 (see #00709)
 0Ah	BYTE	number of address lines (typically 16)
SeeAlso: #00718,#00716


Format of Card Services Request IRQ(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated. record:
Offset	Size	Description	(Table 00718)
 00h	WORD	logical socket number
 02h	WORD	attributes (see #00708)
 04h	BYTE	(ret) assigned IRQ(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated. number, if successful
 05h	BYTE	IRQ(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated. info (see #00719)
 06h	WORD	bitmap of available IRQs (bit 0 = IRQ0, etc.)
		(only if bit 4 of IRQ(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated. info set)
SeeAlso: #00717,#00716


Bitfields for Card Services Request IRQ(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated. info flags:
Bit(s)	Description	(Table 00719)
 7	IRQ(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated. is shared
 6	pulse (edge-triggered) interrupt
 5	level interrupt
 4	use IRQ(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated. bitmap
--- bit 4 set ---
 3	vendor-specific interrupt
 2	bus error
 1	I/O check interrupt
 0	NMIsee Non-Maskable Interrupt
--- bit 4 clear ---
 3-0	IRQ(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated. number
SeeAlso: #00718


Format of Card Services Request Window record:
Offset	Size	Description	(Table 00720)
 00h	WORD	logical socket number
 02h	WORD	attributes (see #00721)
 04h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	system base adress
 08h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	size of memory window
 0Ch	BYTE	additional info
		if attributes bit ??? is set, this is the address-lines field
		otherwise, this is the access-speed field (see #00722)


Bitfields for Card Services Request Window attributes:
Bit(s)	Description	(Table 00721)
 0	I/O window instead of memory window
 1	attribute memory instead of normal memory (16-bit PCIBM PC Cards only)
 2	window enabled
 3	16-bit data path instead of 8-bit path (16-bit PCIBM PC Cards only, v2.10+)
	(ignored if bit 9 set)
 4	size is given in 16K pages (invalid for CardBus PCIBM PC Cards)
 5	shared (invalid for CardBus)
 6	first shared (invalid for CardBus)
 7	"CS_BindingSpecific" (memory window only)
 8	card offsets are window-size granular (16-bit PCIBM PC Card memory window)
 9	32-bit data path (CardBus only)
 10	reserved (0)
 12-11	prefetch/cache
	00 neither prefetchable nor cacheable
	01 prefetchable but not cacheable
	10 prefetchable and cachable
	11 reserved
 15-13	decoded base address register number (CardBus only)
SeeAlso: #00720,#00722


Bitfields for Card Services Request Window access-speed:
Bit(s)	Description	(Table 00722)
 6-3	mantissa
	0000 use device speed code
	0001  1.0
	0010  1.2
	0011  1.2 ???
	0100  1.5
	0101  2.0
	0110  2.5
	0111  3.0
	1000  3.5
	1001  4.0
	1010  4.5
	1011  5.0
	1100  5.5
	1101  6.0
	1110  7.0
	1111  8.0
--- if mantissa==0 ---
 2-0	device speed code
	000 reserved
	001 250 ns
	010 200 ns
	011 150 ns
	100 100 ns
	101-111 reserved
--- if mantissa<>0 ---
 2-0	speed exponent
	000	1 ns
	001    10 ns
	010   100 ns
	011	1 us
	100    10 us
	101   100 us
	110	1 ms
	111    10 ms
SeeAlso: #00720,#00721


Format of Card Services Request/Release Exclusive Access record:
Offset	Size	Description	(Table 00723)
 00h	WORD	logical socket number
 02h	WORD	attributes (currently all reserved, must be 0000h)


Format of Card Services Request Configuration record:
Offset	Size	Description	(Table 00724)
 00h	WORD	socket (usually 0000h)
 02h	WORD	attributes (see #00705)
 04h	BYTE	Vcc value
 05h	BYTE	Vpp1 value
 06h	BYTE	Vpp2 value
 07h	BYTE	interface type (see #00706)
 08h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	base address of configuration registers
 0Ch	BYTE	card's Status register setting (if present)
 0Dh	BYTE	card's Pin register setting (if present)
 0Eh	BYTE	card's Socket/Copy register setting (if present)
 0Fh	BYTE	card's Option register setting (if present)
 10h	BYTE	bitmap of present card configuration registers
 11h	BYTE	extended status register setting (if present)
SeeAlso: #00704