Technical Reference

Appendix K

K.1   COMPARISONS BETWEEN MS-DOS AND CP/M-86

FUNCTION            NR        MSDOS(AH)                CPM-86(CL)

Terminate           0         NC                       DL=0 =>back to CCP    
                                                       DL=1 =>remain in     
                                                              memory        
                                                                            
Conin               1         Returns:                 Returns:             
                              AL=ascii char            AL=ascii char        
                              checks are made          checks are made      
                              input is echoed          input is echoed      
                                                                            
Conout              2         DL is char               DL is char           
                                                                            
Aux /rdr            3         Returns:                 Returns:             
                              AL is char               AL is char           
                                                                            
Aux/pun             4         DL is char               DL is char           
                                                                            
Print               5         DL is char               DL is char           
                                                                            
Dir Con I/O         6         DL=FF=>Cons input        DL=FF=>Cons input    
                              Returns:                 Returns:             
                              AL=00=>no char           AL=cons char         
                              AL<>00=>Cons char        DL=FE=>Cons stat     
                              DL<>FF=>Cons output      Returns:             
                              DL is char               AL=00=>no char       
                                                       DLcons output  
                                                       DL is char           
                                                                            
Dir con Input /     7         Return AL=char           Returns:             
Get I/O byte                                           AL=IOBYTE            
                                                                            
Conin,No Echo/      8         See func 1               DL=IOBYTE            
Set I/O byte                                                               
                                                                            
Print String        9         DS:DX=[charstr$]         DX=[charstr$]        
                              uses func 2                                   
                                                                            
Read console        A         DS:DX=[datalen,          DX=[datalen,         
Buffer                        inlen,data..]            inlen, data..]         
                              last char always CR      CR not in data       
                              inlen doesn't                              
                              include CR.                                   
                              Editing functions                             
                              apply.                                        
                                                                            
Constat             B         Returns:                 Returns:             
                              AL=FF=>char              AL=01=>char          
                                =00=>no char             =00=>no char       
                                                                            
Conin with flush/   C         Flush buffer then        Returns:             
Get version no.               do function 1,6,7,8      BX=version           
                              or A if in AL.                                
                              See above for                                  
                              parameters                                    
                                                                            
Disc reset (system) D         Set A, flushes           Select A and         
                              buffers                  makes all R/W        
                                                                            
Select disc         E         DL=drive                 DL=drive             
                              Returns:                                      
                              AL=number of drives
                                                                            
Open file           F         DS:DX=[FCBu]             DX=[FCBu]            
                              FCB (E,F,20)=00H         FCB(C)=0             
                              Returns:                 Returns:             
                              AL=00=>Okay              AL=00=>Okay          
                                =FF=>not found           =FF=>not found

Close file          10        DS:DX=[FCBo]             DX=[FCBo]            
                              Returns:                 Returns:             
                              AL=00=>Okay              AL=(0,1,2,3)=>Ok     
                                =FF=>not found           =FF=>not found     

Search 1st entry    11        DS:DX=[FCBu]             DX=[FCBu]            
                              Return:                  Return:              
                              AL=FF=>not found         AL=FF=>not found     
                              2 FCB's: extended,       AL=(0,1,2,3)=> Okay  
                              normal                   Curr DMA=dir record  
                                                       
Search next entry   12        DS:DX=[FCB] see 11       Must  be preceded    
                              Return:                  by 11 or 12.         
                              AL=FF=>not found         See 11 for return    
                                                       
Delete file         13        DS:DX=[FCBu]             DX=[FCB]             
                              Return:                  Return:              
                              AL=FF=>not found         AL=FF=not found      
                                =00=>okay                =00=>okay          

Read sequential     14        DS:DX=[FCBo]             DX=[FCBo]            
                              Return:                  Return:              
                              AL=00=>okay              AL=00=>okay          
                                =01=>no data             =01=>eof-no data      
                                =02=>not enough mem                         
                                =03=>partial record                          
                              Into  current            Into  current DMA     
                              transfer address         

Write seg.          15        DS:DX=[FCBo]             DX=[FCBo]            
                              Return:                  Return:              
                              AL=00                    AL=00=>okay          
                                =01=>disc full           =01=>dir full        
                                =02=>not enough          =02=>data full       
                                     memory                                 
                                                                            
Make file           16        DS:DX=[FCBu]             DX=[FCBu]            
                              Return:                  Return:              
                              AL=00                    AL=00,01,02,03=>Ok   
                                =FF=>no dir.space                            
                              Inits to zero len        Inits to zero        
                              file                     len file             
Rename file         17        DS:DX=[FCBr]             DX=[FCBr]            
                              Return:                  Return:              
                              AL=00>ok                 AL=00=>ok            
                                =FF=>not found           =FF=>not found       
                              DS:DX+11H=new filename   DX+10H=new filename  
                              "?"supported             unambiguous filename 
                                                                            
Not defined /       18        ND                       Return:              
Return login vect                                      BX=login vector      
                                                          for discs         
                                                                            
Current disc        19        Return:                  Return:              
                              AL=current sel drive     AL=current disc      
                               0=>A,...                 0=>A,...           

Set disc xfr /      1A        DS:DX=disc               DX=DMA offset        
addr set DMA                  transfer addr                                 
offset                                                                      
                                                                            
Allocation table/   1B        Return:                  Return:              
vector                        DS:BX=allocation table   ES:BX=allocation vector
                              DX=alloc unit count
                              AL=records per                                
                              alloc unit                                    
                              CX=sector size                                
                                                                            
Not  defined /      1C        ND                       No parameters        
writ prot. disc                                                             
                                                                            
/Get R/O vector     1D        ND                       BX=R/O Vector        
                                                                            
/Set file           1E        ND                       DX=[FCB]             
attributes                                             with attributes set  
                                                       Return:              
                                                       AL=00=>ok            
                                                         =FF=>not found      
                                                                            
/Get disc           1F        ND                       ES:BX=[disc parameters]
parameter                                              
                                                                            
/Set/get  user      20        ND                       DL=FF=>gets user code
 code                                                    0->F=>set user code
                                                       Return:              
                                                       AL=current code      
                                                       if FF in DL         

Random read         21        DS:DX=[FCBo]             DX=[FCBo]            
                              Return:                  Return:              
                              AL=00=>ok                AL=00=>ok            
                                 01=>no more data         01=>read unwritten.
                                 02=>not enough mem       02=>NC              
                                 03=>partial              03=>can't close ext.
                                                          04=>unwritten extent
                                                          05=>NC              
                                                          06=>out of range    

Random write        22        DS:DX[FCBo]              DX=[FCBo]            
                              Return:                  Return:              
                              AL=00=>ok                AL=00=>ok            
                                 01=>disc full            01=>NC               
                                 02=>not enough mem       02=>no  avail data   
                                                          03=>can't close ext  
                                                          04=>NC               
                                                          05=>no dir space     
                                                          06=>out of range     
                                                                            
File size           23        DS:DX=[FCBu]             DX=[FCB]random       
                              Return:                  Return:              
                              AL=00=>ok                AL=00=>ok            
                                =FF=>not found            FF=>not found        
                              Random record set        Random record set    
                                                                            
Set random rec      24        DS:DX=[FCBo]             DX=[FCBo]            
                              Set random record        Set random record    
                              in record FCB=           in record FCB=       
                              current blocks           next sequential      
                                                                            
Set vector /        25        AL=interrupt to set      DX=drive vector      
Reset drive                   DS:DX=vector values      return AL=00         
                                                                            
Create program/     26        DX=new prog segment      ND                   
                                                                            
Random block rd/    27        DS:DX=[FCBo]             ND                   
                              CX=record count
                              Return:
                              01=>eof, complete
                              02=>not enough mem.
                              03=>eof,partial
                              CX=record count of read
                              FCB updated

Random block wrt     28       See 27 except            See 22 DX=[FCBo]
                              Return:                  Zero fills data
                              AL=01=>no disc space     block
                              If CX=0=>set file
                              size to random record

Parse file name/     29       DS:SI=[string,cr]source  ND             
                              ES:DI=[FCBu] destination
                              AL=0=>no scan off
                                    reading gaps
                                 1=>scan off
                              FCBu is created
                              Return:
                              AL=00=>ok
                              AL=01=>ok, ? Or * present
                              DS:SI=[name]
                              ES:DI=[blank] if no name

Get date /          2A        Return:                  ND
                              CX=year
                              DH=month
                              DL=day

Set date/           2B        CX,DX as 2A              ND

Get time/           2C        CH=hour                  ND
                              CL=min
                              DH=sec
                              DL=1/100ths

Set time/           2D        CX,DX as 2C              ND

Set/Reset verify    2E        DL=0                     ND
flag/

/Direct Bios call   32        ND                       DX=[parameter block]

/Set DMA base       33        ND                       DX=DMA base

/Get DMA base       34        ND                       Return:
                                                       ES:BX=DMA base

/Get max mem        35        ND                       DX=[MCB]
                                                       Return:
                                                       AL=00=>Ok
                                                         =FF=>no mem.

/Get ABS max        36        ND                       DX=[MCB]
                                                       Return:
                                                       as for 35

/Alloc. mem         37        ND                       DX=[MCB]
                                                       Return:
                                                       AL=00=>Ok
                                                         =FF=>insuff. mem.

/Alloc ABS mem      38        ND                       DX=[MCB]
                                                       Return:
                                                       as for 37

/Free mem           39        ND                       DX=[MCB]

/Free all mem       3A        ND                       No parameters

/Program Load       3B        ND                       DX=[FCBo]
                                                       ret AX=FFFFH=>
                                                       bad load else
                                                       AX=base page
                                                       BX=base page.     


BACK


All contents of this website (including text, images, design, and presentation) are Copyright � 1999-2004,
ACT Sirius 1 User Group (UK) unless explicity stated otherwise. All Rights Reserved.
E-Mail: siriususer@eurobell.co.uk

Last revision 22/01/2003