News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Alternative macros64 : OFFSET and &.

Started by HSE, December 06, 2021, 11:35:57 PM

Previous topic - Next topic

HSE

Hi all!!

Some additions for compatibility of programminf styles.


In REGISTER:      IF ssize GT 6                             ;; handle OFFSET notation
        lead SUBSTR <anum>,1,6
        IFIDNI lead,<OFFSET>
          wrd2 SUBSTR <anum>,8
          mov qreg, OFFSET wrd2
          goto elbl
        ENDIF
      ENDIF

      IF ssize GT 1                             ;; handle ampersand text
        lead SUBSTR <anum>,1,1
        IFIDNI lead,<&>
          wrd2 SUBSTR <anum>,1
          lea qreg, wrd2
          goto elbl
        ENDIF
      ENDIF


In STACKARG:     IF ssize GT 6                             ;; handle OFFSET notation
        lead SUBSTR <anum>,1,6
        IFIDNI lead,<OFFSET>
          wrd2 SUBSTR <anum>,8
          mov QWORD PTR [rsp+disp], OFFSET wrd2
          goto elbl
        ENDIF
      ENDIF

      IF ssize GT 1                             ;; handle ampersan text
        lead SUBSTR <anum>,1,1
        IFIDNI lead,<&>
          wrd2 SUBSTR <anum>,1
          lea rax, wrd2
          mov QWORD PTR [rsp+disp], rax
          goto elbl
        ENDIF
      ENDIF


Because I never use ampersand, I don't know exactly if replace ADDR or OFFSET. I put like ADDR.
I propose like alternative, and not like main file, because every comparison can slowdown assembling process. 
Equations in Assembly: SmplMath

HSE

A little mistake in "&" is corrected now (I think).
Equations in Assembly: SmplMath