Author Topic: whats your favourite macro?  (Read 525 times)

daydreamer

  • Member
  • *****
  • Posts: 1634
  • building nextdoor
whats your favourite macro?
« 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
SIMD fan and macro fan
why assembly is fastest is because its switch has no (brakes) breaks
:P
only in 16bit assembly you can get away with "Only words" :P

TouEnMasm

  • Member
  • *****
  • Posts: 1679
    • EditMasm
Re: whats your favourite macro?
« Reply #1 on: December 31, 2020, 12:47:29 AM »
TXT (with all variations possibles),CUNI for UNICODE

Fa is a musical note to play with CL

HSE

  • Member
  • *****
  • Posts: 1700
  • <AMD>< 7-32>
Re: whats your favourite macro?
« Reply #2 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

jj2007

  • Member
  • *****
  • Posts: 11476
  • Assembler is fun ;-)
    • MasmBasic
Re: whats your favourite macro?
« Reply #3 on: December 31, 2020, 02:11:27 AM »
A: invoke
B: deb followed by Recall

Adamanteus

  • Member
  • **
  • Posts: 241
    • LLC "AMS"
Re: whats your favourite macro?
« Reply #4 on: January 01, 2021, 03:20:51 AM »
Much economy time-size :
Code: [Select]
inv TEXTEQU <Invoke>