Get ass running --- it's very K&R and almost certainly won't build on clang,

but it works on gcc.
This commit is contained in:
David Given 2018-06-09 14:10:45 +09:00
parent 19cd42124f
commit d10a594c04
7 changed files with 61 additions and 17 deletions

View file

@ -45,7 +45,9 @@ installable {
"util/ack+pkg",
"util/amisc+pkg",
"util/arch+pkg",
"util/ass+pkg",
"util/ego+pkg",
"util/ass+pkg",
"util/led+pkg",
"util/misc+pkg",
"util/opt+pkg",

View file

@ -2,7 +2,12 @@
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <em_spec.h>
#include <as_spec.h>
#include <em_flag.h>

View file

@ -850,7 +850,7 @@ extxcon(header) {
}
/* Added atol() that ignores overflow. --Ceriel */
long atol(s)
long myatol(s)
register char *s;
{
register long total = 0;
@ -879,6 +879,6 @@ extvcon(header) {
if ( consiz>4 ) {
error("Size of initializer exceeds loader capability") ;
}
extarb((int)consiz,atol(string)) ;
extarb((int)consiz,myatol(string)) ;
return ;
}

View file

@ -47,7 +47,6 @@ area_t getarea(size) unsigned size ; {
register struct freeblock *c_ptr,*l_ptr ;
register char *ptr ;
unsigned rqsize ;
char *malloc() ;
size = ((size + (sizeof(int) - 1)) / sizeof(int)) * sizeof(int);
#ifdef MEMUSE

View file

@ -150,16 +150,3 @@ extern relc_t *text_reloc();
extern relc_t *data_reloc();
extern area_t getarea();
/*
* all used library routines
*/
extern char *malloc();
extern int open();
extern int creat();
extern int getpid();
extern int unlink();
extern int close();
extern int strcmp();
extern char *strcpy();
#define void int

51
util/ass/build.lua Normal file
View file

@ -0,0 +1,51 @@
cprogram {
name = "maktab",
srcs = {
"./maktab.c"
},
deps = {
"h+emheaders",
"modules/src/em_data+lib",
}
}
normalrule {
name = "asstb",
ins = {
"+maktab",
"etc/ip_spec.t"
},
outleaves = {
"asstb.c"
},
commands = {
"%{ins} %{outs}"
}
}
cprogram {
name = "em_ass",
srcs = {
"./ass*.c",
"+asstb",
},
deps = {
"h+emheaders",
"h+local",
--"modules/src/alloc+lib",
"modules/src/em_data+lib",
--"modules/src/data+lib",
--"modules/src/object+lib",
--"modules/src/system+lib",
"./ass*.h",
}
}
installable {
name = "pkg",
map = {
["$(PLATDEP)/em_ass"] = "+em_ass",
["$(INSDIR)/share/man/man6/em_ass.6"] = "./em_ass.6",
}
}

View file

@ -4,7 +4,7 @@
.SH NAME
em_ass \- EM assembler/loader
.SH SYNOPSIS
.B ~em/lib.bin/em_ass
.B ~em/lib/ack/em_ass
[options] argument ...
.SH DESCRIPTION
Em_ass assembles and links EM modules.