!~FILENAME~:! !-*-TECO-*- macros for PALX PDP11 programs.! PDP11MACS !Trantor:! !C Assemble Trantor. Have PALX assemble PDP11;TRANTR > producing BIN, ERR, CRASH and SYMTAB files.! m(m.m& Assemble)TRANTRT/H  !Roundhouse:! !C Assemble Roundhouse. Have PALX assemble PDP11;ROUNDH > producing BIN, ERR, CRASH and SYMTAB files.! m(m.m& Assemble)ROUNDHRH !Dover Trantor:! !S Dover Trantor.! :xxfile pdp11;dover trantr $p !& Assemble:! !S Assemble a PDP11 program! m(m.mSave All Files) !* make sure everything is written out! [1[2[3[4[5[6 f[bbindw f[dfilew f[sstringw 0f[fnamsyntaxw :i1 :i2 :i6 ezDSK:PDP11; j <:s  1 ; \f"n u3'w> !* get program version number! hk g2 q3\w hfx3 !* version in Q3, make it fn1! i .nlist .macro .date. .ascii " mmInsert Datel i" .endm .date  ei hp ef.asm 1 !* Define .DATE. macro to tell program the when it was assembled! hk f+ :PALX PDP11;3 BIN,3 SYMTAB,3 ERR_PDP11;.ASM,1/N6 $P 1:w 8f[ibasew 1:< er3 err^y !* get PALX's ERROR file! :i4 <:s FILE ; fb; 4,40.i 4r ^:x4 4d> j !* collect file names! :i5 <:s.msg _C_ ; fkd 0l ^fx5>j !* collect crash msgs! :sFILE "l fkc b,.k' !* delete cruft at beginning! ei hp ef !* write out the ERR file! hk i CRASH Messages  g4 i PC PC Message  g5 ei hp efcrash !* write out the CRASH file! > 1:< ersymtab^y !* read in the listing file! :s***SYMBOL TABLE***"l !* delete all but the symbol table! -s  c b,.k ei hp ef' !* and write out as SYMTAB! hk > 1:w 1:w 1:w !* make links to files just! 1:w !* produced!  !^R Squish Region:! !C Squish tabs in instructions to spaces. Change tabs between op code and operands to spaces.! [1[2[3 f[vb f[vz .,(w)f fs boundw !* set bounds to region! j < .-z; 1:fu2u1 0u3 !* find bounds of instruction! q1,q2:fb;"l r .u2 fshposu3' !* ignore comment on line! 1< q1,q2:fb ; .,q2:fb; !* find second tab in instruction! -di  !* change to space! q3"g q2j fshpos-q3"n i '' !* keep comment in same place! > l > h  !^R Indent PALX code:! !^R Change indentation of code, comments remain stationary.! [1[2 f[vb f[vz f[sstring .,(w.)f fsboundw m.m& Indentu1 !* get ptrs to subrs for fast calling! 0s ;w !* set search string! j < .-z; .(:s+1"l r fshposu2'"# 2r -1u2' fsz-.f[vz)j 1< ^:f l .-z; !* move past labels etc.! ^ f l .-z; !* move past indentation! fshpos+m1 !* reindent! q2:; zj q2m1 !* put comment back! > f]vz l > h  !Args:! !C Print arguments and return values for Trantor subroutine. String arg is name of subroutine. Subroutine is found via the current tag table.! [1[2[3 qBuffer Nameu2 .u3 !* Save current buffer name and point! m(m.mFind Tag) !* Find the subroutine! 0l .u1 !* Move to end of description! < b-.; -l !* Move back line by line until one! 1a-;"n 1a-15."n 1;'' !* starts with other than ; or CR! > l < 2f= "n 1;' l > !* remove leading blank lines! q1-."n .,q1t' !* Type description if there is one! q2m(m.mSelect Buffer) q3j !* Go back to old buffer and point!  !PALX Mode:! !C Set things up for editing PALX code.! m(m.m& Init Buffer Locals) !* ! 1,32M.LComment Column !* try to put comments in column 32! 1,(:I*;) m.lComment Start !* semicolon starts comments! 1,(:I*; )m.lComment Begin !* semicolon space looks nicer though! 1,(:I*)m.lParagraph Delimiter !* ! 1,(m.m^R Indent Relative)m.qI !* set TAB to indent under last line! ! 1,(m.m^R Indent PALX Code)m.q:.x(11.) |* put indenter on ^X Tab! 1,Q¨1,Q.Í.Q›)M.Q.› !* Exchange rubout flavors! 0fo..qMIDAS Vector[1 !* ! q1"e 5*5fsqvectoru1 q1m.vMIDAS Vector !* ! m.m^R Go to AC Fieldu:1(0) !* ! m.m^R Kill Terminated Wordu:1(1) !* ! m.m^R Go to Address Fieldu:1(2) !* ! m.m^R Go to Next Labelu:1(3) !* ! m.m^R Go to Previous Labelu:1(4)' !* ! 1,Q:1(0)M.Q...A !* use MIDAS Mode stuff! 1,Q:1(1)M.Q...D !* ...! 1,Q:1(2)M.Q...E !* ...! 1,Q:1(3)M.Q...N !* ...! 1,Q:1(4)M.Q...P !* ...! Q.0,1M(M.M& Set Mode Line)PALX !* !