Author Topic: Alternative macros64 : OFFSET and &.  (Read 481 times)

HSE

  • Member
  • *****
  • Posts: 2018
  • AMD 7-32 / i3 10-64
Alternative macros64 : OFFSET and &.
« on: December 06, 2021, 11:35:57 PM »
Hi all!!

Some additions for compatibility of programminf styles.


In REGISTER:
Code: [Select]
      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:
Code: [Select]
     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

  • Member
  • *****
  • Posts: 2018
  • AMD 7-32 / i3 10-64
Re: Alternative macros64 : OFFSET and &.
« Reply #1 on: December 06, 2021, 11:48:03 PM »
A little mistake in "&" is corrected now (I think).
Equations in Assembly: SmplMath