Digital Research
This commit is contained in:
2020-11-06 18:50:37 +01:00
parent 621ed8ccaf
commit 31738079c4
8481 changed files with 1888323 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
$ !
$ ! Here (vaxmake.com) is the command file for building all of
$ ! DRI's ASM86 on the VAX. This file is set up to be SUBMITed.
$ !
$ set def [.cmsasm86]
$ assign nl: sys$print
$
$! Assign the Intel disk names and old crosscompiler tool names.
$ @oldintel
$!
$ oplm86 mainp.plm debug optimize(2) xref
$ oplm86 brexpr.plm debug optimize(2) xref
$ oplm86 cm.plm debug optimize(2) xref
$ oplm86 cm2.plm debug optimize(2) xref
$ oplm86 cmac1.plm debug optimize(2) xref
$ oplm86 cmac2.plm debug optimize(2) xref
$ oplm86 cmac3.plm debug optimize(2) xref
$ oplm86 cmac4.plm debug optimize(2) xref
$ oplm86 cmac5.plm debug optimize(2) xref
$ oplm86 cmsubr.plm debug optimize(2) xref
$ oplm86 dline.plm debug optimize(2) xref
$ oplm86 ermod.plm debug optimize(2) xref
$ oplm86 expr.plm debug optimize(2) xref
$ oplm86 files.plm debug optimize(2) xref
$ oplm86 global.plm debug optimize(2) xref
$ oplm86 instr.plm debug optimize(2) xref
$ oplm86 io.plm debug optimize(2) xref
$ oplm86 mnem1.plm debug optimize(2) xref
$ oplm86 mnem2.plm debug optimize(2) xref
$ oplm86 mnem3.plm debug optimize(2) xref
$ oplm86 mnem4.plm debug optimize(2) xref
$ oplm86 outp.plm debug optimize(2) xref
$ oplm86 predef.plm debug optimize(2) xref
$ oplm86 print.plm debug optimize(2) xref
$ oplm86 pseud1.plm debug optimize(2) xref
$ oplm86 pseud2.plm debug optimize(2) xref
$ oplm86 scan.plm debug optimize(2) xref
$ oplm86 subr1.plm debug optimize(2) xref
$ oplm86 subr2.plm debug optimize(2) xref
$ oplm86 symb.plm debug optimize(2) xref
$ oplm86 text.plm debug optimize(2) xref
$
$ oasm86 c86lnk.asm debug
$ !
$ olink86 cmac1.obj,cmac2.obj,cmac3.obj,cmac4.obj,cmac5.obj to f11.mod
$ olink86 mnem1.obj,mnem2.obj,mnem3.obj,mnem4.obj,symb.obj to f12.mod
$ olink86 io.obj,subr1.obj,subr2.obj,files.obj,scan.obj to f13.mod
$ olink86 print.obj,predef.obj,ermod.obj,text.obj,outp.obj to f14.mod
$ olink86 expr.obj,brexpr.obj,pseud1.obj,pseud2.obj,cmsubr.obj to f15.mod
$ olink86 instr.obj,dline.obj,global.obj,cm.obj,cm2.obj to f16.mod
$ olink86 f11.mod,f12.mod,f13.mod to f21.mod
$ olink86 f14.mod,f15.mod,f16.mod to f22.mod
$ olink86 c86lnk.obj,mainp.obj,f21.mod,f22.mod,plm86.lib to asm86.mod
$ oloc86 asm86.mod to asm86.abs ad(sm(code(0))) od(sm(code,const,stack))
$ oh86 asm86.abs
$!
$! search for the starts of the CONST and MEMORY segments...
$ search asm86.mp2 "G CONST","G MEMORY"
$!
$! Do the rest on CP/M:
$!
$! Determine BBB, MMM and NNN from asm86.mp2 (from the output from
$! the search command):
$! BBB = start of const segment / 16
$! MMM = start of memory segment / 16
$! Then NNN = (MMM - BBB) + 100h
$! (100h leaves 4K bytes of space for the symbol table)
$! gencmd asm86 data[bBBB,mNNN,xFFF]
$! An example:
$! gencmd asm86 data[b4AD,m44E,xFFF]


View File

@@ -0,0 +1,20 @@
/*********** "BNF"-expression syntax ************/
/*
E::= E xor A !! E or A !! A
A::= A and N !! N
N::= not N !! R
R::= P eq P !! P lt P !! P le P !! P gt P !! P ge P !! P ne P !! P
P::= P + T !! P - T !! T
T::= T * M !! T / M !! T mod M !! T shl M !! T shr M !! M
M::= - M !! + M !! S
S::= <over>: F !! F
F::= F ptr B !! seg B !! offset B !! type B !!
length B !! last B !! B
B::= ( E ) !! [ bracket-expression ] !! I
I::= varaible !! . number !! number !! label !! string
<over>::= segment register
(stringlength < 3)
*/


View File

@@ -0,0 +1,125 @@
$nolist
/*
modified 4/13/81 R. Silberstein
*/
/* Symbol types : */
dcl
reg lit '0', /* register */
pseudo lit '1', /* pseudo instruction */
code lit '2', /* instruction */
string lit '3', /* character string */
spec lit '4', /* special character */
number lit '5', /* 8 or 16 bit number */
variable lit '6',
lab lit '7', /* label */
operator lit '8', /* operator in expressions */
doubledefined lit '0f9h', /* doubled defined symbol */
neglected lit '0fah', /* neglected symb.,never to be def. */
ident lit '0fbh', /* identificator, scanner output */
udefsymb lit '0fdh', /* undefined symbol */
symbol lit '0feh', /* variable,label or undef. symb. */
deletedsymb lit '0ffh'; /* deleted symbol (not used */
/* Symbol description values */
dcl
nil lit '0', /* no specification */
byt lit '1', /* symbol is 8-bit type */
wrd lit '2', /* symbol is 16 bit type */
dwrd lit '4'; /* symbol is 2*16 bit type
or a segment register */
/* Register values : */
dcl
rbx lit '3',
rbp lit '5',
rsi lit '6',
rdi lit '7',
res lit '0', /* segment registers */
rcs lit '1',
rss lit '2',
rds lit '3';
/* Symbolic operators */
dcl
oshort lit '0', /* 8-bit value of expression */
oor lit '1', /* logical OR */
oxor lit '2', /* logical XOR */
oand lit '3', /* logical AND */
onot lit '4', /* logical NOT */
oeq lit '5', /* equal */
ogt lit '6', /* greater */
oge lit '7', /* greater or equal */
olt lit '8', /* less */
ole lit '9', /* less or equal */
one lit '10', /* not equal */
omod lit '11', /* arithmetic MOD */
oshl lit '12', /* shift left */
oshr lit '13', /* shift rigth */
optr lit '14', /* take type of 1. op, value of 2. */
ooffset lit '15', /* offset value of operand */
oseg lit '16', /* segment value of operand */
otype lit '17', /* type value of operand */
olength lit '18', /* length attribute of variables */
olast lit '19', /* length - 1 */
leftbracket lit '''[''',
rightbracket lit ''']''';
dcl
operandstruc lit 'struc(
length addr,
stype byte,
sflag byte,
segment addr,
offset addr,
baseindex byte)',
/* define bits of SFLAG of structures above */
type$bit lit '7h', /* bit 0-2 */
segtypebit lit '18h', /* bit 3-4 */
segmbit lit '20h', /* bit 5 */
iregbit lit '40h', /* bit 6 */
bregbit lit '80h', /* bit 7 */
/* left-shift counters */
typecount lit '0',
segtypecount lit '3',
segmcount lit '5',
iregcount lit '6',
bregcount lit '7',
/* define bits of BASEINDEX byte of structures above */
indexregbit lit '01h', /* bit 0 */
baseregbit lit '02h', /* bit 1 */
nooverridebit lit '40h', /* bit 6 */
/* left shift counters */
indexregcount lit '0',
baseregcount lit '1',
noovercount lit '6';
scan: proc external;
end scan;
specialtoken: proc (tok) byte external;
dcl tok byte;
end specialtoken;
$list


View File

@@ -0,0 +1,78 @@
;
extrn asm86:near
cgroup group code
dgroup group const,data,stack,memory
assume cs:cgroup,ds:dgroup
data segment public 'DATA'
data ends
;
stack segment word stack 'STACK'
stack_base label byte
stack ends
;
memory segment memory 'MEMORY'
memory ends
const segment public 'CONST'
public fcb,fcb16,tbuff,endbuf
org 6
endbuf equ $
org 5ch
fcb equ $
org 6ch
fcb16 equ $
org 80h
tbuff equ $
org 100h
const ends
code segment public 'CODE'
public mon1,mon2
start: mov ax,ds
pushf
pop bx
cli
mov ss,ax
lea sp,stack_base
push bx
popf
jmp asm86
copyright db ' COPYRIGHT (C) DIGITAL RESEARCH, 1981 '
public patch
patch:
db 90h,90h,90h,90h,90h,90h,90h,90h
db 90h,90h,90h,90h,90h,90h,90h,90h
db 90h,90h,90h,90h,90h,90h,90h,90h
db 90h,90h,90h,90h,90h,90h,90h,90h
db 90h,90h,90h,90h,90h,90h,90h,90h
db 90h,90h,90h,90h,90h,90h,90h,90h
db 90h,90h,90h,90h,90h,90h,90h,90h
db 90h,90h,90h,90h,90h,90h,90h,90h
date db ' 01/25/82 '
bdos:
pop ax ; return address
pop dx
pop cx
push ax
int 224
ret
mon1 equ bdos
mon2 equ bdos
code ends
end


View File

@@ -0,0 +1,37 @@
$nolist
codemacro$rout: PROC external;
end$proc codemacro$rout;
db$cm$rout: PROC external;
end$proc db$cm$rout;
dw$cm$rout: PROC external;
end$proc dw$cm$rout;
dd$cm$rout: PROC external;
end$proc dd$cm$rout;
segfix$cm$rout: PROC external;
end$proc segfix$cm$rout;
nosegfix$cm$rout: PROC external;
end$proc nosegfix$cm$rout;
modrm$cm$rout: PROC external;
end$proc modrm$cm$rout;
relb$cm$rout: PROC external;
end$proc relb$cm$rout;
relw$cm$rout: PROC external;
end$proc relw$cm$rout;
dbit$cm$rout: PROC external;
end$proc dbit$cm$rout;
end$cm$rout: PROC external;
end$proc end$cm$rout;
$list


View File

@@ -0,0 +1,16 @@
$nolist
/* D E C L A R A T I O N F O R "C O D E M A C R O" P A R T
Extended version of ASM86 */
dcl comma lit ''',''',
colon lit ''':''',
first lit '0',
second lit '1',
leftpar lit '''(''',
rightpar lit ''')''';
$list


View File

@@ -0,0 +1,47 @@
$nolist
/* D E C L A R A T I O N F O R "C O D E M A C R O" P A R T
Extended version of ASM86 */
dcl cm$error byte external,
global$cm$error byte external,
cm$list$overflow byte external,
cmpt address external;
/* level 2 in the syntax-tree of codemacro building */
/* Procedure to initialize temporary storage and pointers
conserning the building of codemacro */
init$cm$rout: PROC external;
end$proc init$cm$rout;
name$rout: PROC byte external;
end$proc name$rout;
formal$list$rout: PROC external;
end$proc formal$list$rout;
terminate$cm$rout: PROC external;
end$proc terminate$cm$rout;
legal$parameter: PROC(lg,ptr,ptr2) byte external;
dcl lg byte,
(ptr,ptr2) address;
end$proc legal$parameter;
legal$seg$reg: PROC byte external;
end$proc legal$seg$reg;
put$b: PROC(b) external;
dcl b byte;
end$proc put$b;
put$w: PROC(w) external;
dcl w address;
end$proc put$w;
$list


View File

@@ -0,0 +1,44 @@
$nolist
/* Literals used in codemacro specification : */
dcl
divisor lit '0',
mplier lit '0',
place lit '0',
itype lit '0',
si$ptr lit '0',
di$ptr lit '1',
port lit '1',
adr lit '0',
dst lit '0',
src lit '1',
opcode lit '0';
/* Literals to simplify table punching: */
dcl
cmachead lit 'struc (next address,nopar byte',
cmac2struc lit 'cmachead,body(2) byte)',
cmac3struc lit 'cmachead,body(3) byte)',
cmac4struc lit 'cmachead,body(4) byte)',
cmac5struc lit 'cmachead,body(5) byte)',
cmac6struc lit 'cmachead,body(6) byte)',
cmac7struc lit 'cmachead,body(7) byte)',
cmac8struc lit 'cmachead,body(8) byte)',
cmac9struc lit 'cmachead,body(9) byte)',
cmac10struc lit 'cmachead,body(10) byte)',
cmac11struc lit 'cmachead,body(11) byte)',
cmac12struc lit 'cmachead,body(12) byte)',
cmac13struc lit 'cmachead,body(13) byte)',
cmac14struc lit 'cmachead,body(14) byte)',
cmac15struc lit 'cmachead,body(15) byte)',
cmac16struc lit 'cmachead,body(16) byte)',
cmac17struc lit 'cmachead,body(17) byte)',
cmac18struc lit 'cmachead,body(18) byte)',
cmac19struc lit 'cmachead,body(19) byte)',
cmac20struc lit 'cmachead,body(20) byte)',
cmac21struc lit 'cmachead,body(21) byte)';
$list


View File

@@ -0,0 +1,96 @@
$nolist
$eject
/* Here are the definitions for the */
/* codemacro instructions of the */
/* ASM86 assembler */
/* Commands within codemacros: */
declare
mdbn lit '0', /* DB with number */
mdbf lit '1', /* DB with formal parameter */
mdwn lit '2', /* DW with numbers */
mdwf lit '3', /* DW with formal parameter */
mddf lit '4', /* DD with formal parameter */
mdbit lit '5', /* DBIT */
mendm lit '6', /* ENDM */
mrelb lit '7', /* RELB */
mrelw lit '8', /* RELW */
mendbit lit '9', /* ENDBIT */
mmodrm1 lit '10', /* MODRM with 1 formal parameter */
mmodrm2 lit '11', /* MODRM with 2 formal parmeters */
msegfix lit '12', /* SEGFIX */
mnosegfix lit '13', /* NOSEGFIX */
mformalbits lit '14', /* define bits from formal par. */
mnumberbits lit '15'; /* define bits from number */
/* Specifier letters: */
declare
specA lit '0', /* accumulator, AX or AL */
specC lit '1', /* code, address expression */
specD lit '2', /* data, number used as immediate data */
specE lit '3', /* effective address, either a memory
address (specM) or register (specR) */
specM lit '4', /* memory address, variable (with or without
indexing) or [register expression] */
specR lit '5', /* general register only (not segment) */
specS lit '6', /* segment register */
specX lit '7'; /* simple variable name without indexing */
/* Modifier letters: */
declare
nomod lit '0',
modb lit '1', /* byte expression */
modw lit '2', /* word expression */
modsb lit '3', /* byte in range (-128,127) */
modd lit '4'; /* 2-word expression */
/* Segment override bytes: */
dcl
ESover lit '26h',
CSover lit '2eh',
SSover lit '36h',
DSover lit '3eh';
/* "AND"-masks for codemaco head flag */
declare
nopar$and lit '0fh', /* no of parameters, bit 0-3 */
prefix$and lit '10h'; /* prefix flag, bit 4 */
/* "OR"-masks for codemacro head flag */
declare
prefix$on lit '10h'; /* PREFIX on flag */
/* "AND"-masks for modifier-letter/range spec. byte */
declare
modletter$bit lit '07h', /* bits 0-2 */
range$spec$bit lit '0f8h', /* bits 3-7 */
modlettercount lit '0', /* bit position counters */
rangespeccount lit '3';
/* "OR"-masks for range-specifier bits */
declare
norange lit '0', /* no range specfier (bits 3-4) */
singlerange lit '08h', /* single range */
doublerange lit '10h', /* double range */
rangeand lit '18h',
number$range lit '0', /* bit 5 */
register$range lit '20h',
rangetypeand lit '20h';
$list


View File

@@ -0,0 +1,118 @@
$nolist
/*
modified 6/16/81 R. Silberstein
*/
declare
aaa1 byte external,
aad1 byte external,
aam1 byte external,
aas1 byte external,
adc11 byte external,
add11 byte external,
and10 byte external,
call3 byte external,
callf2 byte external,
cbw1 byte external,
clc1 byte external,
cld1 byte external,
cli1 byte external,
cmc1 byte external,
cmp11 byte external,
cmps2 byte external,
CMPSB1 BYTE EXTERNAL,
CMPSW1 BYTE EXTERNAL,
cwd1 byte external,
daa1 byte external,
das1 byte external,
dec3 byte external,
div2 byte external,
esc3 byte external,
hlt1 byte external,
idiv2 byte external,
imul2 byte external,
in4 byte external,
inc3 byte external,
int2 byte external,
into1 byte external,
iret1 byte external,
ja1 byte external,
jae1 byte external,
jb1 byte external,
jbe1 byte external,
jcxz1 byte external,
je1 byte external,
jg1 byte external,
jge1 byte external,
jl1 byte external,
jle1 byte external,
jmp2 byte external,
jmpf2 byte external,
jmps1 byte external,
jne1 byte external,
jno1 byte external,
jnp1 byte external,
jns1 byte external,
jo1 byte external,
jp1 byte external,
js1 byte external,
lahf1 byte external,
lds1 byte external,
les1 byte external,
lea1 byte external,
lock1 byte external,
lods2 byte external,
LODSB1 BYTE EXTERNAL,
LODSW1 BYTE EXTERNAL,
loop1 byte external,
loope1 byte external,
loopne1 byte external,
mov17 byte external,
movs2 byte external,
MOVSB1 BYTE EXTERNAL,
MOVSW1 BYTE EXTERNAL,
mul2 byte external,
neg2 byte external,
nop1 byte external,
not2 byte external,
or10 byte external,
out4 byte external,
pop4 byte external,
popf1 byte external,
push3 byte external,
pushf1 byte external,
rcl4 byte external,
rcr4 byte external,
rep1 byte external,
repe1 byte external,
repne1 byte external,
ret3 byte external,
retf3 byte external,
rol4 byte external,
ror4 byte external,
sahf1 byte external,
sal4 byte external,
sar4 byte external,
sbb11 byte external,
scas2 byte external,
SCASB1 BYTE EXTERNAL,
SCASW1 BYTE EXTERNAL,
shr4 byte external,
stc1 byte external,
std1 byte external,
sti1 byte external,
stos2 byte external,
STOSB1 BYTE EXTERNAL,
STOSW1 BYTE EXTERNAL,
sub11 byte external,
test10 byte external,
wait1 byte external,
xchg6 byte external,
xlat1 byte external,
xor10 byte external;
$list


View File

@@ -0,0 +1,57 @@
$nolist
clearcmindex: proc external;
end clearcmindex;
emit: proc external; /* emit codebytes for an instruction */
end emit;
emitdummies: proc external; /* emit dummy (NO-OPs) bytes if error */
end emitdummies;
commandtype: proc(comno,lg,pt) byte external;
dcl (comno,lg) byte,pt address;
end commandtype;
mDBNrout: proc external;
end mDBNrout;
mDBFrout: proc external;
end mDBFrout;
mDWNrout: proc external;
end mDWNrout;
mDWFrout: proc external;
end mDWFrout;
mDDFrout: proc external;
end mDDFrout;
mRELBrout: proc external;
end mRELBrout;
mRELWrout: proc external;
end mRELWrout;
mNOSEGFIXrout: proc external;
end mNOSEGFIXrout;
mSEGFIXrout: proc external;
end mSEGFIXrout;
mMODRM1rout: proc external;
end mMODRM1rout;
mMODRM2rout: proc external;
end mMODRM2rout;
mDBITrout: proc external;
end mDBITrout;
/* test if operands match instruction */
searchformatch: proc byte external;
end searchformatch;
$list


View File

@@ -0,0 +1,74 @@
$nolist
/*
modified 4/13/81 R. Silberstein
modified 9/2/81 R. Silberstein
*/
/* Error numbers: */
dcl
laboutofrange lit '22', /* label out of range */
misssegminfo lit '23'; /* missing segment info in operand */
/* Structures: */
dcl
symbolstruc lit 'struc(
length addr,
stype byte,
sflag byte,
segment addr,
offset addr,
baseindex byte)',
operandstruc lit 'symbolstruc';
/* define bits of SFLAG of structures above */
dcl
type$bit lit '7h', /* bit 0-2 */
segtypebit lit '18h', /* bit 3-4 */
segmbit lit '20h', /* bit 5 */
iregbit lit '40h', /* bit 6 */
bregbit lit '80h', /* bit 7 */
/* left-shift counters */
typecount lit '0',
segtypecount lit '3',
segmcount lit '5',
iregcount lit '6',
bregcount lit '7',
/* define bits of BASEINDEX byte of structures above */
indexregbit lit '01h', /* bit 0 */
baseregbit lit '02h', /* bit 1 */
nooverridebit lit '40h', /* bit 6 */
/* left shift counters */
indexregcount lit '0',
baseregcount lit '1',
noovercount lit '6';
/* Mischellaneous global variables: */
dcl
ABSADDR (4) BYTE EXTERNAL, /* ABSOLUTE ADDRESS FIELD */
cip addr external, /* current instruction pointer */
csegvalue addr external, /* current segment value */
noerror byte external, /* errorflag in codemacro decoding */
firstmacroptr address external, /* pointer at first codemacro */
macroptr address external, /* current pointer within macros */
fullsymbtab byte external, /* full if symboltable is full */
nooper byte external, /* no of instruction operands */
operands(4) operandstruc /* instruction operands,max 4 */
external;
$list


View File

@@ -0,0 +1,12 @@
$nolist
/* Special file devices if not diskfile : */
dcl
null lit '''Z''-''A''', /* file devices */
printer lit '''Y''-''A''',
console lit '''X''-''A''',
validdisk lit '''P''-''A''';
$list


View File

@@ -0,0 +1,7 @@
$nolist
decodeline: proc external;
end decodeline;
$list


View File

@@ -0,0 +1,24 @@
$nolist
dcl
pass byte external, /* current pass no, 1,2,3 */
prefix (240) byte external, /* prefix to source line */
prefixptr byte external, /* pointer to prefix buffer */
accumsave(80) byte external,
acclensave byte external,
/* Mischellaneous variables: */
fullsymbtab byte external, /* full if symboltable is full */
currentsymbol symbolstruc /* current scanned symbol */
external,
symbtabadr address external, /* pointer at symbol in table */
codemacroptr address external, /* pointer to found codemacro */
codemacro$flag byte external; /* true if building a codemacro */
$list


View File

@@ -0,0 +1,132 @@
$nolist
/*
modified 7/24/81 R. Silberstein
*/
/* Symbol types : */
dcl
reg lit '0', /* register */
pseudo lit '1', /* pseudo instruction */
code lit '2', /* instruction */
string lit '3', /* character string */
spec lit '4', /* special character */
number lit '5', /* 8 or 16 bit number */
variable lit '6',
lab lit '7', /* label */
operator lit '8', /* operator in expressions */
doubledefined lit '0f9h', /* doubled defined symbol */
neglected lit '0fah', /* neglected symb., never to be def. */
ident lit '0fbh', /* identificator, scanner output */
error lit '0fch', /* error, scanner output */
udefsymb lit '0fdh', /* undefined symbol */
symbol lit '0feh', /* variable,label or undefined symb. */
deletedsymb lit '0ffh'; /* deleted symbol (not used */
/* Symbol description values */
dcl
nil lit '0', /* no specification */
byt lit '1', /* symbol is 8-bit type */
wrd lit '2', /* symbol is 16 bit type */
dwrd lit '4'; /* symbol is 2*16 bit type
or a segment register */
/* Register values : */
dcl
rax lit '0', /* 16 bit registers */
rcx lit '1',
rdx lit '2',
rbx lit '3',
rsp lit '4',
rbp lit '5',
rsi lit '6',
rdi lit '7',
ral lit '0', /* 8 bit registers */
rcl lit '1',
rdl lit '2',
rbl lit '3',
rah lit '4',
rch lit '5',
rdh lit '6',
rbh lit '7',
res lit '0', /* segment registers */
rcs lit '1',
rss lit '2',
rds lit '3';
/* Pseudo instructions: */
dcl
pdb lit '0',
pdd lit '1',
pdw lit '2',
pif lit '3',
prs lit '4',
pend lit '5',
pequ lit '6',
porg lit '7',
pcseg lit '8',
pdbit lit '9',
pdseg lit '10',
pendm lit '11',
peseg lit '12',
prelb lit '13',
prelw lit '14',
psseg lit '15',
pendif lit '16',
pmodrm lit '17',
ptitle lit '18',
psegfix lit '19',
pinclude lit '20',
peject lit '21',
psimform lit '22',
pnosegfix lit '23',
ppagesize lit '24',
pcodemacro lit '25',
ppagewidth lit '26',
plist lit '27',
pnolist lit '28',
prb lit '29', /* added in vers. 2.0 */
prw lit '30',
PIFLIST LIT '31',
PNOIFLIST LIT '32';
/* Symbolic operators */
dcl
oshort lit '0', /* 8-bit value of expression */
oor lit '1', /* logical OR */
oxor lit '2', /* logical XOR */
oand lit '3', /* logical AND */
onot lit '4', /* logical NOT */
oeq lit '5', /* equal */
ogt lit '6', /* greater */
oge lit '7', /* greater or equal */
olt lit '8', /* less */
ole lit '9', /* less or equal */
one lit '10', /* not equal */
omod lit '11', /* arithmetic MOD */
oshl lit '12', /* shift left */
oshr lit '13', /* shift rigth */
optr lit '14', /* take type of 1. op, value of 2. */
ooffset lit '15', /* offset value of operand */
oseg lit '16', /* segment value of operand */
otype lit '17', /* type value of operand */
olength lit '18', /* length attribute of variables */
olast lit '19', /* length - 1 */
leftbracket lit '''[''',
rightbracket lit ''']''';
$list


View File

@@ -0,0 +1,8 @@
$nolist
errmsg: proc(errno) external;
dcl errno byte;
end errmsg;
$list


View File

@@ -0,0 +1,44 @@
$nolist
/*
modified 4/24/81 R. Silberstein
*/
/*
This is all assembler error numbers.
For each error number there is a
corresponding error TEXT. The texts are
defined in the module ERMOD.PLM.
*/
dcl
firstitem lit '0', /* error in first item */
missingpseudo lit '1',
illegalpseudo lit '2',
doubledefvar lit '3', /* doubled defined errors: */
doubledeflab lit '4',
illegalmacro lit '5', /* illegal instruction name */
end$of$line$err lit '6', /* garabage at end of line */
opmismatch lit '7', /* operands mismatch instruction */
illioper lit '8', /* illegal instruction operand */
missinstr lit '9', /* missing instruction */
udefsymbol lit '10', /* undefined element of expression */
pseudooperr lit '11', /* illegal pseudo operand */
nestediferr lit '12', /* nested IF illegal - ignored */
ifparerr lit '13', /* illegal IF operand - IF ignored */
missiferr lit '14', /* no matching "IF" for "ENDIF" */
neglecterr lit '15', /* neglected symbol */
doubledefsymb lit '16', /* doubled defined symbol */
instrerr lit '17', /* instruction not in code segm. */
filesynterr lit '18', /* file name syntax error */
nestedincludeerr lit '19', /* nested INCLUDE not legal */
illexprelem lit '20', /* illegal expression element */
misstypeinfo lit '21', /* missing type info in operands */
laboutofrange lit '22', /* label out of range */
misssegminfo lit '23', /* missing segment info in operand */
codemacroerr lit '24'; /* error in codemacrobuilding */
$list


View File

@@ -0,0 +1,22 @@
$nolist
dcl
cip addr external, /* current instruction pointer */
csegtype byte external, /* current segment type, code,data */
csegvalue addr external, /* current segment value */
csegspec byte external, /* true if segment value specified */
dspec byte external,
curdseg addr external, /* current data segment value */
token struc( /* actual token scanned */
type byte,
descr byte,
value addr) external, /* token value */
nextch byte external, /* next input character */
acclen byte external, /* accumulator length */
accum(80) byte external, /* actual token scanned */
nooper byte external, /* no of instruction operands */
operands(4) operandstruc /* instruction operands,max 4 */
external;
$list


View File

@@ -0,0 +1,24 @@
$nolist
/*
modified 8/19/81 R. Silberstein
*/
operand: proc byte external;
end operand;
NOFORWARDOPER: PROC BYTE EXTERNAL;
END NOFORWARDOPER;
expression: proc(pt) byte external;
dcl pt address;
end expression;
noforwardexpr: proc(pt) byte external;
dcl pt address;
end noforwardexpr;
$list


View File

@@ -0,0 +1,147 @@
$nolist
/*
modified 4/24/81 R. Silberstein
*/
/* Symbol types : */
dcl
reg lit '0', /* register */
pseudo lit '1', /* pseudo instruction */
code lit '2', /* instruction */
string lit '3', /* character string */
spec lit '4', /* special character */
number lit '5', /* 8 or 16 bit number */
variable lit '6',
lab lit '7', /* label */
operator lit '8', /* operator in expressions */
doubledefined lit '0f9h', /* doubled defined symbol */
neglected lit '0fah', /* neglected symb.,never to be def. */
ident lit '0fbh', /* identificator, scanner output */
udefsymb lit '0fdh', /* undefined symbol */
symbol lit '0feh', /* variable,label or undef. symb. */
deletedsymb lit '0ffh'; /* deleted symbol (not used */
/* Symbol description values */
dcl
nil lit '0', /* no specification */
byt lit '1', /* symbol is 8-bit type */
wrd lit '2', /* symbol is 16 bit type */
dwrd lit '4'; /* symbol is 2*16 bit type
or a segment register */
/* Register values : */
dcl
rbx lit '3',
rbp lit '5',
rsi lit '6',
rdi lit '7',
res lit '0', /* segment registers */
rcs lit '1',
rss lit '2',
rds lit '3';
/* Symbolic operators */
dcl
oshort lit '0', /* 8-bit value of expression */
oor lit '1', /* logical OR */
oxor lit '2', /* logical XOR */
oand lit '3', /* logical AND */
onot lit '4', /* logical NOT */
oeq lit '5', /* equal */
ogt lit '6', /* greater */
oge lit '7', /* greater or equal */
olt lit '8', /* less */
ole lit '9', /* less or equal */
one lit '10', /* not equal */
omod lit '11', /* arithmetic MOD */
oshl lit '12', /* shift left */
oshr lit '13', /* shift rigth */
optr lit '14', /* take type of 1. op, value of 2. */
ooffset lit '15', /* offset value of operand */
oseg lit '16', /* segment value of operand */
otype lit '17', /* type value of operand */
olength lit '18', /* length attribute of variables */
olast lit '19', /* length - 1 */
leftbracket lit '''[''',
rightbracket lit ''']''';
dcl
operandstruc lit 'struc(
length addr,
stype byte,
sflag byte,
segment addr,
offset addr,
baseindex byte)',
/* define bits of SFLAG of structures above */
type$bit lit '7h', /* bit 0-2 */
segtypebit lit '18h', /* bit 3-4 */
segmbit lit '20h', /* bit 5 */
iregbit lit '40h', /* bit 6 */
bregbit lit '80h', /* bit 7 */
/* left-shift counters */
typecount lit '0',
segtypecount lit '3',
segmcount lit '5',
iregcount lit '6',
bregcount lit '7',
/* define bits of BASEINDEX byte of structures above */
indexregbit lit '7', /* bit 0-2 */
baseregbit lit '38h', /* bit 3-5 */
nooverridebit lit '40h', /* bit 6 */
/* left shift counters */
indexregcount lit '0',
baseregcount lit '3',
noovercount lit '6';
dcl
udefsymbol lit '10'; /* undefined elem. of expression */
newsymbol: proc(lg,stradr,result) byte external;
dcl lg byte,(stradr,result) addr;
end newsymbol;
findsymbol: proc(lg,stradr,result) byte external;
dcl lg byte,(stradr,result) addr;
end findsymbol;
getattributes: proc(symbadr,dest) external;
dcl (symbadr,dest) addr;
end getattributes;
enterattributes: proc(symbadr,source) external;
dcl (symbadr,source) addr;
end enterattributes;
scan: proc external;
end scan;
specialtoken: proc (tok) byte external;
dcl tok byte;
end specialtoken;
bracketexpr: proc (pt) byte external;
dcl pt address;
end bracketexpr;
$list


View File

@@ -0,0 +1,71 @@
$nolist
/*
modified 3/28/81 R. Silberstein
modified 6/16/81 R. Silberstein
*/
outhexbyte: proc(ch) external;
dcl ch byte;
end outhexbyte;
outprintbyte: proc(ch) external;
dcl ch byte;
end outprintbyte;
outsymbolbyte: proc(ch) external;
dcl ch byte;
end outsymbolbyte;
insourcebyte: proc byte external;
end insourcebyte;
inincludebyte: proc byte external;
end inincludebyte;
opensource: proc external;
end opensource;
openinclude: proc external;
end openinclude;
openhex: proc external;
end openhex;
openprint: proc external;
end openprint;
opensymbol: proc external;
end opensymbol;
close$source: proc external;
end close$source;
rewindsource: proc external;
end rewindsource;
close$include: proc external;
end close$include;
closehex: proc external;
end closehex;
closeprint: proc external;
end closeprint;
closesymbol: proc external;
end closesymbol;
i$file$setup: proc(dev,filnam,filtyp) external;
dcl dev byte,(filnam,filtyp) addr;
end i$file$setup;
filesetup: proc byte external;
end filesetup;
$list


View File

@@ -0,0 +1,114 @@
$nolist
/*
modified 3/28/81 R. Silberstein
modified 4/16/81 R. Silberstein
modified 7/24/81 R. Silberstein
modified 9/2/81 R. Silberstein
*/
dcl
pass byte external, /* current pass no, 1,2,3 */
/* address counters */
cip addr external, /* current instruction pointer */
csegtype byte external, /* current segment type, code,data,
stack or extra data */
csegvalue addr external, /* current segment value */
csegspec byte external, /* true if segment value specified */
escip addr external, /* current ES instruction pointer */
cscip addr external, /* current CS instruction pointer */
sscip addr external, /* current SS instruction pointer */
dscip addr external, /* current DS instruction pointer */
curcseg addr external, /* current code segment value */
curdseg addr external, /* current data segment value */
cursseg addr external, /* current stack segment value */
cureseg addr external, /* current extra segment value */
cspec byte external, /* true if code segm. value given */
dspec byte external, /* true if data segm. value given */
sspec byte external, /* true if stack segment given */
espec byte external, /* true if extra segment given */
/* print output parameters */
print$on byte external, /* on/off flag */
printswitchoff byte external, /* set/reset by NOLIST/LIST */
IFLIST BYTE EXTERNAL, /* SET/RESET BY IFLIST/NOIFLIST */
maxcol byte external, /* pagewidth */
sourcename (12) byte external, /* source file name */
savesource (12) byte external, /* source file during INLUDE file */
printdevice byte external, /* printfile device */
SYMBOLDEVICE BYTE EXTERNAL, /* SYMBOL FILE DEVICE */
title (30) byte external, /* user specified program title */
pagesize byte external, /* page size */
simform byte external, /* true if formfeed simulation */
sourcebuf (80) byte external, /* source input to be printed */
sourceptr byte external, /* source buffer pointer */
prefix (240) byte external, /* prefix to source line */
prefixptr byte external, /* pointer to prefix buffer */
ABSADDR (4) BYTE EXTERNAL, /* ABSOLUTE ADDRESS FIELD */
/* io error status */
errors addr external, /* counts no of errors */
/* scanner variables: */
token struc( /* actual token scanned */
type byte, /* token type, legal values :
reg - register
pseudo - pseudo code
string - text string
spec - special character
number - number
operator - aritmetic operator
ident - identifier */
descr byte, /* token description, legal values:
nil - no specification
byte - 8 bit type
word - 16 bit type
dword - 32 bit type */
value addr) external, /* token value */
nextch byte external, /* next input character */
acclen byte external, /* accumulator length */
accum(80) byte external, /* actual token scanned */
accumsave(80) byte external,
acclensave byte external,
eofset byte external, /* true if end-of-file found */
/* Mischellaneous variables: */
intel$hex$on byte external, /* true if INTEL hex format */
noerror byte external, /* codemacro decoding errorflag */
errorprinted byte external, /* true if an error is printed */
firstmacroptr address external, /* pointer at first codemacro */
macroptr address external, /* current pointer within macros */
fullsymbtab byte external, /* full if symboltable is full */
include$on byte external, /* true if INCLUDEfile input */
IFLEVEL BYTE EXTERNAL, /* IF-ENDIF NESTING LEVEL */
currentsymbol symbolstruc /* current scanned symbol */
external,
symbtabadr address external, /* pointer at symbol in table */
nooper byte external, /* no of instruction operands */
operands(4) operandstruc /* instruction operands,max 4 */
external,
codemacroptr address external, /* pointer to found codemacro */
help(5) byte external, /* ascii number scratch area */
i byte external, /* scratch variable */
default$drive byte external, /* default disk drive */
include$default byte external, /* default drive for include file */
codemacro$flag byte external; /* true if building a codemacro */
globalinit: procedure external; /* initiate some globals */
end globalinit;
$list


View File

@@ -0,0 +1,7 @@
$nolist
instruction: proc external;
end instruction;
$list


View File

@@ -0,0 +1,17 @@
$nolist
dcl
acclen byte external, /* accumulator length */
accum(80) byte external, /* actual token scanned */
/* Mischellaneous variables: */
noerror byte external, /* errorflag in codemacro decoding */
firstmacroptr address external, /* pointer at first codemacro */
macroptr address external, /* current pointer within macros */
nooper byte external, /* no of instruction operands */
operands(4) operandstruc /* instruction operands,max 4 */
external,
codemacroptr address external; /* pointer to found codemacro */
$list

View File

@@ -0,0 +1,113 @@
$nolist
/* Template for all BDOS calls */
/*
modified 3/26/81 R. Silberstein
modified 9/14/81 R. Silberstein
*/
mon1: procedure(func,info) external;
declare func byte,
info address;
end mon1;
mon2: procedure(func,info) byte external;
declare func byte,
info address;
end mon2;
declare fcb(1) byte external;
declare fcb16(1) byte external;
declare tbuff(1) byte external;
declare endbuf address external;
/**************************************
* *
* B D O S Externals *
* *
**************************************/
system$reset:
procedure external;
end system$reset;
read$console:
procedure byte external;
end read$console;
write$console:
procedure (char) external;
declare char byte;
end write$console;
write$list:
procedure (char) external;
declare char byte;
end write$list;
constat:
procedure byte external;
end constat;
VERSION: PROCEDURE ADDRESS EXTERNAL;
END VERSION;
select$disk:
procedure (disk$number) external;
declare disk$number byte;
end select$disk;
open$file:
procedure (fcb$address) byte external;
declare fcb$address address;
end open$file;
OPEN$RO$FILE: PROCEDURE (FCB$ADDRESS) BYTE EXTERNAL;
DECLARE FCB$ADDRESS ADDRESS;
END OPEN$RO$FILE;
close$file:
procedure (fcb$address) byte external;
declare fcb$address address;
end close$file;
delete$file:
procedure (fcb$address) external;
declare fcb$address address;
end delete$file;
read$record:
procedure (fcb$address) byte external;
declare fcb$address address;
end read$record;
write$record:
procedure (fcb$address) byte external;
declare fcb$address address;
end write$record;
create$file:
procedure (fcb$address) byte external;
declare fcb$address address;
end create$file;
interrogate$disk:
procedure byte external;
end interrogate$disk;
set$DMA$address:
procedure (DMA$address) external;
declare DMA$address address;
end set$DMA$address;
crlf: procedure external;
end crlf;
$list


View File

@@ -0,0 +1,35 @@
$nolist
$eject
/* PL/M language text macros: */
declare
lit literally 'literally',
dcl lit 'declare',
init lit 'initial',
true lit '0ffh',
false lit '0',
addr lit 'address',
struc lit 'structure',
proc lit 'procedure',
reent lit 'reentrant',
then$do lit 'then do;',
else$do lit 'end; else do;',
end$if lit 'end',
forever lit 'while true',
end$forever lit 'end',
end$while lit 'end',
end$case lit 'end',
end$do lit 'end',
end$module lit 'end',
end$proc lit 'end',
cr lit '0dh',
lf lit '0ah',
tab lit '09h',
formfeed lit '0ch',
end$of$file lit '1ah',
space lit '20h';
$list


View File

@@ -0,0 +1,46 @@
$nolist
/*
modified 3/28/81 R. Silberstein
*/
dcl
pass byte external, /* current pass no, 1,2,3 */
/* address counters */
cip addr external, /* current instruction pointer */
csegtype byte external, /* current segment type, code,data,
stack or extra data */
/* print output parameters */
print$on byte external, /* on/off flag */
printswitchoff byte external, /* set/reset by NOLIST/LIST */
IFLIST BYTE EXTERNAL, /* SET/RESET BY IFLIST/NOIFLIST */
maxcol byte external, /* pagewidth */
printdevice byte external, /* printfile device */
simform byte external, /* true if formfeed simulation */
/* io error status */
errors addr external, /* counts no of errors */
eofset byte external, /* true if end-of-file found */
/* Mischellaneous variables: */
errorprinted byte external, /* true if an error is printed */
fullsymbtab byte external, /* full if symboltable is full */
include$on byte external, /* true if INCLUDEfile input */
IFLEVEL BYTE EXTERNAL, /* IF-ENDIF NESTING LEVEL */
help(5) byte external, /* ascii number scratch area */
i byte external; /* scratch variable */
globalinit: procedure external; /* initiate some globals */
end globalinit;
$list


View File

@@ -0,0 +1,67 @@
$nolist
/*
modified 6/16/81 R. Silberstein
*/
dcl
push byte external,
repz byte external,
aaa byte external,
movs byte external,
pushf byte external,
MOVSB BYTE EXTERNAL,
adc byte external,
add byte external,
CMPSW BYTE EXTERNAL,
ja byte external,
dec byte external,
loopne byte external,
repnz byte external,
jae byte external,
jg byte external,
clc byte external,
iand byte external,
loopz byte external,
aas byte external,
jl byte external,
in byte external,
cli byte external,
jo byte external,
inc byte external,
lahf byte external,
icall byte external,
jne byte external,
cwd byte external,
jnbe byte external,
cmp byte external,
ior byte external,
callf byte external,
div byte external,
les byte external,
sar byte external,
jmp byte external,
hlt byte external,
lock byte external,
xchg byte external,
ret byte external,
idiv byte external,
jmpf byte external,
mul byte external,
pop byte external,
sti byte external,
inot byte external,
mov byte external,
cmps byte external,
iret byte external,
popf byte external,
imul byte external,
out byte external,
xlat byte external,
jmps byte external,
loope byte external;
$list


View File

@@ -0,0 +1,15 @@
$nolist
/* Convenient literals to compress source: */
declare
h literally 'structure(n address,l byte,p address',
opcod2 literally 'h,a(2) byte)',
opcod3 literally 'h,a(3) byte)',
opcod4 literally 'h,a(4) byte)',
opcod5 literally 'h,a(5) byte)',
opcod6 literally 'h,a(6) byte)';
$list


View File

@@ -0,0 +1,41 @@
!
! OH86.COM: VAX/VMS DCL Command Procedure for running HH86.EXE
! (HH86 converts a file from one of Intel's 8086 object module
! formats into a hex format for transmission over inadequate
! communications lines.)
! Usage:
! @OH86 filename
! where `filename' names a file output from Intel's LOCator (OLOC86).
! OH86 appends "." to input filename (if it did not already have a
! file extension) and sets up logical names
!
$ filename := 'p1'
$ if p2 .nes. "" then goto err
!
$ getname:
$ if filename .nes. "" then goto runit
$ inquire filename "File_"
$ if 'f$locate(" ",filename)' .ne. 'f$length(filename)' then goto err
$ if filename .nes. "" then goto getname
!
$ runit:
$ dot = 'f$locate(".",filename)'
$ len = 'f$length(filename)'
$ name := 'f$extract(0, dot ,filename)'
$ typelen = len - dot
$ typex := 'f$extract(dot, typelen, filename)
$ if typex .eqs. "" then typex := .
!
$ assign 'name''typex' h86 /user_mode
$ assign 'name'.h86 h86hex /user_mode
$ assign 'name'.sym h86sym /user_mode
$ assign 'name'.lin h86lin /user_mode
!
$ r hh86
$ exit
!
err:
$ write sys$output "Use One Parameter Only - The Object File Name"
$ write sys$output "Output Files Are .H86, .SYM and .LIN"
$ exit


View File

@@ -0,0 +1,21 @@
!
! OldIntel.com -- this VAX/VMS DCL command file sets up DCL symbols
! (for use as commands) which allow access to Intel's first
! generation of VAX->8086 cross-tools. These are incompatible
! in unknown ways with the more current ones we use.
!
$ set message/noid
$ ASS SYS$INPUT: CI:
$ ASS SYS$OUTPUT: CO:
$ ASS _drb2: F1:
$ ASS _drb2: F2:
$ ASS _drb2: F3:
$ ASS _drb2: F4:
$ ASS _drb2: F5:
$ ASS SYS$ERROR: FOR007
$ oplm86 :== $sys$mds:plm86
$ oasm86 :== $sys$mds:asm86
$ olink86 :== $sys$mds:link86
$ oloc86 :== $sys$mds:loc86
$ oh86 :== @oh86.com


View File

@@ -0,0 +1,14 @@
$nolist
emitinit: proc external;
end emitinit;
emitterminate: proc external;
end emitterminate;
emitcodebyte: proc(ch,typ) external;
dcl (ch,typ) byte;
end emitcodebyte;
$list


View File

@@ -0,0 +1,31 @@
$nolist
/* Output hex-record types: */
dcl
eoftype lit '01h', /* Common to both hex formats */
starttype lit '03h',
INTELdata lit '00h', /* INTEL hex format */
INTELsegment lit '02h',
DRcodedata lit '81h', /* Digital Research hex format */
DRdatadata lit '82h',
DRstackdata lit '83h',
DRextradata lit '84h',
DRcodesegm lit '85h',
DRdatasegm lit '86h',
DRstacksegm lit '87h',
DRextrasegm lit '88h',
CSdata lit '04h', /* Data types used inside assembler */
DSdata lit '05h',
SSdata lit '06h',
ESdata lit '07h',
CSvalue lit '08h',
DSvalue lit '09h',
SSvalue lit '0ah',
ESvalue lit '0bh';
$list


View File

@@ -0,0 +1,9 @@
$nolist
pfind: proc (n,s,a) byte external;
dcl
n byte,
(s,a) address;
end pfind;
$list


View File

@@ -0,0 +1,33 @@
$nolist
/*
modified 7/27/81 R. Silberstein
*/
printsinglebyte: proc(ch) external;
dcl ch byte;
end printsinglebyte;
printcrlf: proc external;
end printcrlf;
printnewpage: proc external;
end printnewpage;
printsourceline: proc external;
end printsourceline;
printinit: proc external;
end printinit;
printterminate: proc (USEFACT) external;
DECLARE USEFACT BYTE;
end printterminate;
eject: proc external;
end eject;
$list


View File

@@ -0,0 +1,44 @@
$nolist
/*
modified 4/9/81 R. Silberstein
*/
LISTCIP: PROCEDURE EXTERNAL;
END LISTCIP;
DBrout: proc external;
end DBrout;
DWrout: proc external;
end DWrout;
DDrout: proc external;
end DDrout;
RSrout: proc (typ) external;
dcl typ byte;
end RSrout;
CSEGrout: proc external;
end CSEGrout;
DSEGrout: proc external;
end DSEGrout;
SSEGrout: proc external;
end SSEGrout;
ESEGrout: proc external;
end ESEGrout;
ORGrout: proc external;
end ORGrout;
EQUrout: proc external;
end EQUrout;
$list


View File

@@ -0,0 +1,16 @@
$nolist
/*
modified 4/24/81 R. Silberstein
*/
dcl
end$of$line$err lit '6', /* garabage at end of line */
pseudooperr lit '11', /* illegal pseudo operand */
illexprelem lit '20', /* illegal expression element */
misssegminfo lit '23'; /* missing segment info in operand */
$list


View File

@@ -0,0 +1,49 @@
$nolist
/*
modified 7/24/81 R. Silberstein
*/
IFrout: proc external;
end IFrout;
ENDIFrout: proc external;
end ENDIFrout;
INCLUDErout: proc external;
end INCLUDErout;
ENDrout: proc external;
end ENDrout;
PAGESIZErout: proc external;
end PAGESIZErout;
PAGEWIDTHrout: proc external;
end PAGEWIDTHrout;
TITLErout: proc external;
end TITLErout;
EJECTrout: proc external;
end EJECTrout;
SIMFORMrout: proc external;
end SIMFORMrout;
LISTrout: proc external;
end LISTrout;
NOLISTrout: proc external;
end NOLISTrout;
IFLISTROUT: PROC EXTERNAL;
END IFLISTROUT;
NOIFLISTROUT: PROC EXTERNAL;
END NOIFLISTROUT;
$list


View File

@@ -0,0 +1,57 @@
$nolist
/*
modified 7/24/81 R. Silberstein
*/
dcl
pass byte external, /* current pass no, 1,2,3 */
/* print output parameters */
print$on byte external, /* on/off flag */
printswitchoff byte external, /* set/reset by NOLIST/LIST */
IFLIST BYTE EXTERNAL, /* SET/RESET BY IFLIST/NOIFLIST */
maxcol byte external, /* pagewidth */
title (30) byte external, /* user specified program title */
pagesize byte external, /* page size */
simform byte external, /* true if formfeed simulation */
sourceptr byte external, /* source buffer pointer */
/* scanner variables: */
token struc( /* actual token scanned */
type byte, /* token type, legal values :
reg - register
pseudo - pseudo code
string - text string
spec - special character
number - number
operator - aritmetic operator
ident - identifier */
descr byte, /* token description, legal values:
nil - no specification
byte - 8 bit type
word - 16 bit type
dword - 32 bit type */
value addr) external, /* token value */
nextch byte external, /* next input character */
acclen byte external, /* accumulator length */
accum(80) byte external, /* actual token scanned */
eofset byte external, /* true if end-of-file found */
/* Mischellaneous variables: */
include$on byte external, /* true if INCLUDEfile input */
IFLEVEL BYTE EXTERNAL, /* IF-ENDIF NESTING LEVEL */
operands(4) operandstruc /* instruction operands,max 4 */
external,
include$default byte external; /* default drive for include file */
$list


View File

@@ -0,0 +1,24 @@
$nolist
scaninit: proc external;
end scaninit;
scan: proc external;
end scan;
skip$rest$of$line: proc external;
end skip$rest$of$line;
specialtoken: proc (tok) byte external;
dcl tok byte;
end specialtoken;
skip$until: proc (tok) byte external;
dcl tok byte;
end skip$until;
emptyline: proc byte external;
end emptyline;
$list


View File

@@ -0,0 +1,80 @@
$nolist
/*
modified 3/27/81 R. Silberstein
modified 3/28/81 R. Silberstein
modified 4/13/81 R. Silberstein
*/
/* This file contains all structure definitions used */
dcl
file$o$structure lit 'struc(
disk byte,
fcbblock(33) byte,
bufptr addr,
buffer(512) byte)',
file$i$structure lit 'struc(
disk byte,
fcbblock(33) byte,
bufptr addr,
buffer(1024) byte)',
symbolstruc lit 'struc(
length addr,
stype byte,
sflag byte,
segment addr,
offset addr,
baseindex byte)',
operandstruc lit 'symbolstruc',
symbolhead lit 'struc(
next addr,
slength byte,
length addr,
stype byte,
sflag byte,
segment addr,
offset addr,
baseindex byte)',
codemacrohead lit 'struc(
next addr,
slength byte,
defptr addr)',
/* define bits of SFLAG of structures above */
type$bit lit '7h', /* bit 0-2 */
segtypebit lit '18h', /* bit 3-4 */
segmbit lit '20h', /* bit 5 */
iregbit lit '40h', /* bit 6 */
bregbit lit '80h', /* bit 7 */
/* left-shift counters */
typecount lit '0',
segtypecount lit '3',
segmcount lit '5',
iregcount lit '6',
bregcount lit '7',
/* define bits of BASEINDEX byte of structures above */
indexregbit lit '01h', /* bit 0 */
baseregbit lit '02h', /* bit 1 */
nooverridebit lit '40h', /* bit 6 */
/* left shift counters */
indexregcount lit '0',
baseregcount lit '1',
noovercount lit '6';
$list


View File

@@ -0,0 +1,17 @@
$nolist
typecalc: proc(val) byte external;
dcl val addr;
end typecalc;
wrdtest: proc(n) byte external;
dcl n addr;
end wrdtest;
copy: procedure(n,s,d) external;
dcl n byte,
(s,d) addr;
end copy;
$list


View File

@@ -0,0 +1,60 @@
$nolist
/*
modified 3/26/81 R. Silberstein
modified 3/28/81 R. Silberstein
*/
outtext: procedure (t) external;
dcl t addr;
end outtext;
FILEABORT: PROCEDURE (FCBADR, TEXTADR) EXTERNAL;
DECLARE (FCBADR, TEXTADR) ADDRESS;
END FILEABORT;
fill: procedure(ch,n,pt) external;
dcl (ch,n) byte,pt addr;
end fill;
digit: procedure(ch) byte external;
dcl ch byte;
end digit;
letter: procedure(ch) byte external;
dcl ch byte;
end letter;
alphanumeric: proc(ch) byte external;
dcl ch byte;
end alphanumeric;
asciichar: proc(ch) byte external;
dcl ch byte;
end asciichar;
upper: procedure(ch) byte external;
dcl ch byte;
end upper;
equal: procedure(n,s,d) byte external;
dcl n byte,
(s,d) addr;
end equal;
hex1out: proc(n,d) external;
dcl n byte,d addr;
end hex1out;
hex2out: proc(n,d) external;
dcl n addr,d addr;
end hex2out;
decout: proc(n,d) external;
dcl n addr,d addr;
end decout;
$list


View File

@@ -0,0 +1,51 @@
$nolist
/*
modified 7/24/81 R. Silberstein
*/
dcl freept addr external;
DCL END$OF$SYMBTAB ADDR EXTERNAL;
symbterminate: proc external;
end symbterminate;
symbinit: proc external;
end symbinit;
newsymbol: proc(lg,stradr,result) byte external;
dcl lg byte,(stradr,result) addr;
end newsymbol;
newmacro: proc(lg,stradr,macdefpt) byte external;
dcl lg byte,(stradr,macdefpt) addr;
end newmacro;
findsymbol: proc(lg,stradr,result) byte external;
dcl lg byte,(stradr,result) addr;
end findsymbol;
getattributes: proc(symbadr,dest) external;
dcl (symbadr,dest) addr;
end getattributes;
enterattributes: proc(symbadr,source) external;
dcl (symbadr,source) addr;
end enterattributes;
findcodemacro: proc(lg,stradr,result) byte external;
dcl lg byte,(stradr,result) addr;
end findcodemacro;
new$cm$body: PROC(lg,ptr) byte external;
dcl lg byte,ptr addr;
end$proc new$cm$body;
new$cm$name: PROC(lg,asciiptr,returnptr) byte external;
dcl lg byte,(asciiptr,returnptr) addr;
end$proc new$cm$name;
$list


View File

@@ -0,0 +1,337 @@
$title ('SYMBOL TABLE MODULE')
symb:
do;
/*
modified 3/25/81 R. Silberstein
modified 3/28/81 R. Silberstein
modified 3/30/81 R. Silberstein
modified 4/15/81 R. Silberstein
modified 4/16/81 R. Silberstein
modified 4/20/81 R. Silberstein
modified 6/16/81 R. Silberstein
modified 7/24/81 R. Silberstein
*/
/*
This is the module to perform all symbol table
handling. There are 2 different kinds of symbols,
codemacro mnemonics and user defined symbols.
The codemacro symbols are entered into the
symbol table through the hash vector "CODEMACROENTRY",
whereas the user symbols uses the hash vector
"SYMBENTRY". Each symbol enters the symbol table through
hash vector element "i", where i is the hash function of
the symbol. The function is defined as:
H(S) = (C1 + C2 +.... + Ci + ..+ Cn) mod 64
where Ci is the ascii code of the i'th symbolcharacter.
*/
$include (:f1:macro.lit)
$include (:f1:equals.lit)
$include (:f1:struc.lit)
$INCLUDE (:F1:DEV.LIT)
$include (:f1:mnem.ext)
$include (:f1:subr1.ext)
$include (:f1:subr2.ext)
$include (:f1:files.ext)
$INCLUDE (:F1:TEXT.EXT)
$INCLUDE (:F1:IO.EXT)
DECLARE SYMBOLDEVICE BYTE EXTERNAL;
$eject
/* Global variables: */
dcl
codemacroentry (64) addr /* opcode mnemonic entry */
data(
.push,.repz,0,.aaa,0,.movs,.pushf,.MOVSB,
.adc,.add,.CMPSW,.ja,.dec,.loopne,0,.repnz,
.jae,.jg,.clc,.iand,.loopz,.aas,.jl,.in,
.cli,.jo,.inc,.lahf,.icall,.jne,.cwd,.jnbe,
.cmp,.ior,.callf,.div,.les,0,.sar,.jmp,
.hlt,.lock,.xchg,.ret,.idiv,.jmpf,.mul,.pop,
.sti,.inot,.mov,.cmps,.iret,.popf,0,.imul,
.out,.xlat,.jmps,0,0,0,0,.loope),
symbentry (64) addr, /* user symbol entry */
symbtab(1) byte at (.memory), /* symbol table */
freept addr public, /* adr. of next free symb. tab byte */
end$of$symbtab addr PUBLIC, /* last symbol table byte */
symbolheadlg byte, /* length of head for each symbol */
attributelg byte, /* length of symbol attributes */
codemacheadlg byte, /* length of codemacrohead */
overflowlimit addr, /* used to test overflow */
col byte; /* current column position */
DECLARE
ALPHAROOT ADDRESS, /* ROOT OF ALPHABETIZED SYMBOL LIST */
ALPHASYMPTR ADDRESS, /* POINTER TO CURRENT SYMBOL IN ALPHA LIST */
ALPHASYM BASED ALPHASYMPTR SYMBOLHEAD, /* SYMBOL TEMPLATE */
SORTSYMPTR ADDRESS, /* POINTER TO SYMBOL BEING INSERTED */
SORTSYM BASED SORTSYMPTR SYMBOLHEAD; /* SYMBOL TEMPLATE */
$eject
/****************** SUBROUTINES ******************/
outbyt: proc (ch); /* print one byte to symbol file */
dcl ch byte;
if ch=cr then$do /* update column position */
col=0;
else$do
if ch <> lf then col=col+1;
end$if;
call outsymbolbyte(ch);
end outbyt;
hash: proc (lg,pt) byte;
dcl (lg,i,h) byte,pt addr,asc based pt (1) byte;
i=0ffh; h=0;
do while (i:=i+1) < lg;
h=h+asc(i);
end$while;
return h and 3fh;
end hash;
/* search for either a user symbol or a codemacro */
search: proc(lg,pt1,pt2,pt3,headlg) byte;
dcl (lg,headlg) byte,(pt1,pt2,pt3) addr,
ascii based pt1(1) byte,symbptr based pt2 addr,
entrytab based pt3 (64) addr,
currentpt addr,next based currentpt addr,
symbhead based currentpt symbolhead;
currentpt=entrytab(hash(lg,.ascii(0)));
do while currentpt <> 0;
if lg = symbhead.slength then$do
if equal(lg,currentpt+headlg,.ascii(0)) then$do
symbptr=currentpt+3;
return true;
end$if;
end$if;
currentpt=next;
end$while;
return false;
end search;
/* enter either new symbol or new codemacro */
new: proc(lg,pt1,pt2,headlg,pt3) byte;
dcl (lg,headlg) byte,(pt1,pt2,pt3) addr,
ascii based pt1 (1) byte,entrytab based pt2 (64) addr,
symptr based pt3 addr,
current addr,currentcontent based current addr,
symb based freept symbolhead;
if freept > overflowlimit - (lg+headlg) then$DO
CALL OUTTEXT (.SYMBFULLERRTEXT);
CALL SYSTEM$RESET;
END$IF;
current=.entrytab(hash(lg,.ascii(0)));
SYMB.NEXT = CURRENTCONTENT;
currentcontent=freept;
symptr=freept+3;
symb.slength=lg;
call copy(lg,.ascii(0),freept+headlg);
freept=freept+headlg+lg;
return true;
end new;
newsymbol: proc (lg,asciiptr,returnpt) byte public;
dcl lg byte,(asciiptr,returnpt) addr;
return new(lg,asciiptr,.symbentry,symbolheadlg,returnpt);
end newsymbol;
newmacro: proc (lg,asciiptr,codmacdefpt) byte public;
dcl lg byte,(asciiptr,codmacdefpt,retpt) addr,
cmaddr based retpt addr;
if new(lg,asciiptr,.codemacroentry,codemacheadlg,.retpt) then$do
cmaddr=codmacdefpt;
return true;
end$if;
return false;
end newmacro;
findsymbol: proc(lg,stradr,result) byte public;
dcl lg byte,(stradr,result) addr;
return search(lg,stradr,result,.symbentry(0),symbolheadlg);
end findsymbol;
getattributes: proc(symbadr,dest) public;
dcl (symbadr,dest) addr,symb based symbadr symbolstruc;
call copy(attributelg,.symb.length,dest);
end getattributes;
enterattributes: proc(symbadr,source) public;
dcl (symbadr,source) addr,symb based symbadr symbolstruc;
call copy(attributelg,source,.symb.length);
end enterattributes;
findcodemacro: proc(lg,stradr,result) byte public;
dcl lg byte,(stradr,result) addr;
return search(lg,stradr,result,.codemacroentry(0),codemacheadlg);
end findcodemacro;
new$cm$body: PROC (lg,ptr) byte public;
dcl lg byte,ptr addr;
if freept > overflowlimit-lg then return false;
call copy (lg,ptr,freept);
freept=freept+lg;
return true;
end$proc new$cm$body;
new$cm$name: PROC (lg,asciiptr,returnptr) byte public;
dcl lg byte,(asciiptr,returnptr) addr;
return new(lg,asciiptr,.codemacroentry,5,returnptr);
end$proc new$cm$name;
SORTSYMBOLS: PROCEDURE;
DECLARE
CURRENT ADDRESS,
CURRENTCONTENT BASED CURRENT ADDRESS,
NEXT ADDRESS,
I BYTE;
ALPHALOCFOUND: PROCEDURE BYTE;
DECLARE
SORTNAMEPTR ADDRESS,
SORTNAME BASED SORTNAMEPTR (1) BYTE,
ALPHANAMEPTR ADDRESS,
ALPHANAME BASED ALPHANAMEPTR (1) BYTE,
I BYTE;
SORTNAMEPTR = SORTSYMPTR + SYMBOLHEADLG;
ALPHANAMEPTR = ALPHASYMPTR + SYMBOLHEADLG;
DO I = 1 TO SORTSYM.SLENGTH;
IF I > ALPHASYM.SLENGTH THEN RETURN FALSE;
IF SORTNAME (I-1) > ALPHANAME (I-1) THEN RETURN FALSE;
IF SORTNAME (I-1) < ALPHANAME (I-1) THEN RETURN TRUE;
END;
RETURN TRUE;
END ALPHALOCFOUND;
FIXCHAIN: PROCEDURE;
SORTSYM.NEXT = ALPHASYMPTR;
CURRENTCONTENT = .SORTSYM;
END FIXCHAIN;
INSERTALPHA: PROCEDURE;
CURRENT, ALPHASYMPTR = .ALPHAROOT;
DO WHILE (ALPHASYMPTR := ALPHASYM.NEXT) <> 0;
IF ALPHALOCFOUND THEN$DO
CALL FIXCHAIN;
RETURN;
END$IF;
CURRENT = ALPHASYMPTR;
END$WHILE;
CALL FIXCHAIN;
END INSERTALPHA;
ALPHAROOT = 0;
DO I = 0 TO LAST (SYMBENTRY);
SORTSYMPTR = SYMBENTRY (I);
DO WHILE SORTSYMPTR <> 0;
NEXT = SORTSYM.NEXT;
CALL INSERTALPHA;
SORTSYMPTR = NEXT;
END$WHILE;
END;
END SORTSYMBOLS;
outcrlf: proc;
call outbyt(cr);
call outbyt(lf);
end outcrlf;
printsymbols: proc(typ); /* print all symbols to file */
dcl (typ,i) byte;
advancetonext: proc; /* advance to next column (16,32,48,64) */
dcl (x,y) byte;
x=col/16;
y=16-(col mod 16);
if x >= 4 then$do
call outcrlf;
else$do
IF SYMBOL$DEVICE = PRINTER THEN$DO
DO WHILE (Y := Y - 1) <> 255;
CALL OUTBYT (SPACE);
END$WHILE;
ELSE$DO
col=col+y;
call outsymbolbyte(tab);
if y > 8 then call outsymbolbyte(tab);
END$IF;
end$if;
end advancetonext;
OUTBYTES: proc(lg,p);
dcl lg byte,p addr,asc based p byte;
DO WHILE (LG := LG - 1) <> 0FFH;
call outbyt(asc);
P = P + 1;
end$while;
end OUTBYTES;
printsymb: proc(p); /* print single symbol */
dcl p addr,x based p symbolhead,
a addr,ascii based a (1) byte,help(4) byte;
a=p+symbolheadlg;
if X.STYPE=typ then$do
if col+x.slength+5 > 79 then call outcrlf;
call hex2out(x.offset,.help(0));
CALL OUTBYTES (4, .HELP);
call outbyt(space);
CALL OUTBYTES (X.SLENGTH, .ASCII);
call advancetonext;
end$if;
end printsymb;
/* print symbols main program */
col=0;
CALL OUTBYTES (4, .('0000')); /* print header */
call outbyt(space);
if typ=lab then call OUTBYTES(6,.('LABELS'));
if typ=variable then call OUTBYTES(9,.('VARIABLES'));
if typ=number then call OUTBYTES(7,.('NUMBERS'));
call outcrlf;
ALPHASYMPTR = ALPHAROOT;
DO WHILE ALPHASYMPTR <> 0;
CALL PRINTSYMB (ALPHASYMPTR);
ALPHASYMPTR = ALPHASYM.NEXT;
END;
if col <> 0 then call outcrlf;
end printsymbols;
symbterminate: proc public; /* print symbol table */
IF SYMBOLDEVICE = NULL THEN RETURN; /* no need to sort, etc. */
CALL SORTSYMBOLS;
CALL OUTSYMBOLBYTE (FORMFEED);
call printsymbols(variable); /* variables */
CALL OUTCRLF;
call printsymbols(number); /* numbers */
CALL OUTCRLF;
call printsymbols(lab); /* labels */
end symbterminate;
symbinit: proc public;
dcl i byte;
dcl symb symbolhead at (.i),codm codemacrohead at (.i);
end$of$symbtab=(endbuf/256)*256-1;
freept=.symbtab(0);
CALL FILL (0, SIZE (SYMBENTRY), .SYMBENTRY);
symbolheadlg=.symb.baseindex-.symb.next+1;
attributelg=symbolheadlg-3;
codemacheadlg=.codm.defptr-.codm.next+2;
overflowlimit=end$of$symbtab-symbolheadlg;
end symbinit;
end$module symb;


View File

@@ -0,0 +1,6 @@
$nolist
declare endbuf address external;
$list


View File

@@ -0,0 +1,33 @@
$nolist
/*
modified 3/28/81 R. Silberstein
modified 3/30/81 R. Silberstein
modified 7/24/81 R. Silberstein
*/
/* Text strings: */
dcl
yes byte external,
no byte external,
initials(1) byte external,
pagetext(1) byte external,
endtext(1) byte external,
USEFACTOR (1) BYTE EXTERNAL,
asm86text(1) byte external,
parerrtext(1) byte external,
openerrtext(1) byte external,
DISKREADERRTEXT (1) BYTE EXTERNAL,
DISKWRITEERRTXT (1) BYTE EXTERNAL,
MAKEERRTEXT (1) BYTE EXTERNAL,
CLOSEERRTEXT (1) BYTE EXTERNAL,
SYMBFULLERRTEXT (1) BYTE EXTERNAL,
usbreaktext(1) byte external,
pass0text (1) byte external,
pass1text (1) byte external;
$list


View File

@@ -0,0 +1,44 @@
$title ('TEXT MODULE')
text:
do;
$include (:f1:macro.lit)
/*
modified 3/28/81 R. Silberstein
modified 3/30/81 R. Silberstein
modified 4/8/81 R. Silberstein
modified 4/15/81 R. Silberstein
modified 7/24/81 R. Silberstein
*/
/* Bytes to define "yes" and "no": */
dcl yes byte public data ('Y'),
no byte public data ('N');
/* Text strings: */
dcl
initials(*) byte public data('CP/M ASM86 1.1 SOURCE: ',0),
pagetext(*) byte public data(' PAGE',0),
endtext(*) byte public data('END OF ASSEMBLY. ',
'NUMBER OF ERRORS: ',0),
USEFACTOR (*) BYTE PUBLIC DATA ('. USE FACTOR: ',0),
asm86text(*) byte public data(cr,lf,'CP/M 8086 ASSEMBLER VER 1.1',
cr,lf,0),
parerrtext(*) byte public data(cr,lf,'PARAMETER ERROR',cr,lf,0),
openerrtext(*) byte public data(cr,lf,'NO FILE',0),
DISKREADERRTEXT (*) BYTE PUBLIC DATA (CR,LF,'DISK READ ERROR',0),
DISKWRITEERRTXT (*) BYTE PUBLIC DATA (CR,LF,'DISK FULL',0),
MAKEERRTEXT (*) BYTE PUBLIC DATA (CR,LF,'DIRECTORY FULL',0),
CLOSEERRTEXT (*) BYTE PUBLIC DATA (CR,LF,'CANNOT CLOSE',0),
SYMBFULLERRTEXT (*) BYTE PUBLIC DATA (CR,LF,'SYMBOL TABLE OVERFLOW',0),
usbreaktext(*) byte public data(cr,' USER BREAK. OK(Y/N)? ',0),
pass0text (*) byte public data('END OF PASS 1',cr,lf,0),
pass1text (*) byte public data('END OF PASS 2',cr,lf,0);
end$module text;