The MASM Forum

Miscellaneous => The Orphanage => Topic started by: daydreamer on December 31, 2020, 12:27:37 AM

Title: whats your favourite macro?
Post by: daydreamer on December 31, 2020, 12:27:37 AM
whats your favourite macros in category
A:comes with assembler
B:your own made macro
C:someone elses macro you adapted
rv with or without chr$ macros to easily write everything needed for api call in one long line
some macros that replaces unsupported newer mnemonics
some special .COM interface version of invoke + float and other equates that makes d3d programming simpler
Title: Re: whats your favourite macro?
Post by: TouEnMasm on December 31, 2020, 12:47:29 AM
TXT (with all variations possibles),CUNI for UNICODE

Title: Re: whats your favourite macro?
Post by: HSE on December 31, 2020, 12:49:07 AM
fSlv8 , of course  :biggrin:

Code: [Select]
fSlv8 macro expr:VARARG

IFB FSBE_ENTITY
EXITM
ELSEIF fslv_glb_error
EXITM
ENDIF

fslv8_nc=fslv8_nc+1
fslvm_pos INSTR 1,<&expr>,<=>
fslvm_size SIZESTR <&expr>
IFE fslvm_pos
.err <missing '='>
EXITM
ELSEIF fslvm_size LE 1
.err <invalid argument>
EXITM
ELSEIF fslvm_pos EQ 1
fslvm_dest TEXTEQU <>
fslvm_expr TEXTEQU <&expr>
;fslvm_expr SUBSTR <&expr>,2
ELSE
fslvm_dest SUBSTR <&expr>,1,fslvm_pos-1
fslvm_dest TEXTEQU @TrimStr(%fslvm_dest)
fslvm_expr TEXTEQU <&expr>
;fslvm_expr SUBSTR <&expr>,fslvm_pos+1
ENDIF

IFNB fslvm_dest
IFIDNI @TrimStr(%fslvm_expr),<st0>
fst fslvm_dest
EXITM
ENDIF
ELSE
IF FSBE_FNC(%FSBE_ENTITY,%FSEN_REQ_RETVAL)
.err <destination operand required>
ENDIF
ENDIF

fslv_extract_attributes %fslvm_expr
IF fsea_found NE 0
fslvm_expr TEXTEQU fsea_expr
fslv_current_attributes TEXTEQU fsea_attributes
fslv_attributes? = 1
fslv_local_type_from_attributes fslv8_def_real_type,fslv8_def_int_type,%fsea_attributes
ELSE
fslv_attributes? = 0
fslv_lcl_real_type = fslv8_def_real_type
fslv_lcl_int_type  = fslv8_def_int_type
ENDIF

ll_MathTokenize SlvPath,SubExpr,%fslvm_expr
IF tmt_error
fslv_glb_error = 1
fslv_glb_error_msg CATSTR <PARSER: >,tmt_err_txt
.err fslv_glb_error_msg
EXITM
ENDIF

ll_fSlv SlvPath,SubExpr
IF fslv_glb_error
.err fslv_glb_error_msg
EXITM
ENDIF
endm
Title: Re: whats your favourite macro?
Post by: jj2007 on December 31, 2020, 02:11:27 AM
A: invoke
B: deb (http://www.jj2007.eu/MasmBasicQuickReference.htm#Mb1019) followed by Recall (http://www.jj2007.eu/MasmBasicQuickReference.htm#Mb1172)
Title: Re: whats your favourite macro?
Post by: Adamanteus on January 01, 2021, 03:20:51 AM
Much economy time-size :
Code: [Select]
inv TEXTEQU <Invoke>