mirror of
https://github.com/simh/simh.git
synced 2026-01-19 09:28:37 +00:00
3.10 is mostly an attempt to get aligned with the current head of the GitHub 4.0 sources. While the core libraries and SCP have diverged too far for real forward and backward compatibility, enough 4.0 workalikes have been added to allow much closer convergence of the two streams. 3.10 will provide the basis for my future simulation work.
50 lines
1.4 KiB
C
50 lines
1.4 KiB
C
#include <stdio.h>
|
|
|
|
#define ERROR 00404
|
|
#include "pdp11_cr_dat.h"
|
|
|
|
static int colStart = 1; /* starting column */
|
|
static int colEnd = 80; /* ending column */
|
|
|
|
main ()
|
|
{
|
|
int col, c;
|
|
|
|
while (1) {
|
|
for (col = colStart; col <= colEnd; ) {
|
|
switch (c = fgetc (stdin)) {
|
|
case EOF:
|
|
/* fall through */
|
|
case '\n':
|
|
while (col <= colEnd) {
|
|
fputc (o29_code[' '] & 077, stdout);
|
|
fputc ((o29_code[' '] >> 6) & 077, stdout);
|
|
col++;
|
|
}
|
|
break;
|
|
case '\t':
|
|
do {
|
|
fputc (o29_code[' '] & 077, stdout);
|
|
fputc ((o29_code[' '] >> 6) & 077, stdout);
|
|
col++;
|
|
} while (((col & 07) != 1) && (col <= colEnd));
|
|
break;
|
|
default:
|
|
fputc (o29_code[c] & 077, stdout);
|
|
fputc ((o29_code[c] >> 6) & 077, stdout);
|
|
col++;
|
|
break;
|
|
}
|
|
}
|
|
/* flush long lines, or flag over-length card */
|
|
if (c != '\n' && c != EOF) {
|
|
printf ("overlength line\n");
|
|
do c = fgetc (stdin);
|
|
while ((c != EOF) && (c != '\n'));
|
|
}
|
|
if (c == EOF)
|
|
break;
|
|
}
|
|
exit (1);
|
|
}
|