1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-04-05 03:37:43 +00:00

Save a couple bytes and sync label names

This commit is contained in:
David Schmenk 2018-02-17 10:34:09 -08:00
parent f266f1c035
commit efe08f8ea7
5 changed files with 37 additions and 39 deletions

View File

@ -38,7 +38,7 @@ predef execmod(modfile)#1
//
// Exported CMDSYS table
//
word version = $0100 // 01.00
word version = $0101 // 01.01
word syspath
word syscmdln
word = @execmod

View File

@ -64,7 +64,7 @@ MUL STY IPY
LDA #$00
STA ESTKL+1,X ; PRODL
; STA ESTKH+1,X ; PRODH
MULLP LSR TMPH ; MULTPLRH
_MULLP LSR TMPH ; MULTPLRH
ROR TMPL ; MULTPLRL
BCS +
STA ESTKH+1,X ; PRODH
@ -76,7 +76,7 @@ MULLP LSR TMPH ; MULTPLRH
+ ASL ESTKL,X ; MULTPLNDL
ROL ESTKH,X ; MULTPLNDH
DEY
BNE MULLP
BNE _MULLP
STA ESTKH+1,X ; PRODH
LDY IPY
JMP DROP

View File

@ -457,7 +457,7 @@ MUL STY IPY
LDA #$00
STA ESTKL+1,X ; PRODL
; STA ESTKH+1,X ; PRODH
MULLP LSR TMPH ; MULTPLRH
_MULLP LSR TMPH ; MULTPLRH
ROR TMPL ; MULTPLRL
BCS +
STA ESTKH+1,X ; PRODH
@ -469,7 +469,7 @@ MULLP LSR TMPH ; MULTPLRH
+ ASL ESTKL,X ; MULTPLNDL
ROL ESTKH,X ; MULTPLNDH
DEY
BNE MULLP
BNE _MULLP
STA ESTKH+1,X ; PRODH
LDY IPY
JMP DROP
@ -1161,7 +1161,7 @@ SAW INY ;+INC_IP
LDY IPY
BMI +
JMP DROP
+ JMP FIXDROP
+ JMP FIXDROP
;*
;* STORE VALUE TO ABSOLUTE ADDRESS WITHOUT POPPING STACK
;*

View File

@ -135,6 +135,18 @@ PAGE0 = *
VMCORE = *
!PSEUDOPC $A000 {
;*
;* OPCODE TABLE
;*
!ALIGN 255,0
OPTBL !WORD ZERO,ADD,SUB,MUL,DIV,MOD,INCR,DECR ; 00 02 04 06 08 0A 0C 0E
!WORD NEG,COMP,BAND,IOR,XOR,SHL,SHR,IDXW ; 10 12 14 16 18 1A 1C 1E
!WORD LNOT,LOR,LAND,LA,LLA,CB,CW,CS ; 20 22 24 26 28 2A 2C 2E
!WORD DROP,DUP,NEXTOP,DIVMOD,BRGT,BRLT,BREQ,BRNE ; 30 32 34 36 38 3A 3C 3E
!WORD ISEQ,ISNE,ISGT,ISLT,ISGE,ISLE,BRFLS,BRTRU ; 40 42 44 46 48 4A 4C 4E
!WORD BRNCH,IBRNCH,CALL,ICAL,ENTER,LEAVE,RET,CFFB ; 50 52 54 56 58 5A 5C 5E
!WORD LB,LW,LLB,LLW,LAB,LAW,DLB,DLW ; 60 62 64 66 68 6A 6C 6E
!WORD SB,SW,SLB,SLW,SAB,SAW,DAB,DAW ; 70 72 74 76 78 7A 7C 7E
;*
;* SYSTEM INTERPRETER ENTRYPOINT
;*
INTERP PLA
@ -220,33 +232,6 @@ _DIVEX INX
LDY IPY
RTS
;*
;* INCREMENT TOS
;*
INCR INC ESTKL,X
BNE +
INC ESTKH,X
+ JMP NEXTOP
;*
;* DECREMENT TOS
;*
DECR LDA ESTKL,X
BNE +
DEC ESTKH,X
+ DEC ESTKL,X
JMP NEXTOP
;*
;* OPCODE TABLE
;*
!ALIGN 255,0
OPTBL !WORD ZERO,ADD,SUB,MUL,DIV,MOD,INCR,DECR ; 00 02 04 06 08 0A 0C 0E
!WORD NEG,COMP,BAND,IOR,XOR,SHL,SHR,IDXW ; 10 12 14 16 18 1A 1C 1E
!WORD LNOT,LOR,LAND,LA,LLA,CB,CW,CS ; 20 22 24 26 28 2A 2C 2E
!WORD DROP,DUP,NEXTOP,DIVMOD,BRGT,BRLT,BREQ,BRNE ; 30 32 34 36 38 3A 3C 3E
!WORD ISEQ,ISNE,ISGT,ISLT,ISGE,ISLE,BRFLS,BRTRU ; 40 42 44 46 48 4A 4C 4E
!WORD BRNCH,IBRNCH,CALL,ICAL,ENTER,LEAVE,RET,CFFB ; 50 52 54 56 58 5A 5C 5E
!WORD LB,LW,LLB,LLW,LAB,LAW,DLB,DLW ; 60 62 64 66 68 6A 6C 6E
!WORD SB,SW,SLB,SLW,SAB,SAW,DAB,DAW ; 70 72 74 76 78 7A 7C 7E
;*
;* MUL TOS-1 BY TOS
;*
MUL STY IPY
@ -260,7 +245,7 @@ MUL STY IPY
LDA #$00
STA ESTKL+1,X ; PRODL
; STA ESTKH+1,X ; PRODH
MULLP LSR TMPH ; MULTPLRH
_MULLP LSR TMPH ; MULTPLRH
ROR TMPL ; MULTPLRL
BCS +
STA ESTKH+1,X ; PRODH
@ -272,7 +257,7 @@ MULLP LSR TMPH ; MULTPLRH
+ ASL ESTKL,X ; MULTPLNDL
ROL ESTKH,X ; MULTPLNDH
DEY
BNE MULLP
BNE _MULLP
STA ESTKH+1,X ; PRODH
LDY IPY
JMP DROP
@ -315,6 +300,21 @@ DIVMOD JSR _DIV
BMI NEG
JMP NEXTOP
;*
;* INCREMENT TOS
;*
INCR INC ESTKL,X
BNE +
INC ESTKH,X
+ JMP NEXTOP
;*
;* DECREMENT TOS
;*
DECR LDA ESTKL,X
BNE +
DEC ESTKH,X
+ DEC ESTKL,X
JMP NEXTOP
;*
;* ADD TOS TO TOS-1
;*
ADD LDA ESTKL,X

View File

@ -529,12 +529,12 @@ MUL LDX #$10
EOR #$FFFF
STA TMP
LDA #$0000
MULLP ASL
_MULLP ASL
ASL TMP ; MULTPLR
BCS +
ADC TOS,S ; MULTPLD
+ DEX
BNE MULLP
BNE _MULLP
STA NOS,S ; PROD
JMP DROP
;*
@ -1006,7 +1006,6 @@ SLB INY ;+INC_IP
TXY
BMI +
JMP NEXTOP
+ JMP FIXNEXT
SLW INY ;+INC_IP
LDA (IP),Y
TYX
@ -1051,7 +1050,6 @@ SAB INY ;+INC_IP
INY
BMI +
JMP NEXTOP
+ JMP FIXNEXT
SAW INY ;+INC_IP
LDA (IP),Y
STA TMP