⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dosmac.doc

📁 还是一个词法分析程序
💻 DOC
📖 第 1 页 / 共 4 页
字号:
Output
    al - 0 = write successful
         1 = disk full
         2 = segment wrap
Registers modified: ax, dx, ds, flags
Syntax: RandomFCBWrite  FCBSeg, FCBOfs

GetFCBFileSize
--------------
Function: Gets the number of records in a file opened using an FCB.
DOS Function: 23h
DOS Versions: 1, 2, 3
Input
    FCBSeg - segment address of the File Control Block(FCB)
    FCBOfs - offset of FCB
Output
    al - 0 = operation successful, FFh = operation failed
Registers modified: ax, dx, ds, flags
Syntax: GetFCBFileSize  FCBSeg, FCBOfs

SetFCBFileRecord
----------------
Function: Updates the record pointer field in the FCB to the current file
          pointer position.
DOS Function: 24h
DOS Versions: 1, 2, 3
Input
    FCBSeg - segment address of the File Control Block(FCB)
    FCBOfs - offset of FCB
Output
Registers modified: ah, dx, ds, flags
Syntax: SetFCBFileRecord    FCBSeg, FCBOfs

SetVector
---------
Function: Changes the indicated interrupt vector to the new vector defined in
          VectorSeg:VectorOfs.
DOS Function: 25h
DOS Versions: 1, 2, 3
Input
    Vector - Interrupt vector to modify
    VectorSeg - Segment address of new interrupt handler
    VectorOfs - Offset from VectorSeg of new handler
Output
    none
Registers modified: ax, dx, ds, Flags
Syntax: SetVector   Vector, VectorSeg, VectorOfs

CreatePSP
---------
Function: Creates a new Program Segment Prefix(PSP)
DOS Function: 26h
DOS Versions: 1, 2, 3
Input
    PSPSeg - Segment address of new PSP
Output
    none
Registers modified: ah, dx, flags
Syntax: CreatePSP   PSPSeg

RandomFCBBlockRead
------------------
Function: Does a random read of one or more records from a file opened using an
          FCB.
DOS Function: 27h
DOS Versions: 1, 2, 3
Input
    FCBSeg - segment address of the File Control Block(FCB)
    FCBOfs - offset of FCB
    Count  - Number of records to read
Output
    al - 0 = read successful
         1 = end of file
         2 = segment wrap
         3 = partial record read at eof
    cx - actual # of records read from the file
Registers modified: ax, cx, dx, ds, flags
Syntax: RandomFCBBlockRead  FCBSeg, FCBOfs, Count

RandomFCBBlockWrite
-------------------
Function: Performs a random write of the specified number of records to a file
          opened using an FCB.
DOS Function: 28h
DOS Versions: 1, 2, 3
Input
    FCBSeg - segment address of the File Control Block(FCB)
    FCBOfs - offset of FCB
    Count  - Number of records to read
Output
    al - 0 = write successful
         1 = disk full
         2 = segment wrap
    cx - actual # of records written to the file
Registers modified: ax, cx, dx, ds, flags
Syntax: RandomFCBBlockWrite FCBSeg, FCBOfs, Count

ParseFCBFilename
----------------
Function: Parses a string representing a filename and fills in the appropriate
          fields of an FCB.
DOS Function: 29h
DOS Versions: 1, 2, 3
Input
    Flags - Flags that control parsing as defined below
    FLAGS       OPERATION
    ---------------------------------------------------------------------
    Bit 3  = 1  Only if an extension is given in the indicated file spec
                will the extension in the FCB will be modified.
           = 0  Replace the FCB's current extension with the one in the
                file spec or initialize the FCB to blanks.
    Bit 2  = 1  Only if a filename is given in the indicated file spec
                will the filename in the FCB will be modified.
           = 0  Replace the FCB's current filename with the one in the
                file spec or initialize the FCB to blanks.
    Bit 1  = 1  Only if a drive is given in the indicated file spec will
                the drive in the FCB will be modified.
           = 0  Replace the FCB's current drive with the one in the file
                spec or initialize the FCB to blanks.
    Bit 0  = 1  Leading separators will be ignored.
           = 0  Leading separators will not be ignored.
    ---------------------------------------------------------------------
    FilenameSeg - Segment address of the string containing the filename
    FilenameOfs - Offset of filename string
    FCBSeg - Segment address of FCB
    FCBOfs - Offset of FCB
Output
    al - 0 = No wildcard characters
         1 = Wildcard characters exist in the filename
       FFh = Specified drive doesn't exist
    ds:si - pointer to first byte position after the filename string
    es:di - pointer to FCB
Registers modified: ax, di, si, ds, es, flags
Syntax: ParseFCBFilename    Flags, FilenameSeg, FilenameOfs, FCBSeg, FCBOfs

GetDate
-------
Function: Gets the system date.
DOS Function: 2Ah
DOS Versions: 1, 2, 3
Input
    none
Output
    cx - year(1980 - 2099)
    dh - month(1 - 12)
    dl - day(1 - 31)
    al - day of week(0 = Sunday, 1 = Monday, etc.) - Only on DOS 1.1
         or later
Registers modified: ax, cx, dx, flags
Syntax: GetDate

SetDate
-------
Function: Sets the system date.
DOS Function: 2Bh
DOS Versions: 1, 2, 3
Input
    Year - year(1980 - 2099)
    Month - month(1 - 12)
    Day - day(1 - 31)
Output
    al - 0 = success, 0FFh = invalid date
Registers modified: ax, cx, dx, flags
Syntax: SetDate Year, Month, Day

GetTime
-------
Function: Gets the system time.
DOS Function: 2Ch
DOS Versions: 1, 2, 3
Input
    none
Output
    ch - hour(0 - 23)
    cl - minutes(0 - 59)
    dh - seconds(0 - 59)
    dl - hundredths of a second(0 - 99)
Registers modified: ah, cx, dx, flags
Syntax: GetTime

SetTime
-------
Function: Sets the system time.
DOS Function: 2Dh
DOS Versions: 1, 2, 3
Input
    Hour - hour(0 - 23)
    Minute - minutes(0 - 59)
    Second - seconds(0 - 59)
    Hundredth - hundredths of a second(0 - 99)
Output
    al - 0 = success, 0FFh - invalid time
Registers modified: ah, cx, dx, flags
Syntax: SetTime Hour, Minute, Second, Hundredth

SetVerifyFlag
-------------
Function: Sets the system verify flag to on or off.
DOS Function: 2Eh
DOS Versions: 1, 2, 3
Input
    Flag - 0 = Turn off verify flag
         - 1 = Turn the verify flag on
Output
    none
Registers modified: ax, dl, flags
Syntax: SetVerifyFlag   Flag

GetDTA
------
Function: Returns the address of the current DTA.
DOS Function: 2Fh
DOS Versions: 2, 3
Input
    none
Output
    es:bx - Far pointer to DTA
Registers modified: ah, bx, es, Flags
Syntax: GetDTA


GetDOSVersion
--------------
Function: Returns the DOS version.
DOS Function: 30h
DOS Services: 2, 3
Input
    none
Output
    ax - DOS version
Registers modified: ax, Flags
Syntax: GetDOSVersion

TSR
---
Function: Terminates a program but leaves it resident in memory.
DOS Function: 31h
DOS Versions: 2, 3
Input
    Result - return code
    Paragraphs - # of paragraphs to reserve for the program
Output
    none
Registers modified: ax, dx, flags
Syntax: TSR Result, Paragraphs

GetSetBREAK
-----------
Functioni: Sets the CTR_BREAK checking flag. Note that if Mode = 0, you do not
           need to provide the Value parameter.
DOS Function: 33h
DOS Versions: 2, 3
Input
    Mode - 0 = Getting status of the flag
         - 1 = Setting the status of the flag
    Value - 0 = Turn CTRL-BREAK checking off
          - 1 = Turn CTRL-BREAK checking on
Output
    dl - 0 = if CTRL-BREAK checking off
       - 1 = if CTRL-BREAK checking on
Registers modified: ax, dl, flags
Syntax: GetSetBREAK Mode, Value

GetVector
---------
Function: Returns the vector for a specified interrupt.
DOS Function: 35h
DOS Versions: 2, 3
Input
    Interrupt - Which interrupt to return the vector of.
Output
    es:bx - vector for the indicated interrupt
Registers modified: ax, bx, es, flags
Syntax: GetVector   Interrupt

GetDiskSpace
------------
Function: Returns the amount of space available on the specified disk.
DOS Function: 36h
DOS Versions: 2, 3
Input
    Disk - Which disk to check(0 = default, 1 = A, etc.)
Output
    ax - sectors per cluster
       FFFFh - if specified drive doesn't exist
    bx - # of available clusters
    cx - bytes per sector
    dx - clusters per drive
Registers modified: ax, bx, cx, dx, flags
Syntax: GetDiskSpace    Disk

GetSetCountryInfo
-----------------
Function: Gets or sets the current country information. Note that you can only
          set the country information if running on DOS version 3.0 or later.
          Note that if ShortCode < 255, then you do not need to provide the
          LongCode parameter. If the LongCode parameter is provided, it will be
          loaded into the apprpriate register regardless of the value of
          ShortCode.
DOS Function: 38h
DOS Versions: 2, 3
Input
    BufferSeg - Segment address of the buffer to store the info in.
    BufferOfs - offset of the storage buffer.
    ShortCode - < 255 = Specific country code < 255
                0FFh = Country code >= 255 so use LongCode
    LongCode - Country code >= 255
Output
    bx - country code
    ds:dx - pointer to the information buffer
Registers modified: ax, bx, dx, ds, flags
Syntax: GetSetCountryInfo   BufferSeg, BufferOfs, ShortCode, LongCode

CreateDir
---------
Function: Creates a directory using the name pointed to by StringSeg:StringOfs.
DOS Function: 39h
DOS Versions: 2, 3
Input
    StringSeg - Segment address of string containing directory name
    StringOfs - Offset from StringSeg of directory name
Output
    If function successful:
        Carry flag - clear
    If function failed
        Carry flag - set
        ax - error code:
            3 - Path not found
            5 - Access denied
Registers modified: ax, dx, ds, Flags
Syntax: CreateDir   StringSeg, StringOfs

RemoveDir
---------
Function: Macro deletes the indicated directory.
DOS Function: 3Ah
DOS Versions: 2, 3
Input
    StringSeg - Segment address of string containing directory name
    StringOfs - Offset from StringSeg of directory name
Output
    If function successful:
        Carry flag - clear
    If function failed
        Carry flag - set
        ax - error code:
            3 - Path not found
            5 - Access denied
            6 - Current directory
          16d - Current directory
Registers modified: ax, dx, ds, Flags
Syntax: RemoveDir   StringSeg, StringOfs

ChangeDirectory
---------------
Function: Sets the current directory to the directory pointed to by
          StringSeg:StringOfs.
DOS Function: 3Bh
DOS Versions: 2, 3
Input
    StringSeg - segment address of ASCIIZ string
    StringOfs - offset within StringSeg of directory name
Output
    If function successful:
        Carry flag - clear
    If function failed
        Carry flag - set
        ax = error code:
            3 - Path not found
Registers modified: ax, dx, ds, Flags
Syntax: ChangeDirectory StringSeg, StringOfs

CreateFile
----------
Function: Creates a new file or truncates an existing file to 0 bytes. A file
          associated with the file is returned.
DOS Function: 3Ch
DOS Versions: 2, 3
Input
    Attributes - File's attributes
    StringSeg - Segment address of ASCIIZ file spec.
    StringOfs - Offset within StringSeg of file spec.
Output
    If function successful:
        Carry flag - clear
        ax - file handle
    If function failed
        Carry flag - set
        ax - error code:
            3 - Path not found
            4 - No handle available
            5 - Access denied
Registers modified: ax, cx, dx, ds, Flags
Syntax: CreateFile  Attributes, StringSeg, StringOfs

OpenFile
--------
Function: Opens an exiting file and returns a file handle associated with the
          file.
DOS Function: 3Dh
DOS Versions: 2, 3
Input
    AccessMode - File access mode as defined below
    BITS    VALUE       FUNCTION                        DOS VERSION
    ----    -----       ----------------------------    -----------
     0-2     000        Read Access                      2.0 & 3.0
             001        Write Access                     2.0 & 3.0
             010        Read/Write Access                2.0 & 3.0
       3       0        Reserved
     4-6     000        Sharing mode, compatability mode       3.0
             001        Sharing mode, read/write access        3.0
                        denied
             010        Sharing mode, Write access denied      3.0
             011        Sharing mode, Read access denied       3.0
             100        Sharing mode, Full access permitted    3.0
       7       0        Inheritance flag, File inherited       3.0
                        by child processes

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -