conditional assembly problem

From: Jackson A. Marshall (
Date: 01/21/05

Date: Fri, 21 Jan 2005 18:45:07 +0000 (UTC)

Using "Microsoft (R) Macro Assembler Version 6.11"

Conditional assembly problem. I wish
to exclude part of an array of structures
but it is not working :

include file
NPB typedef near ptr byte
true equ 1
false equ 0

use3and4 equ false ; conditional

Some struct
 next NPB ?
 last NPB ?
Some ends
pSome typedef ptr Some

data area
$one db "one",0
$two db "two",0
$three db "three",0
$four db "four",0
$five db "five",0
$six db "six",0

; Some array
some Some \
{ offset $one, offset $two },
IF use3and4 eq true
{ offset $three, offset $four },
{ offset $five, offset $six }

typical code
  mov bx, offset some
  assume bx : pSome
  mov si, [bx].last ; get ptr
  assume bx : nothing
  insert "some[0].last = %s\n", bx
  invoke printf, bx, si


"Capitalism is the extraordinary belief that the
nastiest of men, for the nastiest of reasons, will
somehow work for the benefit of us all."
[John Maynard Keynes]

Relevant Pages

  • Re: conditional assembly problem
    ... > Conditional assembly problem. ... > to exclude part of an array of structures ... > next NPB? ... > pSome typedef ptr Some ...
  • Re: Typecasting pointers
    ... array of shorts, and initialize them all to the same value. ... You're saving the value of ptr so you can freeit later. ... A pointer increment advances the pointer by one object size, ... optimizing compiler could have done a better job than you have. ...
  • Re: Equates, object size and speed
    ... Dimensioned array access: ... You can also use these equates for dynamic array work ... Using the EQU DRNAME TO DEBTORdoesn't work for me ... Each refer to different dimensioned arrays. ...
  • Improving an assembly string search routine
    ... The one I want to tweak now is a string array ... CHRGET EQU $B1 ... JSR PTRGET;GET SEARCH VALUE ... LDA,Y ...
  • Re: Binary file from C++ to Matlab
    ... By convoluting array and pointer syntax, ... arr is an array of doubles but also an acronym for &arr. ... ptr is a pointer to a constant array literal. ...