Skip to content

Commit 0eaddde

Browse files
committed
Add support for 36-bit words at stored on a Xerox Alto.
Binary .SAV, .REL, and .UNV files stored here are encoded with five octets per word: 0000AAAA BBBBBBBB CCCCCCCC DDDDDDDD EEEEEEEE. https://xeroxalto.computerhistory.org/_cd8_/pup/
1 parent d113624 commit 0eaddde

File tree

8 files changed

+2133
-3
lines changed

8 files changed

+2133
-3
lines changed

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ FILES = sblk-file.o pdump-file.o dmp-file.o raw-file.o exe-file.o \
66
cross-file.o hex-file.o atari-file.o iml-file.o exb-file.o \
77
tenex-file.o csave-file.o hiseg-file.o
88

9-
WORDS = aa-word.o bin-word.o cadr-word.o core-word.o data8-word.o \
10-
dta-word.o its-word.o oct-word.o pt-word.o sail-word.o tape-word.o \
11-
x-word.o
9+
WORDS = aa-word.o alto-word.o bin-word.o cadr-word.o core-word.o \
10+
data8-word.o dta-word.o its-word.o oct-word.o pt-word.o \
11+
sail-word.o tape-word.o x-word.o
1212

1313
OBJS = pdp10-opc.o info.o dis.o symbols.o \
1414
timing.o timing_ka10.o timing_ki10.o memory.o weenix.o

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Most tools support these PDP-10 36-bit word encodings:
4040
- Paper tape image.
4141
- Saildart.org UTF-8.
4242
- Tape images, 7 or 9 track.
43+
- Files stored in an Alto file system.
4344

4445
Most tools that work with executable programs support these formats:
4546

alto-word.c

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/* Copyright (C) 2022 Lars Brinkhoff <lars@nocrew.org>
2+
3+
This program is free software: you can redistribute it and/or modify
4+
it under the terms of the GNU General Public License as published by
5+
the Free Software Foundation, either version 2 of the License, or
6+
(at your option) any later version.
7+
8+
This program is distributed in the hope that it will be useful,
9+
but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
GNU General Public License for more details.
12+
13+
You should have received a copy of the GNU General Public License
14+
along with this program. If not, see <http://www.gnu.org/licenses/>. */
15+
16+
#include <stdio.h>
17+
18+
#include "dis.h"
19+
20+
static int
21+
get_byte (FILE *f)
22+
{
23+
int c = fgetc (f);
24+
return c == EOF ? 0 : c;
25+
}
26+
27+
word_t
28+
get_alto_word (FILE *f)
29+
{
30+
word_t x1, x2, x3, x4, x5;
31+
word_t word;
32+
33+
if (feof (f))
34+
return -1;
35+
36+
x1 = get_byte (f);
37+
if (feof (f))
38+
return -1;
39+
x2 = get_byte (f);
40+
x3 = get_byte (f);
41+
x4 = get_byte (f);
42+
x5 = get_byte (f);
43+
word = (x1 << 32) | (x2 << 24) | (x3 << 16) | (x4 << 8) | x5;
44+
word &= 0777777777777LL;
45+
46+
return word;
47+
}
48+
49+
void
50+
write_alto_word (FILE *f, word_t word)
51+
{
52+
fputc ((word >> 32) & 0x0F, f);
53+
fputc ((word >> 24) & 0xFF, f);
54+
fputc ((word >> 16) & 0xFF, f);
55+
fputc ((word >> 8) & 0xFF, f);
56+
fputc ( word & 0xFF, f);
57+
}
58+
59+
struct word_format alto_word_format = {
60+
"alto",
61+
get_alto_word,
62+
NULL,
63+
write_alto_word,
64+
NULL
65+
};

check.sh

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ test_dis10 dired.dmp "-6 -mka10sail -Wascii -Sddt"
7474
test_dis10 two.tapes "-r -Wtape"
7575
test_dis10 boot.exb "-Fexb -Wascii"
7676
test_dis10 cerber.sav "-Sall -Fcsave -Wascii"
77+
test_dis10 eftp.sav "-Ftenex -Walto"
7778

7879
test_itsarc arc.code
7980
test_ipak stink.-ipak-

dis.h

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ extern struct file_format tenex_file_format;
8888
extern struct word_format *input_word_format;
8989
extern struct word_format *output_word_format;
9090
extern struct word_format aa_word_format;
91+
extern struct word_format alto_word_format;
9192
extern struct word_format bin_word_format;
9293
extern struct word_format cadr_word_format;
9394
extern struct word_format core_word_format;

samples/eftp.sav

15 KB
Binary file not shown.

test/eftp.sav.dasm

+2,061
Large diffs are not rendered by default.

word.c

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ struct word_format *output_word_format = &its_word_format;
2323

2424
static struct word_format *word_formats[] = {
2525
&aa_word_format,
26+
&alto_word_format,
2627
&bin_word_format,
2728
&cadr_word_format,
2829
&core_word_format,

0 commit comments

Comments
 (0)