diff --git a/History.txt b/History.txt index 6ee2e1a..d57a7cc 100644 --- a/History.txt +++ b/History.txt @@ -20,6 +20,10 @@ - regression in v2.05-v2.18, DUP operator: if an undefined symbol was contained in first operand, error message may have been omitted; see struct43.asm. + - local labels were accepted by PUBLIC directive without -Zm being set; + see public3.asm. + - omf format: incorrect special handling of assembly-time variable fixups + removed; see label9.asm. Other changes: - write listing reworked. diff --git a/Html/Manual.html b/Html/Manual.html index a07de71..71307b2 100644 --- a/Html/Manual.html +++ b/Html/Manual.html @@ -428,7 +428,10 @@

Option -Zg: Masm-compatible Code Generation

  • OPATTR will return the language type bits 8-10 for PROCs and PROTOs only.
  • - + + Those changes won't achieve an exact copy in all cases. Some instructions can be + encoded in more than one way ( i.e. CMP AL, AH ), and the JWasm code generator + may select a different encoding.

    Option -Zi: Emit Symbolic Debugging Info

    diff --git a/src/listing.c b/src/listing.c index 4c07398..e2992a2 100644 --- a/src/listing.c +++ b/src/listing.c @@ -402,14 +402,18 @@ void LstWrite( enum lsttype type, uint_32 oldofs, void *value ) for ( p1 = sym->string_ptr, p2 = &ll.buffer[3], pll = ≪ *p1; ) { if ( p2 >= &pll->buffer[28] ) { struct lstleft *next = myalloca( sizeof( struct lstleft ) ); + if ( p2 != &ll.buffer[28] ) *p2 = 0; /* v2.19: additional line, terminate header */ pll->next = next; pll = next; pll->next = NULL; - memset( pll->buffer, ' ', sizeof( pll->buffer) ); + /* v2.19: header of multi-line is variable in size */ + //memset( pll->buffer, ' ', sizeof( pll->buffer) ); + memset( pll->buffer, ' ', 3 ); p2 = &pll->buffer[3]; } *p2++ = *p1++; } + if ( p2 != &ll.buffer[28] ) *p2 = 0; /* v2.19: additional line, terminate header */ break; case LSTTYPE_MACROLINE: ll.buffer[1] = '>'; diff --git a/src/omf.c b/src/omf.c index c685c26..8d98b1f 100644 --- a/src/omf.c +++ b/src/omf.c @@ -385,6 +385,8 @@ static void omf_write_fixupp( struct dsym *seg, char is32 ) enum fixgen_types type = ( is32 ? FIX_GEN_MS386 : FIX_GEN_INTEL ); struct omf_rec obj; + //DebugMsg1(("omf_write_fixupp( %s )\n", seg->sym.name )); + fix = seg->e.seginfo->FixupList.head; while ( fix ) { for( data = (uint_8 *)StringBufferEnd, size = 0; fix; fix = fix->nextrlc ) { diff --git a/src/omffixup.c b/src/omffixup.c index f25eeb3..0f98657 100644 --- a/src/omffixup.c +++ b/src/omffixup.c @@ -338,17 +338,19 @@ static int omf_set_logref( const struct fixup *fixup, struct logref *lr ) if ( sym->segment && ((struct dsym *)sym->segment)->e.seginfo->group ) DebugMsg1(("omf_seg_logref: group=%s\n", ((struct dsym *)sym->segment)->e.seginfo->group->name )); #endif +#if 0 /* v2.19: "isvariable" branch disabled; see label9.asm */ /* v2.08: don't use info from assembly-time variables */ /* v2.16: the '$' is NO assembly-time variable; however, flag "isvariable" is TRUE! - * Are assembly-time variables defined by '=' supposed to create a fixup at all??? - * Why should their (final) value be defined at link time??? + * Variables defined by '=' directive may define a label, hence need a fixup then! */ //if ( sym->isvariable ) { if ( sym->isvariable && sym->isequate ) { lr->target_meth = ( fixup->frame_type == FRAME_GRP ? TARGET_GRP : TARGET_SEG ); lr->target_datum = fixup->frame_datum; DebugMsg1(("omf_seg_logref: assembly-time variable branch\n" )); - } else if ( sym->segment == NULL ) { /* shouldn't happen */ + } else +#endif + if ( sym->segment == NULL ) { /* shouldn't happen */ EmitErr( SEGMENT_MISSING_FOR_FIXUP, sym->name ); return ( 0 ); #if COMDATSUPP