Author Topic: Generics.inc  (Read 1328 times)

0 Members and 1 Guest are viewing this topic.

jcfuller

  • Guest
Generics.inc
« on: February 24, 2018, 05:17:56 AM »
Charles,
  While checking out the latest download I noticed changes to some of the mcros in Generics.inc from lower case to Camel case. I tried checking if it made a difference and got errors.
James

Code: [Select]
use rtl64
use generics
sys a,b,c
a = 7
b = 8
c = min(a,b)
print c

 ; ASM ERR:    then mov rax,[rbx+0x1098]!!  Unidentified instruction: then
 ; AFTER:      ._c
 ; LINE:       7

Charles Pegge

  • Guest
Re: Generics.inc
« Reply #1 on: February 24, 2018, 06:13:02 AM »

Hi James,

These macros are in procedural form and cannot be used as functions. I must rename them for clarity.

Code: [Select]
  macro SetMin(a,m)
  =================
  if m<a then a=m
  end macro


  macro SetMax(a,m)
  =================
  if m>a then a=m
  end macro


  macro SetMinMax(a,n,m)
  ======================
  if a<n then
    a=n
  elseif a>m then
    a=m
  end if
  end macro