Skip to content

Try and make the A68S compiler work again. #326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: default
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"lang/basic/src+all",
"lang/m2/comp+all",
"lang/pc/comp+all",
"lang/a68s/aem+all",
"util/ack+all",
"util/amisc+all",
"util/arch+all",
Expand Down
5 changes: 5 additions & 0 deletions build/ab.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ CP ?= cp

HOSTCC ?= gcc
HOSTCXX ?= g++
HOSTFPC ?= fpc
HOSTAR ?= ar
HOSTCFLAGS ?= -g -Og
HOSTFPCFLAGS ?= -g -gl -vi- -l-
HOSTLDFLAGS ?= -g

CC ?= $(HOSTCC)
CXX ?= $(HOSTCXX)
FPC ?= $(HOSTFPC)
AR ?= $(HOSTAR)
CFLAGS ?= $(HOSTCFLAGS)
FPCFLAGS ?= $(HOSTFPCFLAGS)
LDFLAGS ?= $(HOSTLDFLAGS)

export PKG_CONFIG
Expand Down Expand Up @@ -91,6 +95,7 @@ include $(OBJ)/build.mk

MAKEFLAGS += -r -j$(shell nproc)
.DELETE_ON_ERROR:
.SUFFIXES:

.PHONY: update-ab
update-ab:
Expand Down
19 changes: 19 additions & 0 deletions build/pascal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from build.ab import Rule, Targets, simplerule
from build.toolchain import Toolchain, HostToolchain

Toolchain.PC = ["$(FPC) -FE$[dir] -o$[outs[0]] $[ins] $(FPCFLAGS) $[fpcflags]"]
HostToolchain.PC = ["$(HOSTFPC) -FE$[dir] -o$[outs[0]] $[ins] $(HOSTFPCFLAGS) $[fpcflags]"]

@Rule
def _pascalprogramimpl(self, name, srcs:Targets=[], fpcflags=[], toolchain=None, label="PASCAL"):
simplerule(replaces=self,
ins=srcs,
outs=[f"={self.localname}"],
commands=toolchain.PC,
label=toolchain.PREFIX + label)

def pascalprogram(toolchain=Toolchain, **kwargs):
return _pascalprogramimpl(**kwargs, toolchain=toolchain)

def hostpascalprogram(toolchain=HostToolchain, **kwargs):
return _pascalprogramimpl(**kwargs, toolchain=toolchain)
6 changes: 3 additions & 3 deletions lang/a68s/aem/a68s1ce.p
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@
34190 WRITEINSTN(LXL); WRITECON(CPACTCONS, SZWORD, 0); (*-24() TAKELINE; ()-24*) (*STATIC LINK*)
34200 WRITEINSTN(CAL);
34205 STRWLEN:=(RTNLENGTH+CHARPERWORD) DIV CHARPERWORD *SZWORD;
34210 ENEW(TEMP,LEX1SIZE+STRWLEN);
34210 GETMEM(TEMP, (LEX1SIZE+STRWLEN)*SZWORD);
34220 WITH TEMP^ DO
34230 BEGIN
34240 FOR I:=1 TO RTNLENGTH DO S10[I]:=ROUTINE[I];
Expand Down Expand Up @@ -1710,7 +1710,7 @@
44830 EMITXWORD(OCVIMMED,SZWORD);(*-24() WRITE(LGO,',');()-24*)
44840 EMITXWORD(OCVIMMED,SZADDR);
44850 WRITEINSTN(EOOPNDS);
44900 ENEW(TEMP,LEX1SIZE + (9+CHARPERWORD) DIV CHARPERWORD * SZWORD);
44900 GETMEM(TEMP, (LEX1SIZE + (9+CHARPERWORD)*SZWORD) DIV CHARPERWORD * SZWORD);
44908 WITH TEMP^ DO
44909 BEGIN
44910 S10 := 'M_A_I_N ';
Expand Down Expand Up @@ -1913,7 +1913,7 @@
46120 BUFFER[LAST+FIFTEEN].CODEWORD := 0;
46130 HEADERWORD.WORD := 40000020000001000000B
46140 END;
46150 ENEW(TEMP,LEX1SIZE+5);
46150 GETMEM(TEMP, (LEX1SIZE+5)*SZWORD);
46160 TEMP^.S10 := 'PDERR '; (* ENTRY POINT FOR PASCAL DETECTED ERRORS *)
46170 EMITX1(PJMP, OCVEXT, ORD(TEMP));
46180 EMITX1(PJMP, OCVIMMED, OUTPUTEFET);
Expand Down
Loading
Loading