📄 fileio.hhf
字号:
@global:false, // tText //45 @global:false, // tRegExMac //46 @global:false, // tNamespace //47 @global:false, // tSegment //48 @global:false, // tAnonRec //49 @global:false, // tAnonUnion //50 @global:false, // tVariant //51 @global:false // tError //52 ]; validPutSize2Type :boolean[ @global:hla.sizePTypes ] := [ @global:false, // Undefined @global:false, // tBoolean //1 @global:false, // enum //2 @global:false, // tUns8, //3 @global:false, // tUns16, //4 @global:false, // tUns32, //5 @global:false, // tUns64, //6 @global:false, // tUns128, //7 @global:false, // tByte, //8 @global:false, // tWord, //9 @global:false, // tDWord, //10 @global:false, // tQWord, //11 @global:false, // tTByte, //12 @global:false, // tLWord, //13 @global:false, // tInt8, //14 @global:false, // tInt16, //15 @global:false, // tInt32, //16 @global:false, // tInt64, //17 @global:false, // tInt128, //18 @global:false, // tChar, //19 @global:false, // tWChar, //20 @global:true, // tReal32, //21 @global:true, // tReal64, //22 @global:true, // tReal80, //23 @global:false, // tReal128, //24 @global:false, // tString, //25 @global:false, // tZString, //26 @global:false, // tWString, //27 @global:false, // tCset, //28 @global:false, // tArray, //29 @global:false, // tRecord, //30 @global:false, // tUnion, //31 @global:false, // tRegEx //32 @global:false, // tClass, //33 @global:false, // tProcptr, //34 @global:false, // tThunk, //35 @global:false, // tPointer //36 @global:false, // tLabel //37 @global:false, // tProc //38 @global:false, // tMethod //39 @global:false, // tClassProc //40 @global:false, // tClassIter //41 @global:false, // tIterator //42 @global:false, // tProgram //43 @global:false, // tMacro //44 @global:false, // tText //45 @global:false, // tRegExMac //46 @global:false, // tNamespace //47 @global:false, // tSegment //48 @global:false, // tAnonRec //49 @global:false, // tAnonUnion //50 @global:false, // tVariant //51 @global:false // tError //52 ]; putFunc :string[ @global:hla.sizePTypes ] := [ "", // Undefined "putbool", // tBoolean //1 "", // enum //2 "putu8", // tUns8, //3 "putu16", // tUns16, //4 "putu32", // tUns32, //5 "putu64", // tUns64, //6 "putu128", // tUns128, //7 "putb", // tByte, //8 "putw", // tWord, //9 "putd", // tDWord, //10 "putq", // tQWord, //11 "puttb", // tLWord, //12 "putl", // tLWord, //13 "puti8", // tInt8, //14 "puti16", // tInt16, //15 "puti32", // tInt32, //16 "puti64", // tInt64, //17 "puti128", // tInt128, //18 "putc", // tChar, //19 "", // tWChar, //20 "_pute32", // tReal32, //21 "_pute64", // tReal64, //22 "_pute80", // tReal80, //23 "", // tReal128, //24 "puts", // tString, //25 "putzs", // tZString, //26 "", // tWString, //27 "putcset", // tCset, //28 "", // tArray, //29 "", // tRecord, //30 "", // tUnion, //31 "", // tRegEx //32 "", // tClass, //33 "", // tProcptr, //34 "", // tThunk, //35 "putd", // tPointer //36 "", // tLabel //37 "", // tProc //38 "", // tMethod //39 "", // tClassProc //40 "", // tClassIter //41 "", // tIterator //42 "", // tProgram //43 "", // tMacro //44 "", // tText //45 "", // tRegExMac //46 "", // tNamespace //47 "", // tSegment //48 "", // tAnonRec //49 "", // tAnonUnion //50 "", // tVariant //51 "" // tError //52 ]; putSizeFunc :string[ @global:hla.sizePTypes ] := [ "", // Undefined "putboolSize", // tBoolean //1 "", // enum //2 "putu8Size", // tUns8, //3 "putu16Size", // tUns16, //4 "putu32Size", // tUns32, //5 "putu64Size", // tUns64, //6 "putu128Size", // tUns128, //7 "puth8Size", // tByte, //8 "puth16Size", // tWord, //9 "puth32Size", // tDWord, //10 "puth64Size", // tQWord, //11 "puth80Size", // tLWord, //12 "puth128Size", // tLWord, //13 "puti8Size", // tInt8, //14 "puti16Size", // tInt16, //15 "puti32Size", // tInt32, //16 "puti64Size", // tInt64, //17 "puti128Size", // tInt128, //18 "putcSize", // tChar, //19 "", // tWChar, //20 "pute32_", // tReal32, //21 "pute64_", // tReal64, //22 "pute80_", // tReal80, //23 "", // tReal128, //24 "putsSize", // tString, //25 "putzsSize", // tZString, //26 "", // tWString, //27 "", // tCset, //28 "", // tArray, //29 "", // tRecord, //30 "", // tUnion, //31 "", // tRegEx //32 "", // tClass, //33 "", // tProcptr, //34 "", // tThunk, //35 "puth32Size", // tPointer //36 "", // tLabel //37 "", // tProc //38 "", // tMethod //39 "", // tClassProc //40 "", // tClassIter //41 "", // tIterator //42 "", // tProgram //43 "", // tMacro //44 "", // tText //45 "", // tRegExMac //46 "", // tNamespace //47 "", // tSegment //48 "", // tAnonRec //49 "", // tAnonUnion //50 "", // tVariant //51 "" // tError //52 ]; putSize2Func :string[ @global:hla.sizePTypes ] := [ "", // Undefined "", // tBoolean //1 "", // enum //2 "", // tUns8, //3 "", // tUns16, //4 "", // tUns32, //5 "", // tUns64, //6 "", // tUns128, //7 "", // tByte, //8 "", // tWord, //9 "", // tDWord, //10 "", // tQWord, //11 "", // tLWord, //12 "", // tLWord, //13 "", // tInt8, //14 "", // tInt16, //15 "", // tInt32, //16 "", // tInt64, //17 "", // tInt128, //18 "", // tChar, //19 "", // tWChar, //20 "putr32", // tReal32, //21 "putr64", // tReal64, //22 "putr80", // tReal80, //23 "", // tReal128, //24 "", // tString, //25 "", // tZString, //26 "", // tWString, //27 "", // tCset, //28 "", // tArray, //29 "", // tRecord, //30 "", // tUnion, //31 "", // tRegEx //32 "", // tClass, //33 "", // tProcptr, //34 "", // tThunk, //35 "", // tPointer //36 "", // tLabel //37 "", // tProc //38 "", // tMethod //39 "", // tClassProc //40 "", // tClassIter //41 "", // tIterator //42 "", // tProgram //43 "", // tMacro //44 "", // tText //45 "", // tRegExMac //46 "", // tNamespace //47 "", // tSegment //48 "", // tAnonRec //49 "", // tAnonUnion //50 "", // tVariant //51 "" // tError //52 ]; val _v_ :string; _curparm_ :string; #macro put( _ileVar_, _parameters_[] ); ?@global:fileio._v_ := @string:_ileVar_; #for( @global:fileio._curparm_ in _parameters_ ) @global:hla.put ( fileio, @global:fileio._v_, @eval(@global:fileio._curparm_) ) #endfor #endmacro /* ** GET macro for file input. */ #macro get( _get_fileVar_, _parms_[] ): _curparm_, _pType_, _arg_, _id_, _tempid_, _saveTrace_; ?_saveTrace_ := @trace; ?@trace := false; ?_curparm_:uns32 := 0; // Save important registers that the "GET" macro uses. push( eax ); // The following loop repeats once for each GET parameter // we process. #while( _curparm_ < @elements( _parms_ )) // If this parameter begins with an identifier, // there are some problems to deal with. // The symbol table functions (e.g., @ptype) don't // allow address expression components after the // symbol name. Named constants, however, do allow // such entities. The following code determines // (1) is this a symbol? (2) if it is a symbol, is // it a constant? // // For non-constant symbols, we need to strip any // trailing non-symbol characters from the string // (e.g., "[0]" ). ?_arg_ := @trim( _parms_[ _curparm_ ], 0 ); #if( char( _arg_ ) in stdio._idchars_ ) // If this parameter begins with an id character, // then strip away any non-ID symbols from the // end of the string. Then determine if we've // got a constant or some other class (e.g., // variable or procedure). If not a constant, // keep only the name. If a constant, we need // to keep all trailing characters as well. ?_id_ := stdio._GetID_( _arg_ ); #if ( @class( @text( _id_ )) = hla.cConstant | @class( @text( _id_ )) = hla.cValue ) ?_id_ := _arg_; #endif #else // If it's not an ID, we need to keep everything. ?_id_ := _arg_; #endif // Determine the type of this parameter so we can // call the appropriate routine to input it. ?_pType_ := @pType( @text( _id_ )); ?_tempid_ := _id_; #while( _pType_ = hla.ptArray ) ?_tempid_ := @typename( @text( _tempid_ )); ?_pType_ := @pType( @text( _tempid_ )); #endwhile // Based on the type, call the appropriate library // routine to print this value. #if( _pType_ = hla.ptBoolean ) #error( "Boolean input is not supported" ); #elseif( _pType_ = hla.ptUns8 ) fileio.getu8( _get_fileVar_ ); #if( _arg_ = "al" ) mov( al, [esp] ); #elseif( _arg_ = "ah" ) mov( al, [esp+1] ); #else mov( al, @text( _arg_ )); #endif #elseif( _pType_ = hla.ptUns16 ) fileio.getu16( _get_fileVar_ ); #if( _arg_ = "ax" ) mov( ax, [esp] ); #else mov( ax, @text( _arg_ )); #endif #elseif( _pType_ = hla.ptUns32 ) fileio.getu32( _get_fileVar_ ); #if( _arg_ = "eax" ) mov( eax, [esp] ); #else mov( eax, @text( _arg_ )); #endif #elseif( _pType_ = hla.ptUns64 ) push( edx ); fileio.getu64( _get_fileVar_ ); mov( eax, @text( "(type dword " + _arg_ + ")" )); mov( edx, @text( "(type dword " + _arg_ + "[4])" )); pop( edx ); #elseif( _pType_ = hla.ptUns128 ) fileio.getu128( _get_fileVar_, @text( _arg_ ) ); #elseif( _pType_ = hla.ptByte ) fileio.geth8( _get_fileVar_ ); #if( _arg_ = "al" ) mov( al, [esp] ); #elseif( _arg_ = "ah" ) mov( al, [esp+1] ); #else mov( al, @text( _arg_ )); #endif #elseif( _pType_ = hla.ptWord ) fileio.geth16( _get_fileVar_ ); #if( _arg_ = "ax" ) mov( ax, [esp] ); #else mov( ax, @text( _arg_ )); #endif #elseif( _pType_ = hla.ptDWord ) fileio.geth32( _get_fileVar_ ); #if( _arg_ = "eax" ) mov( eax, [esp] ); #else mov( eax, @text( _arg_ )); #endif #elseif( _pType_ = hla.ptQWord ) push( edx ); fileio.geth64( _get_fileVar_ ); mov( eax, @text( "(type dword " + _arg_ + ")" )); mov( edx, @text( "(type dword " + _arg_ + "[4])" )); pop( edx ); #elseif( _pType_ = hla.ptLWord ) fileio.geth128( _get_fileVar_, @text( _arg_ ) ); #elseif( _pType_ = hla.ptInt8 ) fileio.geti8( _get_fileVar_ ); #if( _arg_ = "al" ) mov( al, [esp] ); #elseif( _arg_ = "ah" ) mov( al, [esp+1] ); #else mov( al, @text( _arg_ )); #endif #elseif( _pType_ = hla.ptInt16 ) fileio.geti16( _get_fileVar_ ); #if( _arg_ = "ax" ) mov( ax, [esp] ); #else mov( ax, @text( _arg_ )); #endif #elseif( _pType_ = hla.ptInt32 ) fileio.geti32( _get_fileVar_ ); #if( _arg_ = "eax" ) mov( eax, [esp] ); #else mov( eax, @text( _arg_ )); #endif #elseif( _pType_ = hla.ptInt64 ) push( edx ); fileio.geti64( _get_fileVar_ ); mov( eax, @text( "(type dword " + _arg_ + ")" )); mov( edx, @text( "(type dword " + _arg_ + "[4])" )); pop( edx ); #elseif( _pType_ = hla.ptInt128 ) fileio.geti128( _get_fileVar_, @text( _arg_ ) ); #elseif( _pType_ = hla.ptChar ) fileio.getc( _get_fileVar_ ); #if( _arg_ = "al" ) mov( al, [esp] ); #elseif( _arg_ = "ah" ) mov( al, [esp+1] ); #else mov( al, @text( _arg_ )); #endif #elseif( _pType_ = hla.ptCset ) #error( "Cset input is not supported" ); #elseif ( _pType_ = hla.ptReal32 | _pType_ = hla.ptReal64 | _pType_ = hla.ptReal80 ) fileio.getf( _get_fileVar_ ); fstp( @text( _arg_ )); #elseif( _pType_ = hla.ptString ) #if( _arg_ = "eax" ) fileio.gets( _get_fileVar_, [esp] ); #else fileio.gets( _get_fileVar_, @text( _arg_ )); #endif #else #error ( "fileio.get: Unknown data type (" + _parms_[ _curparm_ ] + ":" + @typename( @text( _id_ )) + ")" ); #endif ?_curparm_ := _curparm_ + 1; #endwhile // Restore the registers pushed earlier for this call to // the GET macro. Note that this statement does not end // with a semicolon. This is to force the programmer to // put a semicolon after the fileio.get(--) invocation. pop( eax ) ?@trace := _saveTrace_; #endmacroend fileio;#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -