1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2026-03-12 16:42:08 +00:00

15 Commits
v2.1 ... v2.11

Author SHA1 Message Date
David Schmenk
5eefe74c6b Update 2.11 2024-02-25 09:59:37 -08:00
David Schmenk
15b14899f4 Add link to assembly toolkit 2024-02-25 09:52:49 -08:00
David Schmenk
d5803ceba9 2.11 Update 2024-02-25 09:50:47 -08:00
David Schmenk
34624f3162 Release 2.11 2024-02-25 09:47:02 -08:00
David Schmenk
b1d463f4e4 Update images to 2.11 2024-02-25 09:16:43 -08:00
David Schmenk
d3b9fe14a0 Add new ASM build tools/files 2024-02-24 11:25:07 -08:00
David Schmenk
6efc2b1a98 Update module loader to handle 8 bit fixups generated by EDASM 2024-02-24 11:13:46 -08:00
David Schmenk
a89b1b9b40 Add EDASM sample code 2024-02-23 17:06:41 -08:00
David Schmenk
9038c7e649 Update Version 2.1.md 2024-02-18 13:37:47 -08:00
David Schmenk
f5c562eafb Clean up dhgrPlot 2024-02-18 09:56:33 -08:00
David Schmenk
2f7c1b3e59 First pass at DHGR toolkit 2024-02-17 18:48:03 -08:00
David Schmenk
631034034c Start DHGR TOOLKIT 2024-02-17 12:12:03 -08:00
David Schmenk
c64843b1e1 Update README.md 2024-02-15 13:46:05 -08:00
David Schmenk
88960e6745 Update README.md 2024-02-15 13:32:51 -08:00
David Schmenk
b4ab21f80c Update README.md 2024-02-15 13:29:11 -08:00
27 changed files with 507 additions and 92 deletions

View File

@@ -1,21 +1,10 @@
# 2/15/2024 PLASMA 2.1 Available!
# 2/25/2024 PLASMA 2.11 Available!
[Download and read the Release Notes](https://github.com/dschmenk/PLASMA/blob/master/doc/Version%202.1.md)
[Change List](https://github.com/dschmenk/PLASMA/blob/master/doc/Version%202.1.md#changes-in-plasma-for-21-release)
[Get single boot floppy for FORTH for PLASMA 2.1](https://github.com/dschmenk/PLASMA/blob/master/doc/PLFORTH.md)
# 3/24/2023 PLASMA 2.0 Available!
Only 5 years in the making!
[Download and read the Release Notes](https://github.com/dschmenk/PLASMA/blob/master/doc/Version%202.0.md)
[Change List](https://github.com/dschmenk/PLASMA/blob/master/doc/Version%202.0.md#changes-in-plasma-for-20-release)
# 4/29/2018 PLASMA 1.2 Available!
[Download and read the Release Notes](https://github.com/dschmenk/PLASMA/blob/master/doc/Version%201.2.md)
[Get single boot floppy of FORTH for PLASMA 2.11](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLFORTH.PO)
# The PLASMA Programming Language
@@ -34,8 +23,6 @@ Different projects have led to the architecture of PLASMA, most notably Apple Pa
<!-- TOC depthFrom:1 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->
- [3/24/2023 PLASMA 2.0 Available!](#3242023-plasma-20-available)
- [4/29/2018 PLASMA 1.2 Available!](#4292018-plasma-12-available)
- [The PLASMA Programming Language](#the-plasma-programming-language)
- [Contents](#contents)
- [Build Environment](#build-environment)

View File

@@ -1,28 +1,30 @@
# PLASMA Version 2.1
# PLASMA Version 2.11
Welcome to PLASMA: the Grand Unifying Platform for the Apple 1, ][, and ///.
Download the five disk images:
Download the disk images:
[PLASMA 2.1 800K Full System](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1.2mg?raw=true)
[PLASMA 2.11 800K Full System](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1.2mg?raw=true)
[PLASMA 2.1 ProDOS Boot & Install](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-INST.po?raw=true)
[PLASMA 2.11 ProDOS Boot & Install](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-INST.po?raw=true)
[PLASMA 2.1 System Libraries](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-SYS.po?raw=true)
[PLASMA 2.1 Build Tools](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-BLD.po?raw=true)
[PLASMA 2.11 Build Tools](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-BLD.po?raw=true)
[PLASMA 2.1 Demos](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-DEMOS.po?raw=true)
[PLASMA 2.1 TCP/IP network modules](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-INET.po?raw=true)
[PLASMA 2.1 Apple /// SOS and SANE floating point modules](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-FPSOS.po?raw=true)
[PLASMA 2.11 Apple /// SOS and SANE floating point modules](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-FPSOS.po?raw=true)
[PLASMA 2.1 Apple /// SOS Mame Boot](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA2-A3MAME.PO?raw=true)
[PLASMA 2.11 Apple /// SOS Mame Boot](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA2-A3MAME.PO?raw=true)
[PLASMA 2.1 Apple /// Mame hard disk image](https://github.com/dschmenk/PLASMA/blob/master/images/apple/apple3.hd?raw=true)
[PLASMA 2.11 Apple /// Mame hard disk image](https://github.com/dschmenk/PLASMA/blob/master/images/apple/apple3.hd?raw=true)
[PLASMA 2.1 PLFORTH stand-alone boot](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLFORTH.PO?raw=true)
[PLASMA 2.11 PLFORTH stand-alone boot](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLFORTH.PO?raw=true)
[PLASMA 2.11 Assembly Language Toolkit](https://github.com/dschmenk/PLASMA/blob/master/images/apple/ASM-TK.po?raw=true)
PLASMA now has a ProDOS hard disk install script. Mass storage is the recommended installation that looks like (replacing HARDISK with your volume name of choice) if you want to copy files yourself:
@@ -128,6 +130,10 @@ There is a [YouTube playlist](https://www.youtube.com/playlist?list=PLlPKgUMQbJ7
- The documentation is sparse and incomplete. Yep, could use your help...
# Changes in PLASMA for 2.11 Release
1. Minor update to load modules generated by EDASM with 8 bit fixups
# Changes in PLASMA for 2.1 Release
1. Lots of small bug fixes in floating point, file copy and graphics libraries

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

BIN
images/apple/ASM-TK.po Executable file

Binary file not shown.

BIN
images/apple/DHGR-TK.po Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,185 @@
include "inc/cmdsys.plh"
sysflags restxt1|reshgr1|resxhgr1
//
// Apple II graphics soft switches
//
const store80dis = $C000
const store80ena = $C001
const show40col = $C00C
const show80col = $C00D
const showgraphics = $C050
const showtext = $C051
const showfull = $C052
const showmix = $C053
const page1m = $C054
const page1x = $C055
const showhires = $C057
const dhresena = $C05E
const dhresdis = $C05F
const IOUdis = $C07E
const IOUena = $C07F
//
// HiRes scanline addresses
//
word hgrscan[] = $2000,$2400,$2800,$2C00,$3000,$3400,$3800,$3C00
word = $2080,$2480,$2880,$2C80,$3080,$3480,$3880,$3C80
word = $2100,$2500,$2900,$2D00,$3100,$3500,$3900,$3D00
word = $2180,$2580,$2980,$2D80,$3180,$3580,$3980,$3D80
word = $2200,$2600,$2A00,$2E00,$3200,$3600,$3A00,$3E00
word = $2280,$2680,$2A80,$2E80,$3280,$3680,$3A80,$3E80
word = $2300,$2700,$2B00,$2F00,$3300,$3700,$3B00,$3F00
word = $2380,$2780,$2B80,$2F80,$3380,$3780,$3B80,$3F80
word = $2028,$2428,$2828,$2C28,$3028,$3428,$3828,$3C28
word = $20A8,$24A8,$28A8,$2CA8,$30A8,$34A8,$38A8,$3CA8
word = $2128,$2528,$2928,$2D28,$3128,$3528,$3928,$3D28
word = $21A8,$25A8,$29A8,$2DA8,$31A8,$35A8,$39A8,$3DA8
word = $2228,$2628,$2A28,$2E28,$3228,$3628,$3A28,$3E28
word = $22A8,$26A8,$2AA8,$2EA8,$32A8,$36A8,$3AA8,$3EA8
word = $2328,$2728,$2B28,$2F28,$3328,$3728,$3B28,$3F28
word = $23A8,$27A8,$2BA8,$2FA8,$33A8,$37A8,$3BA8,$3FA8
word = $2050,$2450,$2850,$2C50,$3050,$3450,$3850,$3C50
word = $20D0,$24D0,$28D0,$2CD0,$30D0,$34D0,$38D0,$3CD0
word = $2150,$2550,$2950,$2D50,$3150,$3550,$3950,$3D50
word = $21D0,$25D0,$29D0,$2DD0,$31D0,$35D0,$39D0,$3DD0
word = $2250,$2650,$2A50,$2E50,$3250,$3650,$3A50,$3E50
word = $22D0,$26D0,$2AD0,$2ED0,$32D0,$36D0,$3AD0,$3ED0
word = $2350,$2750,$2B50,$2F50,$3350,$3750,$3B50,$3F50
word = $23D0,$27D0,$2BD0,$2FD0,$33D0,$37D0,$3BD0,$3FD0
//
// Pixel masks for 7 contiguous pixels
// AUXL AUXH MEML MEMH
byte masks[] = $0F, $00, $00, $00
byte = $70, $00, $01, $00
byte = $00, $00, $1E ,$00
byte = $00, $03, $60, $00
byte = $00, $3C, $00, $00
byte = $00, $40, $00, $07
byte = $00, $00, $00, $78
//
// Solid colors
// AUXL AUXH MEML MEMH
byte colors[] = $00, $00, $00, $00 // black
byte = $08, $22, $11, $44 // magenta
byte = $44, $11, $08, $22 // brown
byte = $4C, $33, $19, $66 // orange
byte = $22, $08, $44, $11 // dark green
byte = $2A, $2A, $55, $55 // gray 1
byte = $66, $19, $4C, $33 // green
byte = $6E, $3B, $5D, $77 // yellow
byte = $11, $44, $22, $08 // dark blue
byte = $19, $66, $33, $4C // purple
byte = $55, $55, $2A, $2A // gray 2
byte = $5D, $77, $3B, $6E // pink
byte = $33, $4C, $66, $19 // medium blue
byte = $3B, $6E, $77, $5D // light blue
byte = $77, $5D, $6E, $3B // aqua
byte = $7F, $7F, $7F, $7F // white
word clr = @colors
//
// Modulo 7
//
byte mod7[] = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
byte = 0, 1, 2, 3, 4, 5, 6
//
// Divide 7
//
byte div7[] = 0, 0, 0, 0, 0, 0, 0
byte = 1, 1, 1, 1, 1, 1, 1
byte = 2, 2, 2, 2, 2, 2, 2
byte = 3, 3, 3, 3, 3, 3, 3
byte = 4, 4, 4, 4, 4, 4, 4
byte = 5, 5, 5, 5, 5, 5, 5
byte = 6, 6, 6, 6, 6, 6, 6
byte = 7, 7, 7, 7, 7, 7, 7
byte = 8, 8, 8, 8, 8, 8, 8
byte = 9, 9, 9, 9, 9, 9, 9
byte =10,10,10,10,10,10,10
byte =11,11,11,11,11,11,11
byte =12,12,12,12,12,12,12
byte =13,13,13,13,13,13,13
byte =14,14,14,14,14,14,14
byte =15,15,15,15,15,15,15
byte =16,16,16,16,16,16,16
byte =17,17,17,17,17,17,17
byte =18,18,18,18,18,18,18
byte =19,19,19,19,19,19,19
def dhgrcolor(c)#0
clr = @colors + ((c & $0F) << 2)
end
def dhgrplot(x, y)#0
word pixaddr, maskblk, mask
pixaddr = hgrscan[y] + div7[x] * 2
maskblk = @masks + mod7[x] * 4
mask = *maskblk
if mask
^page1x
*pixaddr = (*pixaddr & ~mask) | (mask & *clr)
fin
mask = *(maskblk + 2)
if mask
^page1m
*pixaddr = (*pixaddr & ~mask) | (mask & *(clr + 2))
fin
end
def dhgrmode(mode)
if mode == 0
^page1m
^showfull
^showhires
^showgraphics
^IOUdis = 0
^show80col = 0
^dhresena
^store80ena = 0
^page1m
memset($2000, 0, $2000)
^page1x
memset($2000, 0, $2000)
else
^store80dis = 0
^dhresdis
^show40col = 0
^showtext
^page1m
fin
return mode
end
def dhgrtest#0
byte i
dhgrcolor(15)
for i = 0 to 139
dhgrplot(i, i)
next
while ^$C000 < 128
loop
^$C010
end
dhgrmode(0)
dhgrtest
dhgrmode(-1)
done

View File

@@ -60,6 +60,7 @@ DHCP = rel/DHCP\#FE1000
HTTPD = rel/HTTPD\#FE1000
TFTPD = rel/TFTPD\#FE1000
HGRLIB = rel/apple/HGRLIB\#FE1000
DHGRLIB = rel/apple/DHGRLIB\#FE1000
GRLIB = rel/apple/GRLIB\#FE1000
DGRLIB = rel/apple/DGRLIB\#FE1000
HGRSPRITE = rel/apple/HGRSPRITE\#FE1000
@@ -114,7 +115,7 @@ TXTTYPE = .TXT
#SYSTYPE = \#FF2000
#TXTTYPE = \#040000
apple: $(PLVMZP_APL) $(PLASM) $(PLVM) $(PLVM01) $(PLVM02) $(PLVMJIT) $(PLVM802) $(PLVM03) $(PLVMJIT03) $(CMD) $(CMDJIT) $(JIT) $(JIT16) $(JITUNE) $(SOSCMD) $(SOSCMDJIT) $(PLASMAPLASM) $(CODEOPT) $(PLFORTH) $(HRFORTH) $(HR2FORTH) $(TX2FORTH) $(ZIPCHIP) $(MATCHFILES) $(ARGS) $(MEMMGR) $(MEMTEST) $(FIBER) $(FIBERTEST) $(LONGJMP) $(ED) $(MON) $(COPY) $(DEL) $(REN) $(CAT) $(NEWDIR) $(TYPE) $(SOS) $(ROD) $(SIEVE) $(PRIMEGAP) $(MOUSE) $(UTHERNET2) $(UTHERNET) $(ETHERIP) $(INET) $(DHCP) $(HTTPD) $(TFTPD) $(ROGUE) $(ROGUEMAP) $(ROGUECOMBAT) $(SFM) $(SFMSPRT) $(GRAFIX) $(GFXDEMO) $(LINES) $(HGRTILE) $(HGRFONT) $(HGRSPRITE) $(HGRLIB) $(TILETEST) $(HGRTEST) $(GRLIB) $(DGRLIB) $(GRTEST) $(DGRTEST) $(HGRTEST) $(FILEIO_APL) $(CONIO_APL) $(JOYBUZZ) $(PORTIO) $(SPIPORT) $(SDFAT) $(FATCAT) $(FATGET) $(FATPUT) $(FATWDSK) $(FATRDSK) $(INT32) $(INT32TEST) $(SANE) $(FPSTR) $(FPU) $(SANITY) $(LZ4) $(LZ4CAT) $(RPNCALC) $(SNDSEQ) $(PLAYSEQ) $(CONIOTEST)
apple: $(PLVMZP_APL) $(PLASM) $(PLVM) $(PLVM01) $(PLVM02) $(PLVMJIT) $(PLVM802) $(PLVM03) $(PLVMJIT03) $(CMD) $(CMDJIT) $(JIT) $(JIT16) $(JITUNE) $(SOSCMD) $(SOSCMDJIT) $(PLASMAPLASM) $(CODEOPT) $(PLFORTH) $(HRFORTH) $(HR2FORTH) $(TX2FORTH) $(ZIPCHIP) $(MATCHFILES) $(ARGS) $(MEMMGR) $(MEMTEST) $(FIBER) $(FIBERTEST) $(LONGJMP) $(ED) $(MON) $(COPY) $(DEL) $(REN) $(CAT) $(NEWDIR) $(TYPE) $(SOS) $(ROD) $(SIEVE) $(PRIMEGAP) $(MOUSE) $(UTHERNET2) $(UTHERNET) $(ETHERIP) $(INET) $(DHCP) $(HTTPD) $(TFTPD) $(ROGUE) $(ROGUEMAP) $(ROGUECOMBAT) $(SFM) $(SFMSPRT) $(GRAFIX) $(GFXDEMO) $(LINES) $(HGRTILE) $(HGRFONT) $(HGRSPRITE) $(HGRLIB) $(TILETEST) $(HGRTEST) $(DHGRLIB) $(GRLIB) $(DGRLIB) $(GRTEST) $(DGRTEST) $(HGRTEST) $(FILEIO_APL) $(CONIO_APL) $(JOYBUZZ) $(PORTIO) $(SPIPORT) $(SDFAT) $(FATCAT) $(FATGET) $(FATPUT) $(FATWDSK) $(FATRDSK) $(INT32) $(INT32TEST) $(SANE) $(FPSTR) $(FPU) $(SANITY) $(LZ4) $(LZ4CAT) $(RPNCALC) $(SNDSEQ) $(PLAYSEQ) $(CONIOTEST)
-rm vmsrc/plvmzp.inc
@@ -191,7 +192,7 @@ $(PLVMZP_C64): FORCE
FORCE:
vmsrc/c64/cmd.a: vmsrc/c64/cmd.pla $(PLASM)
./$(PLASM) -AOW < vmsrc/c64/cmd.pla > vmsrc/c64/cmd.a
./$(PLASM) -AOW vmsrc/c64/cmd.pla
$(PLVMC64): vmsrc/c64/plvmc64.s vmsrc/c64/cmd.a
acme -f cbm -o $(PLVMC64) -l vmsrc/c64/plvmc64.sym vmsrc/c64/plvmc64.s
@@ -465,6 +466,10 @@ $(HGRLIB): libsrc/apple/hgrlib.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/hgrlib.pla
acme --setpc 4094 -o $(HGRLIB) libsrc/apple/hgrlib.a
$(DHGRLIB): libsrc/apple/dhgrlib.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/dhgrlib.pla
acme --setpc 4094 -o $(DHGRLIB) libsrc/apple/dhgrlib.a
$(GRLIB): libsrc/apple/grlib.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/grlib.pla
acme --setpc 4094 -o $(GRLIB) libsrc/apple/grlib.a

View File

@@ -123,8 +123,12 @@ cp samplesrc/APPLE3.PIX#060000 prodos/demos/apple3/APPLE3.PIX.BIN
rm -rf prodos/bld
mkdir prodos/bld
cp rel/PLASM#FE1000 prodos/bld/PLASM.REL
cp rel/CODEOPT#FE1000 prodos/bld/CODEOPT.REL
cp rel/PLASM#FE1000 prodos/bld/PLASM.REL
cp rel/CODEOPT#FE1000 prodos/bld/CODEOPT.REL
cp ../sysfiles/EDASM#FF2000 prodos/bld/EDASM.SYS
cp ../sysfiles/EDASM.ASM#063000 prodos/bld/EDASM.ASM.BIN
cp ../sysfiles/EDASM.ED#063000 prodos/bld/EDASM.ED.BIN
cp ../sysfiles/EDASM.SWAP#062000 prodos/bld/EDASM.SWAP.BIN
mkdir prodos/bld/samples
cp samplesrc/hello.pla prodos/bld/samples/HELLO.PLA.TXT
@@ -152,6 +156,11 @@ cp samplesrc/fppow.pla prodos/bld/samples/FPPOW.PLA.TXT
cp utilsrc/apple/mon.pla prodos/bld/samples/MON.PLA.TXT
cp utilsrc/apple/zipchip.pla prodos/bld/samples/ZIPCHIP.PLA.TXT
cp libsrc/apple/dhgrlib.pla prodos/bld/samples/DHGR.PLA.TXT
cp samplesrc/testrel.asm prodos/bld/samples/TESTREL.ASM.TXT
cp samplesrc/testext.asm prodos/bld/samples/TESTEXT.ASM.TXT
cp samplesrc/testasm.pla prodos/bld/samples/TESTASM.PLA.TXT
mkdir prodos/bld/scripts
cp scripts/rod.4th prodos/bld/scripts/ROD.4TH.TXT
cp scripts/bounce.4th prodos/bld/scripts/BOUNCE.4TH.TXT
@@ -213,4 +222,6 @@ cp inc/spiport.plh prodos/bld/inc/SPIPORT.PLH.TXT
cp inc/testlib.plh prodos/bld/inc/TESTLIB.PLH.TXT
cp inc/grafix.plh prodos/bld/inc/GRAFIX.PLH.TXT
cp inc/lz4.plh prodos/bld/inc/LZ4.PLH.TXT
cp vmsrc/apple/plvmzp.inc prodos/bld/inc/PLVMZP.INC.TXT
cp inc/plasma.inc prodos/bld/inc/PLASMA.INC.TXT
cp inc/extheader.inc prodos/bld/inc/EXTHEADER.INC.TXT
cp inc/extdefseg.inc prodos/bld/inc/EXTDEFSEG.INC.TXT

View File

@@ -0,0 +1,7 @@
import test
predef hello#0
predef goodbye#0
end
goodbye
done

56
src/samplesrc/testext.asm Normal file
View File

@@ -0,0 +1,56 @@
;
; EXTENDED REL MODULE WITH DEPENDENCIES, BYTECODE SEGMENT, AND INIT
;
INCLUDE INC/PLASMA.INC
;
; EXTERNALS USED BY THIS MODULE
;
EXTRN PUTS
EXTRN PUTLN
;
; EXT REL HEADER
;
INCLUDE INC/EXTHEADER.INC
;
; ADD MODULE DEPENDENCIES
; (DCI BACKWARDS HI/LO BIT FROM REL FILE)
;
MSB ON
ASC "CMDSY"
MSB OFF
ASC "S"
DB 0 ; TERMINATE LIST WITH ZERO
;
; DATA AND 6502 CODE SEGMENT
;
HIMSG STR "Hello"
HELLO DEF HELLO ; CALLABLE FROM EXTERNAL MODULES
LDA #>HIMSG
LDY #<HIMSG
DEX
STA ESTKL,X
STY ESTKH,X
JSR PUTS
JMP PUTLN
BYEMSG STR "Goodbye"
GOODBYE DEF GOODBYE ; CALLABLE FROM EXTERNAL MODULES
LDA #>BYEMSG
LDY #<BYEMSG
DEX
STA ESTKL,X
STY ESTKH,X
JSR PUTS
JMP PUTLN
;
; INITIALIZE MODULE AND RETURN SUCCESS
;
INIT JSR HELLO
LDA #$00
DEX
STA ESTKL,X
STA ESTKH,X
RTS
;
; EXT REL DEFSEG
;
INCLUDE INC/EXTDEFSEG.INC

30
src/samplesrc/testrel.asm Normal file
View File

@@ -0,0 +1,30 @@
;
; SIMPLE REL FILE - NO DEPENDENCIES, NO INIT CODE
;
INCLUDE INC/PLASMA.INC
;
; EXTERNALS USED BY THIS MODULE
;
EXTRN PUTS
EXTRN PUTLN
;
; DATA AND MACHINE CODE FOR THIS REL MODULE
;
HIMSG STR "Hello"
HELLO DEF HELLO
LDA #>HIMSG
LDY #<HIMSG
DEX
STA ESTKL,X
STY ESTKH,X
JSR PUTS
JMP PUTLN
BYEMSG STR "Goodbye"
GOODBYE DEF GOODBYE
LDA #>BYEMSG
LDY #<BYEMSG
DEX
STA ESTKL,X
STY ESTKH,X
JSR PUTS
JMP PUTLN

View File

@@ -40,7 +40,7 @@ predef sext(a)#1, divmod(a,b)#2, execmod(modfile)#1, syslookuptbl(a)#1
//
// Exported CMDSYS table
//
word version = $0210 // 02.10
word version = $0211 // 02.11
word syspath
word syscmdln
word = @execmod
@@ -666,25 +666,42 @@ asm reloc(modfix, modofst, bytecode, rld)#3
LDY #$00
- LDA (SRC),Y
BEQ RLDEX ; END OF RLD
PHA
INY
LDA (SRC),Y
INY
CLC
ADC ESTKL+3,X ; ADDR=ENTRY=>1+MODFIX
STA DSTL
INY
LDA (SRC),Y
ADC ESTKH+3,X
STA DSTH
PLA
LDY #$00
LDA (SRC),Y
AND #$10 ; EXTERN REF - EXIT
BNE RLDEX
TAY ; FIXUP=*ADDR+MODOFST
LDA (SRC),Y
BMI FIX16
AND #$40
BNE FIXMSB
FIXLSB LDA (DST),Y
CLC
ADC ESTKL+2,X
CLC
BCC FIX8
FIXMSB LDY #$03
LDA (SRC),Y ; FIXUPH=(ENTRY->3+MODOFSTL)+(^ADDR+MODOFSTH)
CLC
ADC ESTKL+2,X
LDY #$00
LDA (DST),Y
INY
ADC ESTKH+2,X
CLC
BCC FIX8
FIX16 LDA (DST),Y ; FIXUP=*ADDR+MODOFST
CLC
ADC ESTKL+2,X
STA TMPL
INY
LDA (DST),Y
ADC ESTKH+2,X
CMP ESTKH+1,X ; FIXUP >= BYTECODE?
@@ -698,7 +715,7 @@ asm reloc(modfix, modofst, bytecode, rld)#3
+ STA (DST),Y ; *ADDR=FIXUP
DEY
LDA TMPL
STA (DST),Y
FIX8 STA (DST),Y
LDA SRCL ; NEXT ENTRY
; CLC
ADC #$04
@@ -741,9 +758,6 @@ asm cin()#1
STA ESTKH,X
RTS
end
def syslookuptbl(dci)#1
return lookuptbl(dci, symtbl)
end
def crout()#0
cout($0D)
end
@@ -899,6 +913,9 @@ end
//
// Symbol table routines.
//
def syslookuptbl(dci)#1
return lookuptbl(dci, symtbl)
end
def addsym(sym, addr)#0
while ^sym & $80
^lastsym = ^sym

View File

@@ -39,7 +39,7 @@ predef lookuptbl(dci)#1, execsys(sysfile)#0
//
// Exported CMDSYS table
//
word version = $0210 // 02.01 Dev
word version = $0211 // 02.11
word syspath
word syscmdln
word = @execmod, @open, @close, @read, 0
@@ -753,25 +753,42 @@ asm reloc(modfix, modofst, bytecode, rld)#3
LDY #$00
- LDA (SRC),Y
BEQ RLDEX ; END OF RLD
PHA
INY
LDA (SRC),Y
INY
CLC
ADC ESTKL+3,X ; ADDR=ENTRY=>1+MODFIX
STA DSTL
INY
LDA (SRC),Y
ADC ESTKH+3,X
STA DSTH
PLA
LDY #$00
LDA (SRC),Y
AND #$10 ; EXTERN REF - EXIT
BNE RLDEX
TAY ; FIXUP=*ADDR+MODOFST
LDA (SRC),Y
BMI FIX16
AND #$40
BNE FIXMSB
FIXLSB LDA (DST),Y
CLC
ADC ESTKL+2,X
CLC
BCC FIX8
FIXMSB LDY #$03
LDA (SRC),Y ; FIXUPH=(ENTRY->3+MODOFSTL)+(^ADDR+MODOFSTH)
CLC
ADC ESTKL+2,X
LDY #$00
LDA (DST),Y
INY
ADC ESTKH+2,X
CLC
BCC FIX8
FIX16 LDA (DST),Y ; FIXUP=*ADDR+MODOFST
CLC
ADC ESTKL+2,X
STA TMPL
INY
LDA (DST),Y
ADC ESTKH+2,X
CMP ESTKH+1,X ; FIXUP >= BYTECODE?
@@ -785,7 +802,7 @@ asm reloc(modfix, modofst, bytecode, rld)#3
+ STA (DST),Y ; *ADDR=FIXUP
DEY
LDA TMPL
STA (DST),Y
FIX8 STA (DST),Y
LDA SRCL ; NEXT ENTRY
; CLC
ADC #$04
@@ -1352,7 +1369,7 @@ def docmds#0
if perr
prstr("ERR:$")
prbyte(perr)
crout()
crout()
fin
fin
prstr(pfxop(prefix, GET_PFX))
@@ -1371,7 +1388,7 @@ heap = @lastdef
//
// Print PLASMA version
//
prstr("PLASMA 2.1 64K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout
prstr("PLASMA 2.11 64K\n")
//
// Init symbol table.
//

View File

@@ -53,11 +53,10 @@ predef memset(addr,value,size)#0, memcpy(dst,src,size)#0, strcpy(dst,src)#1, str
predef uword_isgt(a,b)#1, uword_isge(a,b)#1, uword_islt(a,b)#1, uword_isle(a,b)#1, sext(a)#1, divmod(a,b)#2
predef execmod(modfile)#1, open(path)#1, close(refnum)#1, read(refnum, buf, len)#1
predef lookuptbl(dci)#1, execsys(sysfile)#0
//
// Exported CMDSYS table
//
word version = $0210 // 02.10
word version = $0211 // 02.11
word syspath
word syscmdln
word = @execmod, @open, @close, @read, 0
@@ -773,25 +772,42 @@ asm reloc(modfix, modofst, bytecode, rld)#3
LDY #$00
- LDA (SRC),Y
BEQ RLDEX ; END OF RLD
PHA
INY
LDA (SRC),Y
INY
CLC
ADC ESTKL+3,X ; ADDR=ENTRY=>1+MODFIX
STA DSTL
INY
LDA (SRC),Y
ADC ESTKH+3,X
STA DSTH
PLA
LDY #$00
LDA (SRC),Y
AND #$10 ; EXTERN REF - EXIT
BNE RLDEX
TAY ; FIXUP=*ADDR+MODOFST
LDA (SRC),Y
BMI FIX16
AND #$40
BNE FIXMSB
FIXLSB LDA (DST),Y
CLC
ADC ESTKL+2,X
CLC
BCC FIX8
FIXMSB LDY #$03
LDA (SRC),Y ; FIXUPH=(ENTRY->3+MODOFSTL)+(^ADDR+MODOFSTH)
CLC
ADC ESTKL+2,X
LDY #$00
LDA (DST),Y
INY
ADC ESTKH+2,X
CLC
BCC FIX8
FIX16 LDA (DST),Y ; FIXUP=*ADDR+MODOFST
CLC
ADC ESTKL+2,X
STA TMPL
INY
LDA (DST),Y
ADC ESTKH+2,X
CMP ESTKH+1,X ; FIXUP >= BYTECODE?
@@ -805,7 +821,7 @@ asm reloc(modfix, modofst, bytecode, rld)#3
+ STA (DST),Y ; *ADDR=FIXUP
DEY
LDA TMPL
STA (DST),Y
FIX8 STA (DST),Y
LDA SRCL ; NEXT ENTRY
; CLC
ADC #$04
@@ -930,26 +946,26 @@ def allocxheap(size)#1
word xaddr
xaddr = xheap
xheap = xheap + size
if systemflags & restxt1
if uword_isle(xaddr, $0800) and uword_isgt(xheap, $0400)
if systemflags & resxtxt1
if uword_islt(xaddr, $0800) and uword_isgt(xheap, $0400)
xaddr = $0800
xheap = xaddr + size
fin
fin
if systemflags & restxt2
if uword_isle(xaddr, $0C00) and uword_isgt(xheap, $0800)
if systemflags & resxtxt2
if uword_islt(xaddr, $0C00) and uword_isgt(xheap, $0800)
xaddr = $0C00
xheap = xaddr + size
fin
fin
if systemflags & resxhgr1
if uword_isle(xaddr, $4000) and uword_isgt(xheap, $2000)
if uword_islt(xaddr, $4000) and uword_isgt(xheap, $2000)
xaddr = $4000
xheap = xaddr + size
fin
fin
if systemflags & resxhgr2
if uword_isle(xaddr, $6000) and uword_isgt(xheap, $4000)
if uword_islt(xaddr, $6000) and uword_isgt(xheap, $4000)
xaddr = $6000
xheap = xaddr + size
fin
@@ -1437,7 +1453,7 @@ def docmds#0
if perr
prstr("ERR:$")
prbyte(perr)
crout()
crout()
fin
fin
prstr(pfxop(prefix, GET_PFX))
@@ -1456,7 +1472,7 @@ heap = @lastdef
//
// Print PLASMA version
//
prstr("PLASMA 2.1 128K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout
prstr("PLASMA 2.11 128K\n")
//
// Init symbol table.
//

View File

@@ -45,12 +45,12 @@ predef syslookuptbl(dci)#1
//
// Exported CMDSYS table
//
word version = $0210 // 02.10
word version = $0211 // 02.11
word syspath
word cmdlnptr
word = @execmod, @open, @close, @read, @write
byte perr
byte jitcount = 0 // Keep these here for compatibility
byte jitcount = 0
byte jitsize = 0
byte refcons = 0
byte devcons = 0
@@ -731,25 +731,42 @@ asm reloc(modfix, modofst, bytecode, rld)#3
LDY #$00
- LDA (SRC),Y
BEQ RLDEX ; END OF RLD
PHA
INY
LDA (SRC),Y
INY
CLC
ADC ESTKL+3,X ; ADDR=ENTRY=>1+MODFIX
STA DSTL
INY
LDA (SRC),Y
ADC ESTKH+3,X
STA DSTH
PLA
LDY #$00
LDA (SRC),Y
AND #$10 ; EXTERN REF - EXIT
BNE RLDEX
TAY ; FIXUP=*ADDR+MODOFST
LDA (SRC),Y
BMI FIX16
AND #$40
BNE FIXMSB
FIXLSB LDA (DST),Y
CLC
ADC ESTKL+2,X
CLC
BCC FIX8
FIXMSB LDY #$03
LDA (SRC),Y ; FIXUPH=(ENTRY->3+MODOFSTL)+(^ADDR+MODOFSTH)
CLC
ADC ESTKL+2,X
LDY #$00
LDA (DST),Y
INY
ADC ESTKH+2,X
CLC
BCC FIX8
FIX16 LDA (DST),Y ; FIXUP=*ADDR+MODOFST
CLC
ADC ESTKL+2,X
STA TMPL
INY
LDA (DST),Y
ADC ESTKH+2,X
CMP ESTKH+1,X ; FIXUP >= BYTECODE?
@@ -763,7 +780,7 @@ asm reloc(modfix, modofst, bytecode, rld)#3
+ STA (DST),Y ; *ADDR=FIXUP
DEY
LDA TMPL
STA (DST),Y
FIX8 STA (DST),Y
LDA SRCL ; NEXT ENTRY
; CLC
ADC #$04
@@ -1267,7 +1284,7 @@ cmdlnptr = @cmdln
// Print PLASMA version
//
init_cons
prstr("PLASMA 2.1\n")//; putb(version.1); putc('.'); putb(version.0); putln
prstr("PLASMA 2.11\n")
prstr("MEM:$"); prword(availheap); crout
//
// Exec command line parser

View File

@@ -56,7 +56,7 @@ predef syslookuptbl(dci)#1
//
// Exported CMDSYS table
//
word version = $0210 // 02.10
word version = $0211 // 02.11
word syspath
word cmdlnptr
word = @execmod, @open, @close, @read, @write
@@ -742,25 +742,42 @@ asm reloc(modfix, modofst, bytecode, rld)#3
LDY #$00
- LDA (SRC),Y
BEQ RLDEX ; END OF RLD
PHA
INY
LDA (SRC),Y
INY
CLC
ADC ESTKL+3,X ; ADDR=ENTRY=>1+MODFIX
STA DSTL
INY
LDA (SRC),Y
ADC ESTKH+3,X
STA DSTH
PLA
LDY #$00
LDA (SRC),Y
AND #$10 ; EXTERN REF - EXIT
BNE RLDEX
TAY ; FIXUP=*ADDR+MODOFST
LDA (SRC),Y
BMI FIX16
AND #$40
BNE FIXMSB
FIXLSB LDA (DST),Y
CLC
ADC ESTKL+2,X
CLC
BCC FIX8
FIXMSB LDY #$03
LDA (SRC),Y ; FIXUPH=(ENTRY->3+MODOFSTL)+(^ADDR+MODOFSTH)
CLC
ADC ESTKL+2,X
LDY #$00
LDA (DST),Y
INY
ADC ESTKH+2,X
CLC
BCC FIX8
FIX16 LDA (DST),Y ; FIXUP=*ADDR+MODOFST
CLC
ADC ESTKL+2,X
STA TMPL
INY
LDA (DST),Y
ADC ESTKH+2,X
CMP ESTKH+1,X ; FIXUP >= BYTECODE?
@@ -774,7 +791,7 @@ asm reloc(modfix, modofst, bytecode, rld)#3
+ STA (DST),Y ; *ADDR=FIXUP
DEY
LDA TMPL
STA (DST),Y
FIX8 STA (DST),Y
LDA SRCL ; NEXT ENTRY
; CLC
ADC #$04
@@ -1290,7 +1307,7 @@ cmdlnptr = @cmdln
// Print PLASMA version
//
init_cons
prstr("PLASMA 2.1 JITC\n")//; putb(version.1); putc('.'); putb(version.0); putln
prstr("PLASMA 2.11 JITC\n")
prstr("MEM:$"); prword(availheap); crout
//
// Exec command line parser

View File

@@ -26,17 +26,19 @@ predef cin()#1, rdstr(p)#1, toupper(c)#1, strcpy(dst,src)#1, strcat(dst,src)#1
predef markheap()#1, allocheap(size)#1, allocalignheap(size, pow2, freeaddr), releaseheap(newheap)#1, availheap()#1
predef memset(addr,value,size)#0, memcpy(dst,src,size)#0
predef uword_isgt(a,b)#1, uword_isge(a,b)#1, uword_islt(a,b)#1, uword_isle(a,b)#1
predef sext(a)#1, divmod(a,b)#2, execmod(modfile)#1
predef sext(a)#1, divmod(a,b)#2, execmod(modfile)#1, syslookuptbl(dci)#1
//
// Exported CMDSYS table
//
word version = $0200 // 02.00
word version = $0211 // 02.11
word syspath
word syscmdln
word = @execmod, 0, 0, 0, 0
byte perr
byte jitcount = 0
byte jitsize = 0
word = 0
word = @syslookuptbl
//
// String pool.
//
@@ -651,25 +653,42 @@ asm reloc(modfix, modofst, bytecode, rld)#3
LDY #$00
- LDA (SRC),Y
BEQ RLDEX ; END OF RLD
PHA
INY
LDA (SRC),Y
INY
CLC
ADC ESTKL+3,X ; ADDR=ENTRY=>1+MODFIX
STA DSTL
INY
LDA (SRC),Y
ADC ESTKH+3,X
STA DSTH
PLA
LDY #$00
LDA (SRC),Y
AND #$10 ; EXTERN REF - EXIT
BNE RLDEX
TAY ; FIXUP=*ADDR+MODOFST
LDA (SRC),Y
BMI FIX16
AND #$40
BNE FIXMSB
FIXLSB LDA (DST),Y
CLC
ADC ESTKL+2,X
CLC
BCC FIX8
FIXMSB LDY #$03
LDA (SRC),Y ; FIXUPH=(ENTRY->3+MODOFSTL)+(^ADDR+MODOFSTH)
CLC
ADC ESTKL+2,X
LDY #$00
LDA (DST),Y
INY
ADC ESTKH+2,X
CLC
BCC FIX8
FIX16 LDA (DST),Y ; FIXUP=*ADDR+MODOFST
CLC
ADC ESTKL+2,X
STA TMPL
INY
LDA (DST),Y
ADC ESTKH+2,X
CMP ESTKH+1,X ; FIXUP >= BYTECODE?
@@ -683,7 +702,7 @@ asm reloc(modfix, modofst, bytecode, rld)#3
+ STA (DST),Y ; *ADDR=FIXUP
DEY
LDA TMPL
STA (DST),Y
FIX8 STA (DST),Y
LDA SRCL ; NEXT ENTRY
; CLC
ADC #$04
@@ -823,6 +842,9 @@ end
//
// Symbol table routines.
//
def syslookuptbl(dci)#1
return lookuptbl(dci, symtbl)
end
def addsym(sym, addr)#0
while ^sym & $80
^lastsym = ^sym
@@ -1078,7 +1100,7 @@ heap = *freemem
//
// Print PLASMA version
//
prstr("\nPLASMA 2.0 Dev\n") //; prbyte(version.1); cout('.'); prbyte(version.0); crout
prstr("\nPLASMA 2.11\n")
//
// Init symbol table.
//

View File

@@ -121,8 +121,8 @@ OPTBL !WORD CN,CN,CN,CN,CN,CN,CN,CN ; 00 02
!WORD NEG,COMP,BAND,IOR,XOR,SHL,SHR,IDXW ; 90 92 94 96 98 9A 9C 9E
!WORD BRGT,BRLT,INCBRLE,ADDBRLE,DECBRGE,SUBBRGE,BRAND,BROR ; A0 A2 A4 A6 A8 AA AC AE
!WORD ADDLB,ADDLW,ADDAB,ADDAW,IDXLB,IDXLW,IDXAB,IDXAW ; B0 B2 B4 B6 B8 BA BC BE
!WORD NATV ; C0
;*
!WORD NATV,JUMPZ,JUMP ; C0 C2 C4
;;*
;* DIV TOS-1 BY TOS
;*
DIV JSR _DIV
@@ -1193,6 +1193,28 @@ NATV TYA ; FLATTEN IP
JMP (IP)
+ INC IPH
JMP (IP)
;*
;* JUMPS FOR FORTH COMPILER
;*
JUMPZ INX
LDA ESTKH-1,X
ORA ESTKL-1,X
BEQ JUMP
INY ;+INC_IP
INY
BMI +
JMP NEXTOP
+ JMP FIXNEXT
JUMP INY
LDA (IP),Y
PHA
INY
LDA (IP),Y
STA IPH
PLA
STA IPL
LDY #$00
JMP FETCHOP
CMD !SOURCE "vmsrc/c64/cmd.a"
SEGEND = *
VMINIT JSR $FFE7 ; CLOSE ALL CHANNELS