1
0
mirror of https://github.com/livingcomputermuseum/pdp7-unix.git synced 2026-02-09 18:01:55 +00:00

I've commited a change to as7 to use the C pre-processor. Not sure if it's

to everybody's taste.
This commit is contained in:
Warren Toomey
2016-03-13 21:08:43 +10:00
parent a3e3a263ef
commit 8b421eb27b
3 changed files with 60 additions and 42 deletions

View File

@@ -1,6 +1,8 @@
# Build the kernel, the filesystem and run SimH
# Put any defines for as7 here
#DEFINES=
AS=../tools/as7
AS=../tools/as7 $(DEFINES)
MKFS=../tools/mkfs7
SYS=../src/sys
@@ -18,7 +20,7 @@ coldboot:
$(AS) -f list -o a.lst $(SYS)/sop.s $(SYS)/s[1-9].s
image.fs:
$(MKFS) --debug --format simh proto
$(MKFS) --format simh proto
clean:
rm -f a.rim image.fs a.lst

View File

@@ -5,26 +5,28 @@ pibreak: " priority interrupt break processing "chain"
dac .ac " save interrupt AC
"** CROSSED OUT....
" dpsf " Warren commented this code out to try and
" jmp 1f " disable the Graphics-2 I/O
#ifdef GRAPHICS2
dpsf
jmp 1f " disable the Graphics-2 I/O
" dpcf
" dprs
" dac dpstat
" sma ral
" jmp 2f
" dprc
" dac dpchar
" -1
" dac dpread
" lac dpstat
" ral
" 2:
" sma
" jmp piret
" -1
" dac dpwrite
" jmp piret "** END OF CROSSOUT
dpcf
dprs
dac dpstat
sma ral
jmp 2f
dprc
dac dpchar
-1
dac dpread
lac dpstat
ral
2:
sma
jmp piret
-1
dac dpwrite
jmp piret "** END OF CROSSOUT
#endif
1: clsf " clock overflow (line frequency ticks)?
jmp 1f " no
@@ -88,26 +90,26 @@ cnop: " fetched as constant in iread
dac .dspb
jmp piret
dsprestart:
" Warren commented this out to try and
" disable the Graphics-2 I/O
" lac d1
" dac .dspb " set .dsbp = 1
" lac dspbufp " load display buf pointer
" beg " start display processor
" -10
" dac .dsptm " set .dsptm = -10 (10 ticks)
" jmp piret
#ifdef GRAPHICS2
lac d1
dac .dspb " set .dsbp = 1
lac dspbufp " load display buf pointer
beg " start display processor
-10
dac .dsptm " set .dsptm = -10 (10 ticks)
jmp piret
" 1: sna ral " dataphone flag set (bit 7)??
" jmp .+3 " no
" raef " XXX: fix comment
" jmp piret " return
" sma " light pen flags (bit 2)
" jmp 1f " no
" lda " G-2: load display address
" dac .lpba " save
" rlpd " G-2: resume after light pen stop
" jmp piret
1: sna ral " dataphone flag set (bit 7)??
jmp .+3 " no
raef " XXX: fix comment
jmp piret " return
sma " light pen flags (bit 2)
jmp 1f " no
lda " G-2: load display address
dac .lpba " save
rlpd " G-2: resume after light pen stop
jmp piret
#endif
1: ksf " (TTY) keyboard flag set?
jmp 1f " no

View File

@@ -38,10 +38,13 @@ my $debug = 0; # Run in debug mode
my $format = 'a7out'; # output format
my $namelist = 0; # output n.out file
my $output = 'a.out'; # output file
my @cppdefs; # C pre-processor defines
my @cppundefs; # C pre-processor undefines
# keep this near the GetOptions call to make it easy to add documentation!
sub usage {
die("Usage: $0 [--debug] [--format=a7out|list|ptr|rim ] [--out file] file1.s [file2.s ...]\n")
die("Usage: $0 [-Dmacro] [-Umacro] [--debug] [--format=a7out|list|ptr|rim ]\n" .
"\t[--out file] file1.s [file2.s ...]\n");
}
GetOptions(
@@ -49,6 +52,8 @@ GetOptions(
'format|f=s' => \$format,
'namelist|n' => \$namelist,
'output|o=s' => \$output,
'D|D=s' => \@cppdefs,
'U|U=s' => \@cppundefs,
) or usage();
usage() if ( @ARGV < 1 );
@@ -265,9 +270,18 @@ sub err {
# Open and parse the given file
sub parse_file {
$file = shift;
open( my $IN, "<", $file ) || die("Cannot read $file: $!\n");
# Get the C pre-processor command-line arguments
my $defines= join(' ', map { "-D$_" } @cppdefs) || "";
my $undefines= join(' ', map { "-U$_" } @cppundefs) || "";
open( my $IN, "-|", "cpp -trigraphs $defines $undefines $file" )
|| die("Cannot pipe cpp $file: $!\n");
$lineno = 0;
while ( $line = <$IN> ) {
# Lose any C pre-processor comment lines
next if ($line=~ m{^#});
$lineno++;
chomp($line); # Lose the end of line
$origline = $line;