$save nolist /* *============================================================================ * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE * * Permission to use for any purpose, modify, copy, and make enhancements * and derivative works of the software is granted if attribution is given to * R.M. Gillmore, dba the ACME Software Deli, as the author * * While the ACME Software Deli does not work for money, there is nonetheless * a significant amount of work involved. The ACME Software Deli maintains the * rights to all code written, though it may be used and distributed as long as * the following conditions are maintained. * * 1. The copyright statement at the top of each code block is maintained in * your distribution. * 2. You do not identify yourself as the ACME Software Deli * 3. Any changes made to the software are sent to the ACME Software Deli *============================================================================ */ /* * $Id: sysCalls.ext 1157 2025-05-05 00:35:39Z rmgillmore $ */ $if not SYSCALLS_EXT_INCLUDED $set (SYSCALLS_EXT_INCLUDED) $include (..\lib\comnDefs.ext) /* * The registerType definition exists in sysCaAsm.a86 also. Any change * made in either location requires the equivalent change in the other */ declare registerType literally 'structure ( AX word, BX word, CX word, DX word, SI word, DI word, DS selector, ES selector, FLAGS_reg word )'; /* * if you want to use the byte registers, you just create a variable of this * type, and make it reside at the same place in memory as the variable of * the 'registerType' (defined above) */ declare byteRegisterType literally 'structure ( ( AL, AH ) byte, ( BL, BH ) byte, ( CL, CH ) byte, ( DL, DH ) byte )'; declare cpuRegisters literally ' wordRegs registerType, byteRegs byteRegisterType at ( @wordRegs )'; declare CARRY_FLAG_MASK literally '0000$0000$0000$0001b', /* 'shl( word(1), 0 )', */ PARITY_FLAG_MASK literally '0000$0000$0000$0100b', /* 'shl( word(1), 2 )', */ AUX_CARRY_FLAG_MASK literally '0000$0000$0001$0000b', /* 'shl( word(1), 4 )', */ ZERO_FLAG_MASK literally '0000$0000$0100$0000b', /* 'shl( word(1), 6 )', */ SIGN_FLAG_MASK literally '0000$0000$1000$0000b', /* 'shl( word(1), 7 )', */ TRAP_FLAG_MASK literally '0000$0001$0000$0000b', /* 'shl( word(1), 8 )', */ INTERRUPT_FLAG_MASK literally '0000$0010$0000$0000b', /* 'shl( word(1), 9 )', */ DIRECTION_FLAG_MASK literally '0000$0100$0000$0000b', /* 'shl( word(1), 10 )', */ OVERFLOW_FLAG_MASK literally '0000$1000$0000$0000b'; /* 'shl( word(1), 11 )'; */ declare pointerStruct literally 'structure ( offset word, segment selector )'; declare pspStructure literally 'structure ( int20h (2) byte, allocationEndBlock word, reservedByte1 byte, farCallToDosDispatcher (5) byte, prevTermHandler pointer, prevControlCHandler pointer, prevCritErrorHandler pointer, parentProcessPsp selector, handleTable (20) byte, environmentBlock selector, reservedDosWorkArea (34) byte, int21hRetf (3) byte, reservedBytes2 (2) byte, FcbNum1Extension (7) byte, FcbNum1 (16) byte, FcbNum2 (16) byte, reservedBytesUnknown (4) byte, commandTailLength byte, commandTail (127) byte )'; /* * These values correspond to the interrupt documentation that has been * prepared by Ralf Brown, Peter Norton and many others over the years. * * A change here also means a change is needed to define the procedure * to be called */ declare DOS_CALL literally '21h', VIDEO_CALL literally '10h'; /* * Bitfields for long filename volume information flags: * Bit(s) Description (Table 01783) * 0 searches are case sensitive * 1 preserves case in directory entries * 2 uses Unicode characters in file and directory names * 3-13 reserved (0) * 14 supports DOS long filename functions * 15 volume is compressed */ declare volumeNameLength literally '24', fileSystemTypeLength literally '24'; declare volumeInfoType literally 'structure ( fileSystemFlags word, maxFilenameLength word, maxPathLength word, fileSystemType (fileSystemTypeLength) char, volumeName (volumeNameLength) char, sectorsPerCluster word, numberAvailableClusters word, bytesPerSector word, clustersPerDrive word )'; getPSP: procedure pointer external; end getPSP; getRegisters: procedure ( regPtr ) external; declare regPtr pointer; end getRegisters; declare reportStackPtr literally 'build$ptr( selector( stackBase ), stackPtr )'; reportLocation: procedure pointer external; end reportLocation; $if not CPUReportSource reportRegs: procedure ( regPtr, locationPtr ) external; declare regPtr pointer, locationPtr pointer; end reportRegs; $endif $if not unameSource osVersion: procedure word external; end osVersion; uname: procedure ( stringPtr, maxStringLength ) external; declare stringPtr pointer, maxStringLength word; end uname; $endif $if not greetUserSource greetUser: procedure ( fullProgramNameString, programVersionString, copyrightString ) external; declare fullProgramNameString pointer, programVersionString pointer, copyrightString pointer; end greetUser; $endif $if not sysCalls declare errno word external; carryClear: procedure ( regPtr ) boolean external; declare regPtr pointer; end carryClear; int86: procedure ( intNumber, cpuRegsPtr ) external; declare intNumber byte, cpuRegsPtr pointer, registers based cpuRegsPtr registerType; end int86; moddiv: procedure ( integerIn, denominator, resultsPtr ) external; declare integerIn integer, denominator integer, resultsPtr pointer; end moddiv; absoluteDiskRead: procedure ( driveNumber, controlPacketPtr, statusPtr ) external; declare driveNumber byte, controlPacketPtr pointer, statusPtr pointer; end absoluteDiskRead; getCurrentPSP: procedure pointer external; end getCurrentPSP; $endif $if not hostnameModule getHostname: procedure ( nameStringPtr ) external; declare nameStringPtr pointer; end getHostname; $endif $if not simpleExecSource simpleExecName: procedure ( fullNamePtr ) pointer external; declare fullNamePtr pointer; end simpleExecName; simpleFileName: procedure ( fullNamePtr ) pointer external; declare fullNamePtr pointer; end simpleFileName; $endif $if not dtaModuleSource getDTA: procedure pointer external; end getDTA; $endif $if not getEnvSource getenv: procedure ( variableNamePtr ) pointer external; declare variableNamePtr pointer; end getenv; $endif $endif $restore