#include "bitops.h"
#include "cddefs.h"
#include "coll.h"
+#include "gentype.h"
#include "intstack.h"
#include "scopedefs.h"
#include "symdefs.h"
#include "repeat.h"
#include "segment.h"
#include "sizeof.h"
+#include "span.h"
#include "spool.h"
#include "struct.h"
#include "symbol.h"
static void DoAddr (void)
/* Define addresses */
{
+ /* Record type information */
+ Span* S = OpenSpan ();
+ StrBuf Type = STATIC_STRBUF_INITIALIZER;
+
+ /* Parse arguments */
while (1) {
if (GetCPU() == CPU_65816) {
EmitWord (GenWordExpr (Expression ()));
NextTok ();
}
}
+
+ /* Close the span, then add type information to it */
+ S = CloseSpan (S);
+ GT_AddArray (&Type, GetSpanSize (S));
+ SB_AppendChar (&Type, GT_PTR);
+ SetSpanType (S, &Type);
+
+ /* Free the type string */
+ SB_Done (&Type);
}
static void DoByte (void)
/* Define bytes */
{
+ /* Record type information */
+ Span* S = OpenSpan ();
+ StrBuf Type = STATIC_STRBUF_INITIALIZER;
+
+ /* Parse arguments */
while (1) {
if (CurTok.Tok == TOK_STRCON) {
/* A string, translate into target charset and emit */
}
}
}
+
+ /* Close the span, then add type information to it */
+ S = CloseSpan (S);
+ GT_AddArray (&Type, GetSpanSize (S));
+ SB_AppendChar (&Type, GT_BYTE);
+ SetSpanType (S, &Type);
+
+ /* Free the type string */
+ SB_Done (&Type);
}
static void DoDByt (void)
/* Output double bytes */
{
+ /* Record type information */
+ Span* S = OpenSpan ();
+ StrBuf Type = STATIC_STRBUF_INITIALIZER;
+
+ /* Parse arguments */
while (1) {
EmitWord (GenSwapExpr (Expression ()));
if (CurTok.Tok != TOK_COMMA) {
NextTok ();
}
}
+
+ /* Close the span, then add type information to it */
+ S = CloseSpan (S);
+ GT_AddArray (&Type, GetSpanSize (S));
+ SB_AppendChar (&Type, GT_DBYTE);
+ SetSpanType (S, &Type);
+
+ /* Free the type string */
+ SB_Done (&Type);
}
static void DoFarAddr (void)
/* Define far addresses (24 bit) */
{
+ /* Record type information */
+ Span* S = OpenSpan ();
+ StrBuf Type = STATIC_STRBUF_INITIALIZER;
+
+ /* Parse arguments */
while (1) {
EmitFarAddr (Expression ());
if (CurTok.Tok != TOK_COMMA) {
NextTok ();
}
}
+
+ /* Close the span, then add type information to it */
+ S = CloseSpan (S);
+ GT_AddArray (&Type, GetSpanSize (S));
+ SB_AppendChar (&Type, GT_FAR_PTR);
+ SetSpanType (S, &Type);
+
+ /* Free the type string */
+ SB_Done (&Type);
}
static void DoWord (void)
/* Define words */
{
+ /* Record type information */
+ Span* S = OpenSpan ();
+ StrBuf Type = STATIC_STRBUF_INITIALIZER;
+
+ /* Parse arguments */
while (1) {
EmitWord (Expression ());
if (CurTok.Tok != TOK_COMMA) {
NextTok ();
}
}
+
+ /* Close the span, then add type information to it */
+ S = CloseSpan (S);
+ GT_AddArray (&Type, GetSpanSize (S));
+ SB_AppendChar (&Type, GT_WORD);
+ SetSpanType (S, &Type);
+
+ /* Free the type string */
+ SB_Done (&Type);
}