News:

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

Main Menu

Signed Flags

Started by habran, October 12, 2014, 06:27:37 AM

Previous topic - Next topic

habran

ToutEnMasm have you succeeded to build JWasm on your machine?
Cod-Father

TouEnMasm


That's a great question.I have a source code than I can compile with vc express 2010.
Question is :
Wich source code to download and wich file to add/modify ?
With an answer ,I can do it.
Fa is a musical note to play with CL

nidud

#32
deleted

habran

It is JWasmHabran.zip this link http://masm32.com/board/index.php?topic=3149.0

the folder contains JWasm binaries and MVS13 Expres solution
it also contains changed sources
because of forum limitation I couldn't upload complete sources
so if someone wants to build it, must download it from Japheth site and than add missing sources
headers are all there so you don't need to touch the H folder
Cod-Father

habran

Cod-Father

nidud

#35
deleted

habran

Hey nidud :biggrin:
that is remarkable how your brains work :eusa_clap:
However, with only a few changes in original source code we can get all of this
this is hll.c
here I added last 3 characters

/* items in table below must match order COP_ZERO - COP_OVERFLOW */
static const char flaginstr[] = { 'z', 'c', 's', 'p', 'o', 'l', 'g', 'a'};


enum c_bop {
  COP_NONE,
  COP_EQ,   /* == */
  COP_NE,   /* != */
  COP_GT,   /* >  */
  COP_LT,   /* <  */
  COP_GE,   /* >= */
  COP_LE,   /* <= */
  COP_AND,  /* && */
  COP_OR,   /* || */
  COP_ANDB, /* &  */
  COP_NEG,  /* !  */
  COP_ZERO, /* ZERO?   not really a valid C operator */
  COP_CARRY,/* CARRY?  not really a valid C operator */
  COP_SIGN, /* SIGN?   not really a valid C operator */
  COP_PARITY,  /* PARITY?   not really a valid C operator */
  COP_OVERFLOW, /* OVERFLOW? not really a valid C operator */
  //added by habran
  COP_LESS,/* SIGN=OVERFLOW  not really a valid C operator */
  COP_GREATER, /* SIGNED ZERO OR CARRY   not really a valid C operator */
  COP_ABOVE  /* ZERO OR CARRY  not really a valid C operator */
};



  else {
    if (item->token != T_ID)
      return(COP_NONE);
    /* a valid "flag" string must end with a question mark */
    size = strlen(p);
    if (*(p + size - 1) != '?')
      return(COP_NONE);
    if (size == 5 && (0 == _memicmp(p, "ZERO", 4)))
      rc = COP_ZERO;
    else if (size == 6 && (0 == _memicmp(p, "CARRY", 5)))
      rc = COP_CARRY;
    else if (size == 5 && (0 == _memicmp(p, "SIGN", 4)))
      rc = COP_SIGN;
    else if (size == 7 && (0 == _memicmp(p, "PARITY", 6)))
      rc = COP_PARITY;
    else if (size == 9 && (0 == _memicmp(p, "OVERFLOW", 8)))
      rc = COP_OVERFLOW;
    //added by habran
    else if (size == 5 && (0 == _memicmp(p, "LESS", 4)))
      rc = COP_LESS;
    else if (size == 8 && (0 == _memicmp(p, "GREATER", 7)))
      rc = COP_GREATER;
    else if (size == 6 && (0 == _memicmp(p, "ABOVE", 5)))
      rc = COP_ABOVE;
    else
      return(COP_NONE);
  }



Cod-Father

habran

I have uploaded the C source in the post 1 of this thread and headers post 3 because they are together greater than 512K
Cod-Father

nidud

#38
deleted

habran

Hi nidud :biggrin:
I admire your intellect, enthusiasm and programming skills 8)
I also came to this idea but I realized that it would be to complex and confusing :dazzled:
Whatever changes I have done to JWasm is because of my needs, and I find this solution simple and clear:
signed jumps
   LESS?             JGE skip
   !LESS?            JL   skip
   GREATER?       JLE skip
  !GREATER?      JG   skip
unsigned missing jumps
   ABOVE?         JBE skip
   !ABOVE?        JA   skip
As we can see only Dave and ToutEnMasm are interested in this matter and they both agree with above flags,
so I decided to keep them
Thank you for your interest and time spent on this matter, I appreciate it :t

Cod-Father