News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

typedef syntax

Started by TouEnMasm, May 15, 2021, 03:56:53 AM

Previous topic - Next topic

TouEnMasm

Hello,
I try to write something like  "GAMMA_TABLES typedef  BYTE 256:dup(?) "
Don't seem to be the good syntax,Help!
Fa is a musical note to play with CL

Biterider

Maybe this workaround
??GAMMA_TABLES struct
  repeat 256
    BYTE ?
  endm
??GAMMA_TABLES ends

GAMMA_TABLES typedef ??GAMMA_TABLES


Biterider



jj2007

Why so complicated? Sorry, just curious...

hutch--

I remember some time ago doing a "typedef madness" demo and with much the same comment now, more often than not, typedefs add to confusion at the expense of comprehension, a mindless attempt to drag the clarity of assembler programming into the morass of C compiler clutter.

StillLearningMasm

TouEnMasm,

Here are 2 other methods to choose from:

;Method 1 to create an array named GAMMA_TABLES
GAMMA_TABLES BYTE 256 DUP (?)

;Method 2 to create an array named GAMMA_TABLES
GAMMA_TABLE_ARRAY struct
  BYTE 256 dup(?)
GAMMA_TABLE_ARRAY ends
GAMMA_TABLES typedef GAMMA_TABLE_ARRAY