Memory functions
|
0C0h (192) EMM_FN0 Information about memory allocation
|
input:
C=0C0h
|
output:
HL - total memory in 16k pages
BC - free memory in 16k pages
|
0C1h (193) EMM_FN1 Initialization of memory allocation.
All information about allocated memory blocks is clearing.
And reserved some system memory.
|
input:
C=0C1h
|
output:
none
|
0C2h (194) EMM_FN2 Allocate a memory block
|
input:
C=0C2h
B - size of required memory block in 16K pages
|
output:
if CF=0 - A - handle of memory block
if CF=1 - error - A=1 - no memory
|
0C3h (195) EMM_FN3 Deallocate a memory block
|
input:
C=0C3h
A - handle of memory block
|
output:
CF=0 - no error
CF=1 - incorrect handle
|
0C4h (196) EMM_FN4 Get physical page number from the memory block by logic number
|
input:
C=0C4h
A - handle of memory block
B - logic page number
|
output:
CF=0 - A - physical page number
CF=1 - error:
A=0 - incorrect memory handle
A=255 - incorrect logic number (too big)
|
0C5h (197) EMM_FN5 Get list of physical page numbers
|
input:
C=0C5h
A - handle of memory block
HL - buffer 256 bytes for numbers list
|
output:
CF=0 - no errors:
B - size of memory block in 16K pages
HL - address of buffer; buffer contains list of physical numbers for all pages; 0FFh - end of list
CF=1 - incorrect handle of memory block; Data in the buffer may be lost
|
0C6h (198) EMM_FN6 Detect ports for CPU memory frames
|
input:
C=0C6h
A - number of CPU memory frame - 0,1,2 or 3
|
output:
CF=0 - no errors:
C - 8 bit address of CPU frame port
B - physical number of memory page which set to CPU frame
CF=1 - error - incorrect number of CPU frame
|
0C7h (199) EMM_FN7 Get next physical number of the memory page which assigned for block by the physical page number
|
input:
C=0C7h
A - physical number of memory page
|
output:
CF=0 - no errors
A - number of the next page in the memory block
A=0FFh - it is the end of block
CF=1 - error - this memory page is free.
|
09Eh (158) EMM_FN8 Merge memory blocks
|
input:
A - handle of first memory block
B - handle of second memory block
|
output:
CF=0 - no error
A - new handle of the memory block
CF=1 - error - incorrect handle of memory block
|
09Dh (157) EMM_FN9 Split memory block
|
input:
C=09Dh
A - handle of memory block
B - size of first memory block
|
output:
CF=0 - no errors
A - handle of first memory block
B - handle of second memory block
CF=1 - error - incorrect handle of memory block
|
Hardware related functionsà>
|
0EFh (239) FN_VERSION Get the BIOS version number and information about model of computer
|
input:
C=0EFh
HL - address of buffer for ASCIIZ string
|
output:
CF=0 - no error
HL - address of this buffer
DE - BIOS version number
BC - information about hardware comment
A - 2 (counter of fields)
first field - BIOS version number.
second field - model of computer.
CF=1 - error - very old version which hasn't this function
|
0F2h (242) FN_SYNC=0 Set a synchronization
|
input:
C=0F2h
A - mode of the synchronization
|
output:
CF=1 - error - incorrect number of the synchronization
|
0F5h (245) CMOS_TEST Detect of CMOS chip installed
comment
|
input:
C=0F5h
|
output:
CF=0 - CMOS is installed
CF=1 - CMOS is not installed
|
0F6h (246) CMOS_RD Read from register of CMOS
comment
|
input:
C=0F6h
D - register number
|
output:
A - data
CF=1 - CMOS is not present
|
0F7h (247) CMOS_WR Write to register of CMOS
comment
|
input:
C=0F7h
D - register number
A - data
|
output:
CF=1 - CMOS is not present
|
08Fh (143) FN_TURBO Turbo mode control.
|
input:
C=08Fh
A - 2 - turbo off
3 - turbo on
12h - 720 floppy disk
13h - 1.44 floppy disk
|
output:
CF=1 - error - incorrect mode
|
Screen functions
|
0B0h (176) WIN_OPEN Open window
|
input:
C=0B0h
IX - descriptor of window
E - flags of window:
0 bit screen page which will show(0/1);
4 bit screen page where window will open(0/1)
|
output:
CF=0 - no error:
A - handle of window
CF=1 - error - too many windows
|
0B1h (177) WIN_CLOSE Close window
|
input:
C=0B1h
A - handle of window
|
output:
CF=1 - error - incorrect handle
Note: window with number '0' can't be closed.
|
0B2h (178) WIN_COPY_WIN Copy a text window to the memory
When you use this function you should disable interrupt.
|
input:
C=0B2h
A - handle of global window
H - height of window, quantity of graphic elements
L - width of window, quantity of graphic elements
D - vertical position in the global window
E - horizontal position in the global window
IX - address of buffer for copy data of window
A' - page memory number for copy data of window
|
output:
CF=1 - error - incorrect handle
|
0B3h (179) WIN_RESTORE_WIN Restore a text window
When you use this function you should disable interrupt.
|
input:
C=0B2h
A - handle of global window
H - height of window, quantity of graphic elements
L - width of window, quantity of graphic elements
D - vertical position in the global window
E - horizontal position in the global window
IX - address of buffer with data of window
A' - page with data of window
|
output:
CF=1 - error - incorrect handle
|
0B4h (180) WIN_GET_SYM Get symbol from the screen
|
input:
C=0B4h
A - handle of the window
DE - position of symbol at the window:
D - vertical, E - horizontal
|
output:
CF=0 - no errors:
L - symbol, H - attribute,
B - font
CF=1 - incorrect handle of the window
|
0B5h (181) WIN_PUT_SYM Put symbol to the screen
|
input:
C=0B5h
A - handle of the window
DE - position of symbol at the window:
D - vertical, E - horizontal
L - symbol, H - attribute
B - font
|
output:
CF=1 - incorrect handle of the window
|
0B6h (182) WIN_SET_ZG Set font
|
input:
C=0B6h
A - number of the font
DE - address of 2K with font data
|
output:
CF=1 - error - unknown function
|
0B7h (183) WIN_MOVE_WIN Move window
When you use this function you should disable interrupt.
|
input:
C=0B7h
A - handle of global window
H - height of local window, quantity of graphic elements
L - width of local window, quantity of graphic elements
D - vertical position in the global window
E - horizontal position in the global window
IX - new position of local window (like DE)
|
output:
CF=1 - error - incorrect handle of window
|
0B8h (184) WIN_GET_ZG Get font
|
input:
C=0B8h
DE - buffer address for save 2k of font data
|
output:
CF=1 - error - unknown function
|
Text function
|
081h (129) LP_PRINT_ALL Print symbol with attribute
Print 'B' repeating symbols
|
input:
C=081h
A - symbol
E - attribute
B - count
You may not save the registers HL and IX at the stack when will use it.
|
output:
none
|
082h (131) LP_PRINT_SYM Print symbol without attribute
Print 'B' repeating symbols, without color attribute
|
input:
C=082h
A - symbol
B - count
You may not save the registers HL and IX at the stack when will use it.
|
output:
none
|
083h (131) LP_PRINT_ATR Print an attributes
Print 'B' repeating attributes without symbols
|
input:
C=083h
E - attribute
B - count
You may not save the registers HL and IX at the stack when will use it.
|
output:
none
|
084h (132) LP_SET_PLACE Set the coordinates for the text cursor's current position
|
input:
C=084h
E - horizontal
D - vertical
|
output:
none
|
085h (133) LP_PRINT_LN Print string from current position
|
input:
C=085h
HL - address of string should be between 04000h and 0BFFFh
E - attribute
B - length of string
|
output:
none
|
086h (134) LP_PRINT_LN2 Print string without attribute
|
input:
C=086h
HL - address of string should be between 04000h and 0BFFFh
B - length of string
|
output:
none
|
087h (135) LP_PRINT_LN3 Print string till the separator and clear for length
some spaces will be print after the separator for line of 'B' symbols
|
input:
C=087h
HL - address of string should be between 04000h and 0BFFFh
E - attribute
B - length of string
D - separator of the end string
|
output:
none
|
088h (136) LP_PRINT_LN4 Print string without attributes till the separator
|
input:
C=088h
HL - address of string should be between 04000h and 0BFFFh
B - length of string
D - separator of the end string
|
output:
none
|
089h (137) LP_CLS_WIN Clear the screen
Printing spaces with attributes
|
input:
C=089h
DE - position of local window
H - vertical size of local window
L - horizontal size local window
B - attribute for filling
|
output:
none
|
08Ah (138) LP_SCROLL_UD Scroll a part of window (up/down)
You can scroll full lines of global window
|
input:
C=08Ah
B: 1 - up; 2 - down
D - start line for scroll
E - number lines for scroll
|
output:
none
|
08Bh (139) LP_PRINT_LN5 Print string till separator
|
input:
HL - address of string should be between 04000h and 0BFFFh
E - attribute
B - max length of string
D - separator of the end string
|
output:
none
|
08Ch (140) LP_PRINT_LN6 Print string till separator without attribute
|
input:
C=08Ch
HL - address of string should be between 04000h and 0BFFFh
B - max length of string
D - separator of the end string
|
output:
none
|
08Dh (141) LP_CLS_WIN2 Fill screen with the symbol and attribute
|
input:
C=08Dh
DE - position of local window
H - vertical size of windiw
L - horizontal size of window
B - attribute for filling
A - symbol for filling
|
output:
none
|
08Eh (142) LP_GET_PLACE Get the current position for printing
|
input:
C=08Eh
|
output:
CF=0 - no errors
DE - place for printing next symbol:
D - vertical, E - horizontal
|
Graphic functions
|
0A1h (161) PIC_POINT Set a point
|
input:
C=0A1h
DE - vertical coordinate (in pixels)
HL - horizontal coordinate (in pixels)
from the up-left corner
A - handle of window
B - colour of point
|
output:
CF=1 - error - incorrect handle of window
|
0A4h (164) PIC_SET_PAL Set the palettes
|
input:
C=0A4h
HL - buffer with palette data
E - number of first replaced colour
D - count of colours for replacing
B - mask (#FF for not masking)
A - 0..3 bits:
- 0..7 - number of palette
- 8..15 - reserved
- 4..6 bits - reserved (value = 0)
- 7 bit:
- 0 - set palette
- 1 - load palette into the memory
|
output:
none
|
0A6h (166) SET_PAL_INIT Set the internal palette
|
input:
C=0A6h
A - page of palette
B - number of palette:
B=1 - palette of graphic screens
B=2 - palette of Spectrum screen
B=3 - palette of CGA text screen
|
output:
CF=1 - wrong number of palette
|
Disk functions
|
50h,52h,53h (80,82,83) Reserved
|
input:
none
|
output:
none
|
51h (81) DRV_RESET Reset disk
|
input:
C=51h
A - number and drive type
7..4 bits - drive type:
#0x - FDD
#6x - RAM-DISK
#8x - HDD
#Cx - CD drive
áèò 3..0 - drive number
|
output:
CF=1 - error - no disk or drive not present
|
54h (84) DRV_VERIFY Verify sectors
|
input:
C=54h
A - drive number and type
HL:IX - sector number (32 bit, HL bits 31..16, IX bits 15..0)
B - sectors count
|
output:
CF=1 - verify error
|
55h (85) DRV_READ Read from drive
|
input:
C=55h
A - drive number and type
HL:IX - sector number (32 bit, HL bits 31..16, IX bits 15..0)
B - sectors count
DE - address for data buffer
|
output:
CF=1 - read error
HL:IX - sector number + number sectors which was reading
DE - address of data buffer + (number sectors which was reading * sector size)
|
56h (86) DRV_WRITE Write to the drive
|
input:
C=56h
A - drive number and type
HL:IX - sector number (32 bit, HL bits 31..16, IX bits 15..0)
B - sectors count
DE - address for data buffer
|
output:
CF=1 - write error
HL:IX - sector number + number sectors which was writing
DE - address of data buffer + (number sectors which was writing * sector size)
|
57h (87) DRV_DETECT Disk detecting
|
input:
C=57h
A - drive number and type
|
output:
A - bit 7 = 0 - 720Êb disk (for FDD only)
bit 7 = 1 it's 1,44Mb disk (for FDD only)
CF=1 - no disk
|
58h (88) DRV_GET_PAR Get drive parameters
|
input:
C=58h
A - drive number and type
|
output:
L - sectors per track
H - heads per drive
DE - cylinders per drive
if HL=DE=0FFFFh - drive not present
IX - size of sector (bytes)
B - additional parameters of floppy disk:
bit 7 - type (1.44Mb or 720Kb)
CF=1 - drive not present
|
59h (89) DRV_SET_PAR Set the drive parameters
|
input:
A - drive number and type
L - sectors per track
H - heads per drive
DE - cylinders per drive
if HL=DE=0FFFFh - drive not present
IX - size of sector (bytes)
B - additional parameters of floppy disk:
bit 7 - type (1.44Mb or 720Kb)
|
output:
CF=0 - no errors
|
5Ah (90) EXT_VERSION Version of the disk specification
|
input:
C=5Ah
|
output:
CF=0 - no errors
D - version number
E - modifycation
CF=1 - error
|
5Fh (95) DRV_LIST Get list of drives
|
input:
C=5Fh
IX - Buffer of drives list
|
output:
CF=0 - no errors
Format of drives list:
IX+0 - size of buffer struct
IX+1 - FDD count
IX+2 - HDD count
IX+3 - CD drive count
IX+4 - #00 - the end of list
|