dmlloyd Posted April 11, 2012 Share Posted April 11, 2012 Does anyone know of a reference which explains how command-line arguments are passed to ".COM" style XEXes in DOS XL (and presumably SDX as well)? I'm given to understand that both DOSes use a similar mechanism but I can't seem to find any information about how to write an XEX that accepts arguments. I'm near to disassembling .COMs at this point. Quote Link to comment Share on other sites More sharing options...
Sikor Posted April 11, 2012 Share Posted April 11, 2012 DOS XL: http://atariki.krap.pl/index.php/DOS_XL Sparta Dos X: http://sdx.atari8.info/index.php?show=en_docs Quote Link to comment Share on other sites More sharing options...
atari8warez Posted April 11, 2012 Share Posted April 11, 2012 (edited) Does anyone know of a reference which explains how command-line arguments are passed to ".COM" style XEXes in DOS XL (and presumably SDX as well)? I'm given to understand that both DOSes use a similar mechanism but I can't seem to find any information about how to write an XEX that accepts arguments. I'm near to disassembling .COMs at this point. SDX: SpartaDOS User Accessible Data Table Several SpartaDOS variables have been made available to programmers to allow easy access to the command line for applications and utilities. This data table is referred to as COMTAB and is pointed to by the OS vari - able DOSVEC at memory location 10 ($0A). An assembly language example is included for aid. This table is valid with all versions of Sparta- DOS except where noted. Locations COMTAB, ZCRNAME, BUFOFF, COMFNAM, and LBUF are also supported by OS/A+ and DOS XL. ZCRNAME COMTAB+3 This is a 6502 jump instruction followed by the address of the file name crunch routine. This location is used to interpret the command line. A jump here will pull the next command from LBUF, translate the drive or device identifier if one is given (i.e., A: to D1:), add the default drive iden- tifier if none is given and place the result at COMFNAM. Each call will advance BUFOFF to point to the next entry on the command line, so that each call to the crunch routine will get the next entry on the line. If no entries remain, the 6502 zero flag will be SET on return. Since the 6502 has no indirect jsr, it is necessary to use a few lines of code to access this routine. COMFNAM COMTAB+33 This is the destination buffer for the ZCRNAME routine. It will ALWAYS begin with a Dd: since the default drive is added if none is given. If you are looking for switches or other options, start looking at COMFNAM+3. This buffer is 28 bytes long. LBUF COMTAB+63 This is the input buffer for the command processor. The entire command line is stored here. LBUF is 64 bytes long. Edited April 11, 2012 by atari8warez Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.