/* This subroutine defines words in memory. It also recognizes strings. */
 
#include <stdio.h>
#include "xasm.h"

void dw( char *label, char *opcode, char *operand, char *lptr  )
{
static char *Error = "dw: Invalid Operand.\n";
char *objcode;
	 
labproc( label );

if ( operand == NULL || *operand == '\0' )
   {
   xerror( Error );
   return;
   }
    
while ( *operand != 0 )
   {
   if ( *operand == '\'' || *operand == '"' )
      {
#ifdef DEBUG
      strproc( &operand ); /* Go process the operand */
#endif
      if ( *operand == '\0' )
	 continue; /* Loop around, then out */
      if ( *operand != ',' )
	 {
	 xerror( "dw: Invalid Operand" );
	 return;
	 }
      }
   objcode = proper( label, opcode, operand, NULL );
   printl( (long) loc, objcode, 0, lptr );
   if ( objcode != NULL )
      genobj( objcode );
   locinc = 2;
   while( *operand != ',' && *operand != '\0' )
      operand++; /* Advance to next item */
   }
}
