OSDN Git Service

fig's LIT8 was not sign-extending. EXEC pops from parameter stack.
authorJoel Matthew Rees <joel.rees@gmail.com>
Sun, 5 Feb 2023 06:45:56 +0000 (15:45 +0900)
committerJoel Matthew Rees <joel.rees@gmail.com>
Sun, 5 Feb 2023 06:45:56 +0000 (15:45 +0900)
FIG68K.S

index a91c5e3..51df166 100644 (file)
--- a/FIG68K.S
+++ b/FIG68K.S
@@ -553,12 +553,12 @@ LIT       DC.L    *+NATWID        ; Note also that LIT is meaningless in native code.
        EVEN\r
        DC.B    0\r
        DC.B    $85\r
-       DC.B    'LIT1'  ; 'LIT16' :     NOTE: this is different from LITERAL\r
+       DC.B    'LIT1'  ; 'LIT16'       ; half a LIT\r
        DC.B    '6'|$80\r
        DC.L    LIT-4-NATWID\r
-LIT16  DC.L    *+NATWID         (this was an invisible word, with no header)\r
+LIT16  DC.L    *+NATWID        ; (this was an invisible word, with no header)\r
+       CLR.L   D0              ; The fig model does not sign extend.\r
        MOVE.W  (IP)+,D0\r
-       EXT.W   D0\r
        BRA.W   PUSHD0\r
 \r
 *\r
@@ -573,7 +573,7 @@ LIT16       DC.L    *+NATWID         (this was an invisible word, with no header)
        DC.B    'E'|$80 ; $C5\r
        DC.L    LIT16-6-NATWID\r
 EXEC   DC.L    *+NATWID\r
-       MOVE.L  (IP)+,W\r
+       MOVE.L  (PSP)+,W        ; not IP, not RP, PSP, what was I thinking?\r
        BRA.W   NEXT3\r
 *\r
 * ######>> screen 15 <<\r
@@ -1781,6 +1781,10 @@ DOCOL:
 * Build test lists here:\r
 TESTNEXT:\r
        DC.L    LIT,$FEEDBEEF\r
+       DC.L    LIT16\r
+       DC.W    $FF0F\r
+       DC.L    LIT,AND\r
+       DC.L    EXEC\r
        DC.L    BRAN\r
        DC.L    TESTNEXT-*-NATWID\r
        \r