]> git.sur5r.net Git - cc65/commitdiff
Followed discussions in the Pull reequest #681.
authorAIDA Shinra <shinra@j10n.org>
Mon, 11 Jun 2018 15:18:11 +0000 (00:18 +0900)
committerAIDA Shinra <shinra@j10n.org>
Mon, 11 Jun 2018 15:18:11 +0000 (00:18 +0900)
In particular, renamed "virtual operands" to "inline parameters".

doc/da65.sgml
src/da65/handler.c
src/da65/handler.h
src/da65/infofile.c
src/da65/scanner.h

index c2d87ac928b5c30270cd987a028a00cad1407825..15ce7c424489da6f7438e5f27c13ec10fedd7357 100644 (file)
@@ -542,16 +542,16 @@ code. The following attributes are recognized:
   range, where <tt/label/ is the label name given with the <tt/NAME/
   attribute, and <tt/offs/ is the offset within the data.
 
-  <tag><tt>VOPERAND</tt></tag>
+  <tag><tt>PARAMSIZE</tt></tag>
   This optional attribute is followed by a numerical value. It tells the
-  assembler that subroutine calls to this label follow "virtual operands"
+  assembler that subroutine calls to this label follow "inline parameters"
   of the given bytes like this:
 
 <tscreen><verb>
-               JSR     LabelWith2BytesOfVoperand
-       .byte   $00, $10    ; virtual operands
-       ; return here
-       BIT     $0F
+        JSR     LabelWithParamSize2
+        .byte   $00, $10
+        (return here)
+        code...
 </verb></tscreen>
 
 </descrip>
index 19b8946de6aadfa795d4a0ec2cc7abf22e562164..a5adb413e2e279f3641a71e224db9ef677f6b024 100644 (file)
@@ -51,7 +51,7 @@
 
 
 
-static unsigned short SubroutineVOperandSize[0x10000];
+static unsigned short SubroutineParamSize[0x10000];
 
 /*****************************************************************************/
 /*                             Helper functions                              */
@@ -748,18 +748,22 @@ void OH_JmpAbsoluteXIndirect (const OpcDesc* D)
 
 void OH_JsrAbsolute (const OpcDesc* D)
 {
-    unsigned VOperandSize = SubroutineVOperandSize[GetCodeWord(PC+1)];
+    unsigned ParamSize = SubroutineParamSize[GetCodeWord(PC+1)];
     OH_Absolute (D);
-    if (VOperandSize > 0) {
+    if (ParamSize > 0) {
         unsigned RemainingBytes;
+       unsigned BytesLeft;
         PC += D->Size;
         RemainingBytes = GetRemainingBytes();
-        if (RemainingBytes < VOperandSize) {
-            VOperandSize = RemainingBytes;
+        if (RemainingBytes < ParamSize) {
+            ParamSize = RemainingBytes;
         }
-        if (VOperandSize > 0) {
-            DataByteLine (VOperandSize); /* FIXME: follow BytesPerLine */
-            PC += VOperandSize;
+        BytesLeft = ParamSize;
+        while (BytesLeft > 0) {
+            unsigned Chunk = (BytesLeft > BytesPerLine)? BytesPerLine : BytesLeft;
+            DataByteLine (Chunk);
+            BytesLeft -= Chunk;
+            PC        += Chunk;
         }
         PC -= D->Size;
     }
@@ -767,7 +771,7 @@ void OH_JsrAbsolute (const OpcDesc* D)
 
 
 
-void SetSubroutineVOperand (unsigned Addr, unsigned Size)
+void SetSubroutineParamSize (unsigned Addr, unsigned Size)
 {
-    SubroutineVOperandSize[Addr] = Size;
+    SubroutineParamSize[Addr] = Size;
 }
index 96b73f2c74b9a0eabc3cc812177bfaed6465a2bc..eaa66e7fd896410dd9e602a417670c6268f145e6 100644 (file)
@@ -106,7 +106,7 @@ void OH_JmpAbsoluteIndirect (const OpcDesc* D);
 void OH_JmpAbsoluteXIndirect (const OpcDesc* D);
 void OH_JsrAbsolute (const OpcDesc*);
 
-void SetSubroutineVOperand (unsigned Addr, unsigned Size);
+void SetSubroutineParamSize (unsigned Addr, unsigned Size);
 
 
 /* End of handler.h */
index 3bfa15f51bbde17a8fdd010516d422731d393aaf..c5040e82a12d483ad7661e8983067977f61e83d8 100644 (file)
@@ -381,7 +381,7 @@ static void LabelSection (void)
         {   "ADDR",     INFOTOK_ADDR    },
         {   "NAME",     INFOTOK_NAME    },
         {   "SIZE",     INFOTOK_SIZE    },
-        {   "VOPERAND", INFOTOK_VOPERAND },
+        {   "PARAMSIZE", INFOTOK_PARAMSIZE },
     };
 
     /* Locals - initialize to avoid gcc warnings */
@@ -389,7 +389,7 @@ static void LabelSection (void)
     char* Comment = 0;
     long Value    = -1;
     long Size     = -1;
-    long VOperand = -1;
+    long ParamSize = -1;
 
     /* Skip the token */
     InfoNextTok ();
@@ -451,14 +451,14 @@ static void LabelSection (void)
                 InfoNextTok ();
                 break;
 
-            case INFOTOK_VOPERAND:
+            case INFOTOK_PARAMSIZE:
                 InfoNextTok ();
-                if (VOperand >= 0) {
-                    InfoError ("VOperand already given");
+                if (ParamSize >= 0) {
+                    InfoError ("ParamSize already given");
                 }
                 InfoAssureInt ();
                 InfoRangeCheck (1, 0x10000);
-                VOperand = InfoIVal;
+                ParamSize = InfoIVal;
                 InfoNextTok ();
                 break;
 
@@ -498,8 +498,8 @@ static void LabelSection (void)
     } else {
         AddExtLabelRange ((unsigned) Value, Name, Size);
     }
-    if (VOperand >= 0) {
-        SetSubroutineVOperand ((unsigned) Value, (unsigned) VOperand);
+    if (ParamSize >= 0) {
+        SetSubroutineParamSize ((unsigned) Value, (unsigned) ParamSize);
     }
 
     /* Define the comment */
index 14a3ef679c58fa4e3962bf138f56231c74df9734..d4e38177b3e77a17131b10260211cf02b536292c 100644 (file)
@@ -105,7 +105,7 @@ typedef enum token_t {
     INFOTOK_COMMENT,
     INFOTOK_ADDR,
     INFOTOK_SIZE,
-    INFOTOK_VOPERAND,
+    INFOTOK_PARAMSIZE,
 
     /* ASMINC section */
     INFOTOK_FILE,