<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.signature.net/skins/common/feed.css?270"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.signature.net/index.php?action=history&amp;feed=atom&amp;title=Open_DOS_File</id>
		<title>Open DOS File - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.signature.net/index.php?action=history&amp;feed=atom&amp;title=Open_DOS_File"/>
		<link rel="alternate" type="text/html" href="http://wiki.signature.net/index.php?title=Open_DOS_File&amp;action=history"/>
		<updated>2026-05-04T00:46:35Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.16.0</generator>

	<entry>
		<id>http://wiki.signature.net/index.php?title=Open_DOS_File&amp;diff=1522&amp;oldid=prev</id>
		<title>Badge at 09:51, 13 June 2009</title>
		<link rel="alternate" type="text/html" href="http://wiki.signature.net/index.php?title=Open_DOS_File&amp;diff=1522&amp;oldid=prev"/>
				<updated>2009-06-13T09:51:36Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 09:51, 13 June 2009&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''Return:''' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;nbsp;  &lt;/del&gt;If the function call is successful, the AX field will contain the&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''Return:''' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &amp;lt;br&amp;gt;&amp;nbsp; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;nbsp; &lt;/del&gt;file's handle.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If the function call is successful, the AX field will contain the file's handle.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If an exception occurs, byte 2 of the AX field will contain the&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If an exception occurs, byte 2 of the AX field will contain the DOS error code (in hex).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;nbsp; &lt;/del&gt;DOS error code (in hex).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikidb:diff:version:1.11a:oldid:1521:newid:1522 --&gt;
&lt;/table&gt;</summary>
		<author><name>Badge</name></author>	</entry>

	<entry>
		<id>http://wiki.signature.net/index.php?title=Open_DOS_File&amp;diff=1521&amp;oldid=prev</id>
		<title>Badge: New page: '''Open DOS File'''  '''Syntax:'''  &lt;br&gt;  DOSFC(AX-value, CX-value, file-name) EXCP=statement-label   '''Entry:'''   AX-value = &quot;@3D00@&quot;         (read only)   CX-value = &quot;@0000@&quot;  '''(or)'...</title>
		<link rel="alternate" type="text/html" href="http://wiki.signature.net/index.php?title=Open_DOS_File&amp;diff=1521&amp;oldid=prev"/>
				<updated>2009-06-13T09:48:45Z</updated>
		
		<summary type="html">&lt;p&gt;New page: &amp;#39;&amp;#39;&amp;#39;Open DOS File&amp;#39;&amp;#39;&amp;#39;  &amp;#39;&amp;#39;&amp;#39;Syntax:&amp;#39;&amp;#39;&amp;#39;  &amp;lt;br&amp;gt;  DOSFC(AX-value, CX-value, file-name) EXCP=statement-label   &amp;#39;&amp;#39;&amp;#39;Entry:&amp;#39;&amp;#39;&amp;#39;   AX-value = &amp;quot;@3D00@&amp;quot;         (read only)   CX-value = &amp;quot;@0000@&amp;quot;  &amp;#39;&amp;#39;&amp;#39;(or)&amp;#39;...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Open DOS File'''&lt;br /&gt;
&lt;br /&gt;
'''Syntax:'''  &amp;lt;br&amp;gt;&lt;br /&gt;
 DOSFC(AX-value, CX-value, file-name) EXCP=statement-label  &lt;br /&gt;
'''Entry:'''&lt;br /&gt;
  AX-value = &amp;quot;@3D00@&amp;quot;         (read only)&lt;br /&gt;
  CX-value = &amp;quot;@0000@&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''(or)'''&lt;br /&gt;
&lt;br /&gt;
  AX-value = &amp;quot;@3D42@&amp;quot;         (read/write)&lt;br /&gt;
  CX-value = &amp;quot;@0000@&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
'''Return:'''    If the function call is successful, the AX field will contain the&lt;br /&gt;
  file's handle.&lt;br /&gt;
&lt;br /&gt;
If an exception occurs, byte 2 of the AX field will contain the&lt;br /&gt;
  DOS error code (in hex).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
'''Discussion:''' &amp;lt;br&amp;gt;&lt;br /&gt;
The DOSFC function call can be used to open a DOS file. &lt;br /&gt;
For read-only purposes, the function requires that the AX-value be set to &amp;quot;@3D00@&amp;quot; and the CX-value be set to null. &lt;br /&gt;
&lt;br /&gt;
For read/write purposes, the function requires that the AX-value be set to &amp;quot;@3D42@&amp;quot; and the CX-value be set to null. &lt;br /&gt;
&lt;br /&gt;
After the function is executed, the file will be open and the AX register will contain the file's handle. As noted earlier, it is the responsibility of the programmer to ensure that any file handles opened are closed upon completion of the desired function. Failure to comply will result in degradation of system performance and possible system hangs. &lt;br /&gt;
 &lt;br /&gt;
'''Example:'''&amp;lt;br&amp;gt;&lt;br /&gt;
  ! S SFOPEN,DSK&lt;br /&gt;
  ! O FOPEN,DSK&lt;br /&gt;
  ! L T00,E&lt;br /&gt;
  ! R QMONITOR&lt;br /&gt;
  !&lt;br /&gt;
  !==========  OPEN DOS FILE HANDLE  =============================&lt;br /&gt;
  !&lt;br /&gt;
  LENGTH 2 &amp;amp; LOCAL AX$,BX$,CX$,DX$        ! Define registers&lt;br /&gt;
             LOCAL FILEHANDLE$            ! Define file handle&lt;br /&gt;
  LENGTH 64 &amp;amp; LOCAL FILENAME$             ! Define file name&lt;br /&gt;
  !&lt;br /&gt;
  LENGTH  3 &amp;amp; LOCAL DOSCODE$              ! Define DOS error code&lt;br /&gt;
  LENGTH 37 &amp;amp; LOCAL DOSMESSAGE$           ! Define DOS message&lt;br /&gt;
  !&lt;br /&gt;
  100 FORMAT (ET)                         ! Screen format&lt;br /&gt;
  !&lt;br /&gt;
  1000 FORMAT DOSMESSAGE$                 ! File input format&lt;br /&gt;
  !&lt;br /&gt;
  CLEAR                                   ! Initialize variables&lt;br /&gt;
  PRINT (0,100)                           ! Set typewriter mode&lt;br /&gt;
  !&lt;br /&gt;
  PRINT (0) &amp;quot;ENTER FILENAME TO OPEN:&amp;quot;     ! Display prompt&lt;br /&gt;
  INPUT (0) FILENAME$                     ! Enter file name&lt;br /&gt;
  IF FILENAME$ = &amp;quot;&amp;quot; THEN RUN &amp;quot;QMONITOR&amp;quot;   ! If null, then stop&lt;br /&gt;
  FILENAME$ = FILENAME$ + &amp;quot;@00@&amp;quot;          ! Add null byte to name&lt;br /&gt;
  !&lt;br /&gt;
  AX$ = &amp;quot;@3D42@&amp;quot;                          ! Set AX to &amp;quot;OPEN FILE&amp;quot;&lt;br /&gt;
  CX$ = &amp;quot;@0000@&amp;quot;                          ! Set CX to null&lt;br /&gt;
  !&lt;br /&gt;
  DOSFC(AX$,CX$,FILENAME$) EXCP=BRANCH1   ! Perform DOSFC call&lt;br /&gt;
  !&lt;br /&gt;
  FILEHANDLE$ = AX$                       ! Save file handle&lt;br /&gt;
  !&lt;br /&gt;
  PRINT (0) FILENAME$;&amp;quot; OPENED SUCCESSFULLY.&amp;quot;&lt;br /&gt;
  PRINT (0) &amp;quot;PRESS ENTER TO CLOSE THE FILE.&amp;quot;&lt;br /&gt;
  INPUT (0) &amp;quot;&amp;quot;&lt;br /&gt;
  !&lt;br /&gt;
  AX$ = &amp;quot;@3E00@&amp;quot;                          ! Set AX to &amp;quot;CLOSE FILE&amp;quot;&lt;br /&gt;
  BX$ = FILEHANDLE$                       ! Set BX to file handle&lt;br /&gt;
  CX$ = &amp;quot;@0000@&amp;quot;                          ! Set CX to null&lt;br /&gt;
  DX$ = &amp;quot;@0000@&amp;quot;                          ! Set DX to null&lt;br /&gt;
  !&lt;br /&gt;
  DOSMS(AX$,BX$,CX$,DX$) EXCP=BRANCH2     ! Perform DOSMS call&lt;br /&gt;
  !&lt;br /&gt;
  PRINT (0) FILENAME$;&amp;quot; CLOSED SUCCESSFULLY.&amp;quot;&lt;br /&gt;
  PRINT (0) &amp;quot;PRESS ENTER TO STOP.&amp;quot;&lt;br /&gt;
  INPUT (0) &amp;quot;&amp;quot;&lt;br /&gt;
  RUN &amp;quot;QMONITOR&amp;quot;&lt;br /&gt;
  !&lt;br /&gt;
  BRANCH1:                                ! Exception routine 1&lt;br /&gt;
  PRINT (0) &amp;quot;FILE NOT OPENED.&amp;quot;            ! Display message&lt;br /&gt;
  OPEN (1) &amp;quot;QERCOMET&amp;quot;                     ! Open error file&lt;br /&gt;
  DOSCODE$ = &amp;quot;D&amp;quot; + HEXASC(SUB(AX$,2,1))   ! Construct key to file&lt;br /&gt;
  READ (1,1000) KEY=DOSCODE$              ! Read error record&lt;br /&gt;
  PRINT (0) &amp;quot;DOS error code: &amp;quot;;DOSCODE$   ! Display DOS error code&lt;br /&gt;
  PRINT (0) DOSMESSAGE$                   ! Display error message&lt;br /&gt;
  INPUT (0) &amp;quot;&amp;quot;                            ! Hold&lt;br /&gt;
  CLOSE (1)                               ! Close error file&lt;br /&gt;
  RUN &amp;quot;QMONITOR&amp;quot;                          ! Exit&lt;br /&gt;
  !&lt;br /&gt;
  BRANCH2:                                ! Exception routine 2&lt;br /&gt;
  PRINT (0) &amp;quot;FILE NOT CLOSED.&amp;quot;            ! Display message&lt;br /&gt;
  OPEN (1) &amp;quot;QERCOMET&amp;quot;                     ! Open error file&lt;br /&gt;
  DOSCODE$ = &amp;quot;D&amp;quot; + HEXASC(SUB(AX$,2,1))   ! Construct key to file&lt;br /&gt;
  READ (1,1000) KEY=DOSCODE$              ! Read error record&lt;br /&gt;
  PRINT (0) &amp;quot;DOS error code: &amp;quot;;DOSCODE$   ! Display DOS error code&lt;br /&gt;
  PRINT (0) DOSMESSAGE$                   ! Display error message&lt;br /&gt;
  INPUT (0) &amp;quot;&amp;quot;                            ! Hold&lt;br /&gt;
  CLOSE (1) &amp;amp; RUN &amp;quot;QMONITOR&amp;quot;              ! Close error file/exit&lt;br /&gt;
  END&lt;/div&gt;</summary>
		<author><name>Badge</name></author>	</entry>

	</feed>