]> git.sur5r.net Git - cc65/blobdiff - src/ca65/objcode.c
Finished implemenation of commands to delete macros. Added the new commands to
[cc65] / src / ca65 / objcode.c
index 35d4dd841697fdf75e432b2ebf45bc9cb5a01321..f9032a0764d4fc525d6061bb483943eea3644e30 100644 (file)
@@ -6,8 +6,8 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2003 Ullrich von Bassewitz                                       */
-/*               Römerstraße 52                                              */
+/* (C) 1998-2008 Ullrich von Bassewitz                                       */
+/*               Roemerstrasse 52                                            */
 /*               D-70794 Filderstadt                                         */
 /* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
@@ -86,16 +86,6 @@ void Emit3 (unsigned char OPC, ExprNode* Expr)
 
 
 
-void Emit3b (unsigned char OPC, ExprNode* Expr, ExprNode* Bank)
-/* Emit an instruction with a three byte argument and separate bank */
-{
-    Emit0 (OPC);
-    EmitWord (Expr);
-    EmitByte (Bank);
-}
-
-
-
 void EmitSigned (ExprNode* Expr, unsigned Size)
 /* Emit a signed expression with the given size */
 {
@@ -114,15 +104,18 @@ void EmitPCRel (unsigned char OPC, ExprNode* Expr, unsigned Size)
 
 
 
-void EmitData (const unsigned char* Data, unsigned Size)
+void EmitData (const void* D, unsigned Size)
 /* Emit data into the current segment */
 {
+    /* Make a useful pointer from Data */
+    const unsigned char* Data = D;
+
     /* Create lots of fragments for the data */
     while (Size) {
-       Fragment* F;
+       Fragment* F;
 
-       /* Determine the length of the next fragment */
-       unsigned Len = Size;
+       /* Determine the length of the next fragment */
+       unsigned Len = Size;
                if (Len > sizeof (F->V.Data)) {
            Len = sizeof (F->V.Data);
                }
@@ -142,6 +135,15 @@ void EmitData (const unsigned char* Data, unsigned Size)
 
 
 
+void EmitStrBuf (const StrBuf* Data)
+/* Emit a string into the current segment */
+{
+    /* Use EmitData to output the data */
+    EmitData (SB_GetConstBuf (Data), SB_GetLen (Data));
+}
+
+
+
 void EmitByte (ExprNode* Expr)
 /* Emit one byte */
 {