📄 stl.hhf
字号:
var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isLessEqual; push( ebx ); push( ecx ); mov( left, ebx ); mov( [ebx+12], eax ); mov( right, ecx ); cmp( eax, [ecx+12] ); if( @e ) then mov( [ebx+8], eax ); cmp( eax, [ecx+8] ); if( @e ) then mov( [ebx+4], eax ); cmp( eax, [ecx+4] ); if( @e ) then mov( [ebx], eax ); cmp( eax, [ecx] ); endif; endif; endif; setbe( al ); and( $ff, eax ); pop( ecx ); pop( ebx ); end isLessEqual; #elseif( @ptype( theType ) = hla.ptInt8 ) method symbol.isEqual ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isEqual; push( ebx ); mov( left, ebx ); mov( [ebx], al ); mov( right, ebx ); cmp( al, [ebx] ); sete( al ); and( $ff, eax ); pop( ebx ); end isEqual; method symbol.isLess ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isLess; push( ebx ); mov( left, ebx ); mov( [ebx], al ); mov( right, ebx ); cmp( al, [ebx] ); setl( al ); and( $ff, eax ); pop( ebx ); end isLess; method symbol.isLessEqual ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isLessEqual; push( ebx ); mov( left, ebx ); mov( [ebx], al ); mov( right, ebx ); cmp( al, [ebx] ); setle( al ); and( $ff, eax ); pop( ebx ); end isLessEqual; #elseif( @ptype( theType ) = hla.ptInt16 ) method symbol.isEqual ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isEqual; push( ebx ); mov( left, ebx ); mov( [ebx], ax ); mov( right, ebx ); cmp( ax, [ebx] ); sete( al ); and( $ff, eax ); pop( ebx ); end isEqual; method symbol.isLess ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isLess; push( ebx ); mov( left, ebx ); mov( [ebx], ax ); mov( right, ebx ); cmp( ax, [ebx] ); setl( al ); and( $ff, eax ); pop( ebx ); end isLess; method symbol.isLessEqual ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isLessEqual; push( ebx ); mov( left, ebx ); mov( [ebx], ax ); mov( right, ebx ); cmp( ax, [ebx] ); setle( al ); and( $ff, eax ); pop( ebx ); end isLessEqual; #elseif( @ptype( theType ) = hla.ptInt32 ) method symbol.isEqual ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isEqual; push( ebx ); mov( left, ebx ); mov( [ebx], eax ); mov( right, ebx ); cmp( eax, [ebx] ); sete( al ); and( $ff, eax ); pop( ebx ); end isEqual; method symbol.isLess ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isLess; push( ebx ); mov( left, ebx ); mov( [ebx], eax ); mov( right, ebx ); cmp( eax, [ebx] ); setl( al ); and( $ff, eax ); pop( ebx ); end isLess; method symbol.isLessEqual ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isLessEqual; push( ebx ); mov( left, ebx ); mov( [ebx], eax ); mov( right, ebx ); cmp( eax, [ebx] ); setle( al ); and( $ff, eax ); pop( ebx ); end isLessEqual; #elseif( @ptype( theType ) = hla.ptInt64 ) method symbol.isEqual ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isEqual; push( ebx ); push( ecx ); mov( left, ebx ); mov( [ebx+4], eax ); mov( right, ecx ); cmp( eax, [ecx+4] ); if( @e ) then mov( [ebx], eax ); cmp( eax, [ecx] ); endif; sete( al ); and( $ff, eax ); pop( ecx ); pop( ebx ); end isEqual; method symbol.isLess ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isLess; push( ebx ); push( ecx ); mov( left, ebx ); mov( [ebx+4], eax ); mov( right, ecx ); cmp( eax, [ecx+4] ); if( @e ) then mov( [ebx], eax ); cmp( eax, [ecx] ); endif; setl( al ); and( $ff, eax ); pop( ecx ); pop( ebx ); end isLess; method symbol.isLessEqual ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isLessEqual; push( ebx ); push( ecx ); mov( left, ebx ); mov( [ebx+4], eax ); mov( right, ecx ); cmp( eax, [ecx+4] ); if( @e ) then mov( [ebx], eax ); cmp( eax, [ecx] ); endif; setle( al ); and( $ff, eax ); pop( ecx ); pop( ebx ); end isLessEqual; #elseif( @ptype( theType ) = hla.ptInt128 ) method symbol.isEqual ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isEqual; push( ebx ); push( ecx ); mov( left, ebx ); mov( [ebx+12], eax ); mov( right, ecx ); cmp( eax, [ecx+12] ); if( @e ) then mov( [ebx+8], eax ); cmp( eax, [ecx+8] ); if( @e ) then mov( [ebx+4], eax ); cmp( eax, [ecx+4] ); if( @e ) then mov( [ebx], eax ); cmp( eax, [ecx] ); endif; endif; endif; sete( al ); and( $ff, eax ); pop( ecx ); pop( ebx ); end isEqual; method symbol.isLess ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isLess; push( ebx ); push( ecx ); mov( left, ebx ); mov( [ebx+12], eax ); mov( right, ecx ); cmp( eax, [ecx+12] ); if( @e ) then mov( [ebx+8], eax ); cmp( eax, [ecx+8] ); if( @e ) then mov( [ebx+4], eax ); cmp( eax, [ecx+4] ); if( @e ) then mov( [ebx], eax ); cmp( eax, [ecx] ); endif; endif; endif; setl( al ); and( $ff, eax ); pop( ecx ); pop( ebx ); end isLess; method symbol.isLessEqual ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isLessEqual; push( ebx ); push( ecx ); mov( left, ebx ); mov( [ebx+12], eax ); mov( right, ecx ); cmp( eax, [ecx+12] ); if( @e ) then mov( [ebx+8], eax ); cmp( eax, [ecx+8] ); if( @e ) then mov( [ebx+4], eax ); cmp( eax, [ecx+4] ); if( @e ) then mov( [ebx], eax ); cmp( eax, [ecx] ); endif; endif; endif; setle( al ); and( $ff, eax ); pop( ecx ); pop( ebx ); end isLessEqual; #elseif ( @ptype( theType ) = hla.ptReal32 | @ptype( theType ) = hla.ptReal64 | @ptype( theType ) = hla.ptReal80 ) method symbol.isEqual ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isEqual; mov( right, eax ); fld( (type theType [eax]) ); mov( left, eax ); fld( (type theType [eax]) ); fcomip(); fstp( left ); sete( al ); and( $ff, eax ); end isEqual; method symbol.isLess ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isLess; mov( right, eax ); fld( (type theType [eax]) ); mov( left, eax ); fld( (type theType [eax]) ); fcomip(); fstp( left ); setb( al ); and( $ff, eax ); end isLess; method symbol.isLessEqual ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isLessEqual; mov( right, eax ); fld( (type theType [eax]) ); mov( left, eax ); fld( (type theType [eax]) ); fcomip(); fstp( left ); setbe( al ); and( $ff, eax ); end isLessEqual; #elseif( @ptype( theType ) = hla.ptString ) method symbol.isEqual ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isEqual; mov( left, eax ); pushd( [eax] ); mov( right, eax ); pushd( [eax] ); call( str.eq ); and( $ff, eax ); end isEqual; method symbol.isLess ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isLess; mov( left, eax ); pushd( [eax] ); mov( right, eax ); pushd( [eax] ); call( str.lt ); and( $ff, eax ); end isLess; method symbol.isLessEqual ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isLessEqual; mov( left, eax ); pushd( [eax] ); mov( right, eax ); pushd( [eax] ); call( str.le ); and( $ff, eax ); end isLessEqual; #elseif( @ptype( theType ) = hla.ptCset ) method symbol.isEqual ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isEqual; mov( left, eax ); pushd( [eax] ); mov( right, eax ); pushd( [eax] ); call( cs.eq ); and( $ff, eax ); end isEqual; method symbol.isLess ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isLess; mov( left, eax ); pushd( [eax] ); mov( right, eax ); pushd( [eax] ); call( cs.lt ); and( $ff, eax ); end isLess; method symbol.isLessEqual ( var left:theType; var right:theType ); @nodisplay; @nostackalign; begin isLessEqual; mov( left, eax ); pushd( [eax] ); mov( right, eax ); pushd( [eax] ); call( cs.le ); and( $ff, eax ); end isLessEqual; #else // For non-primitive types, the user must write the // comparison routines, assuming the elements are // comparable. #endif#endmacro////////////////////////////////////////////////////////////////////////////////// base-// All STL objects are a subclass of base:type base: class // isSTL_c exists so we can use the @defined compile-time // function to determine if an object is an STL object. const isSTL_c :boolean := @global:true; // Compile-time "traits": // // Once we know it's an STL object, we can use the // capabilities constant (at compile-time) to determine // the capabilities of an unknown STL type: val capabilities_c :dword := 0; hierarchy_c :dword := 0; performance_c :dword := 0; var align( 4 ); // Run-time traits: // // At run-time, we can test the capabilities variable to // determine the capabilities of an STL object. capabilities :dword; hierarchy :dword; performance :dword; // Type name is initialized with a string specifying the // actual (user-defined) data type: typeName :string; // This flag tells us whether the object was // allocated on the heap by the constructor. isAlloc :boolean; // Method that will convert an STL object to a string (for output): method toString; abstract; endclass;static(4) vmt(base);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -