Server for Information Technologies

(095) 932-9212, 932-9213, 939-0783
E-mail: info@citforum.ru
(!) CIT Forum CD-ROM

86REL(5)
XENIX System V (1 ap 1989)


86rel - opa oeoo oy, p poeccopa Intel 8086.

#include <sys/relsym86.h>


opa, p poeccopa Intell 8086, 86rel, pecae coo oe oy , coaae acceepo masm(1) ec xo ao peaopa ce ld(1). Mapoa relsym86.h coep oca, p oye peyae pac c a C aa opae 86rel. Ocae execx opooce opaa 86rel cop Intel 8086 ObjectModuleFormatExternal Product Specification.

opa 86rel coco ace epeeo . Kaa ac ee o pae epe p o: ac, a opoa cya. ep a cea coep ac. Cyecye pa o pa ace. Too oaa x coyec peaopo ce ld(1) masm(1). Coo, pacooeoe oce epoo aa pecae coo y ac aax;p ce epe p aa e yac .aee cey oo ecoo oe. Ka ac coep ceecy oceoaeoc oe pao , eoope oopx oy eoae . Ca oce a ao ac coep opoy cyy. a opoo cy oppyec a cya o oy 256 cex pyx a ac. Cya o oy 256 cex a ac, a a opoo cy, oa paa y.

a eoop cee, ep a cpo 86rel coep co o 0 o 40, oopoe opeee ocayc y cpo aax cpoa e coep aepax ye (BHMAHE! B aee ce cpo, ocaee oyee e ao opa!). Xo oca Intel peycopeo cooae oo coo epxeo pecpa aayp coo `?', `@', `:' `_' acceep masm(1) coye o aop ASCII coo.

Opeeee Intel Object Module Format (OMF) coye ep "ec" ooae ooex ecx ce o 0 o 127 o 128 o 32,768. a e epoo coxpaea ao oyee o ce epaype o 86rel. ec pecaec o y aa. Ec ep a ee yeo ep , ec pecae oo o ao, ocao aa pecae ooeoe ecoe co, pacooeoe ey 0 127. Ec opo a ee e ep , ec pecae y aa ocao coa coep ooeoe ecoe co, pacooeoe ey 128 32.768.

He pee cco o ace ecaape e x epoo aa, opeeex ae relsym86.h

#define MRHEADR  0x6e    /*aooo oeoo oy */
#define MRDGINT  0x70    /*aa pecpo*/
#define MREDATA  0x72    /*o opeeee ae*/
#define MRIDATA  0x74    /*oopee ae*/
#define MOVLDEF  0x76    /*ocae epep*/
#define MENDREC  0x78    /*ac oa oa  epep*/
#define MBLKDEF  0x7a    /*ocae oa*/
#define MBLKEND  0x7c    /*oe oa*/
#define MDEBSYM  0x7e    /*co oa*/
#define MTHEADR  0x80    /*aooo oy, oo
                          ep  oeo ae*/
#define MLHEADR  0x82    /*aooo oy c*/
#define MPEDATA  0x84    /*acoe ae*/
#define MPIDATA  0x86    /*acoe oopee ax*/
#define MCOMENT  0x88    /*ac oeap*/
#define MMODEND  0x8a    /*ac oa oy*/
#define MEXTDEF  0x8c    /*ee oca*/
#define MTYPDEF  0x8e    /*oca a*/
#define MPUBDEF  0x90    /*oae oca*/
#define MLOCSYM  0x92    /*oae co*/
#define MLINNUM  0x94    /*oep cpo cxooo eca*/
#define MLNAMES  0x96    /*ac cca e*/
#define MSEGDEF  0x98    /*ocae ceea*/
#define MGRPDEF  0x9a    /*ocae py*/
#define MFIXUPP  0x9c    /*opa o acpoe
                          epeecx ax*/
#define MNONE1   0x9e    /*e*/
#define MLEDATA  0xa0    /*oece ae*/
#define MLIDATA  0xa2    /*oece oopee ae */
#define MLIBHED  0xa4    /*aooo oe*/
#define MLIBNAM  0xa6    /*ac e oe*/
#define MLIBLOC  0xa8    /*paee oye oe*/
#define MLIBDIC  0xaa    /*coap oe*/
#define M386END  0x86    /*ac oa 32 oo oy*/
#define MPUB386  0x91    /*32 oe oaoe opeeee*/
#define MLOC386  0x93    /*32 e oece co*/
#define MLIN386  0x95    /*32  oep cxoo cpo*/
#define MSEG386  0x99    /*32 oe ocae ceea*/
#define MFIX386  0x9d    /*opa o acpoe
                          epeecx ax*/
#define MLED386  0xa1    /*32  oece ae*/
#define MLID386  0xa3    /*32 e oece oopee ae*/

B aee yy oca ocoeoc aoo a ac. Ec ac e coyec masm(1), ld(1), oa e ocaa.

THEADR
T ac opeeec aee 0x80. ac THEADR opeee aa cxooo oy c eco a acceepe (c. aea). Eceoe oe coep oe TMODULE NAME, oyeoe a base name o ooo e aa.
COMENT
T ac opeeec aee 0x88. ac COMENT oe coepa oeap, coaae oopo. Mams(1) oeae oe oo oeap cpoy "XENIX 8086 ASSEMBLER."
MODEND
T ac opeeec aee 0x8a. ac MODEND aepae oy. Oa opeee, coep ey oy oy xoa oe. Ec oy ec oo xoa, ac MODEND opeee apec o xoa.
EXTDEF
T ac opeeec ee 0x8c. ac EXTDEF coep ea coo, opeeex pyx oyx ac a PUBDEF (c. e). o cooecye accy a "extern" e C. o coepa oy oee cpo, a ao cpoo ceye ec. ec yaa a ac TYPDEF, pacooee paee oye. Masm(1) eeppye oo o EXTDEF a a e co.
TYPDEF
T ac opeeec aee 0x8e. ac TYPDEF coep ocae o (paep apy xpae) . Ha o ocae oy ccac ac EXTDEF, PUBDEF pye ac.
PUBDEF
T ac opeeec aee 0x90. B ac PUBDEF coepc cco, coco ooo oee e, a oope oy ccac pye oy. Ccy e peecy ec py ceea, oope yaa a aao cca oax epeex eye ceee pye. Ec ec ceea py pa 0, aaec oep frame, opee aco apec oye. Cco coco oo oee cpo, aa oopx coep 16-oe ceee eye ceee ec, yaa a TYPDEF.
LNAMES
T ac opeeec aee 0x96. ac LNAMES aae oceoaeoc cpo, oope cooecy ea, yaa eye oye. Kaoe ecpoao oceoaeo, aa c 1. ac SEGDEF GRDEF, pacooee a ao ac axoec ao oye, oya o ac ea ceeo, acco, epep py.
SEGDEF
T ac opeeec aee 0x98. ac SEGDEF coep ec, yaa a cee opa o apeca apyax ceea. o ec oe cooa py ac cco a cee. epoe coo ac, pacooeoe oce o , coep opa o paa oa apyo ceea. Ceyee coo opeee y ceea aax. ae, o oo aae acay y ceea, pay 65,536 a. aee ceye ec cee (c. e). Haoe, SEGDEF oe, o e oaeo, coepa o eco acca / epep.
FIXUPP
T ac opeeec aee 0x9c. ac FIXUPP opeee oy oee oa apeco o pe peapoa ce ("fixups"). Kaa ac yaae a apec peye ac LEDATA (c. e). oo, o acpo apec eoxoo a: paeee, pe, target frame. Frame target oy aa o epe ccy a ye opeeey cpyypy acpo apeco.
LEDATA
T ac opeeec aee 0xa0. a ac coep epepe ec ae, coyee peaopo ce coa op oeoo oy . o op oe peoa ooex ec (c. FIXUPP) epe apyo coe a. epe eco a oy pcoaac 2 o: ec ceea ceee. ec ceea (c. INDEX) opeee cee, oop oca ac SEGDEF. Ceee, o xpaee oopoo oeeo oo coo, opeee ey cee o aaa oo ceea.

.
as(1), ld(1)


Ec oaeec ca oy, accepoae oao ea, apy ye ac paec eo ec o oo cee. B popaax poeccopa I802286 paep ceea opae eo 64K. B ox popaax paep peypyeo ceea oe pea 64K. Ec coyec oe a a large, o, oce aepe pao peaopa ce, oyaec o oee oye, cocox ceeo, o paep eca oopoo cyeceo peae 64K.

Ceoaeo, yo yepe, o oy, poecce accepoa, coaae c ee cxooo. ea oy e coaa, ec cxo oy ye peapeo opaoa e c oo oa cc(1), a, apep, pyy shell-popao. aee ceye pep, aepeo coepa oy:

     #incorrect
     cc -E module12.c |filter >x.c
     cc x.c
     mv x.o module1.o
     cc -E module2.c |filter >x.c
     cc x.c
     mv x.o module2.o
     cc -E module3.c |filter >x.c
     cc x.c
     mv x.o module3.o
     ld module1.o module2.o module3.o

o ea oo, a oye oe e yaoe oe accepoa, a oaao e:

     #correct
     cc -E module1.c |filter >x.c
     cc -S x.c
     mv x.s module1.s
     as module1.s
     .
     .
     .
     ld module1.o module2.o module3.o
Comments: info@citmgu.ru
Designed by Andrey Novikov
Copyright © CIT