!PRIM + PERM file for Motorola 68000 IMP Compiler V2.0
!**NB order up to READSTRING
%recordformat EVENTFM(%integer event,(%integer sub %or %integer subevent),
  %integer extra,line,%string(255) message)
@16_3400%record(eventfm) EVENT
@16_1114%routine SIG
@16_1128%routine SCOMP
%routine ASET
  *sub.l d2,d1
  *ble #6
  *moveq #-16_35,d0
  sig
  *neg.l d1
  *addq.l #1,d1
!  *mulu d1,d0
!  *rts
  *jmp 16_1120
%end
%routine AGET
  *addq.l #3,d0
  *and.l #-4,d0
  *move.l d6,a0
  *add.l d0,d6
  *cmp.l d6,sp
  *ble #6
  *lea -256(a0),a0
  *rts
  *sub.l d0,d6
  *moveq #-16_12,d0
  sig
%end
%routine IX
%label bad,ok,bigel,bigx,big
  *cmp.l (a0)+,d0
  *bgt bad
  *sub.l (a0)+,d0
  *bge ok
  *add.l -(a0),d0
bad:*move.l d0,16_3408
  *clr.w 16_3410
  *move #16_26,d0
  sig
ok:
  *tst.w (a0)+
  *bne bigel
  *swap d0
  *tst.w d0
  *bne bigx
  *swap d0
  *mulu (a0)+,d0
  *rts
bigel:
  *move d1,-(sp)
  *move d0,d1
  *mulu -2(a0),d1
  *bra big
bigx:
  *move d1,-(sp)
  *move d0,d1
  *swap d0
  *mulu (a0),d1
big:
  *swap d1
  *mulu (a0)+,d0
  *add d1,d0
  *move (sp)+,d1
%end
@16_11B4%routine RES
@16_11BC%routine LOA
@16_1120%routine MUL
@16_1124%routine DIV
@16_1144%routine POW
@16_1148%routine FPLUS
@16_114C%routine FMIN
@16_1150%routine FMUL
@16_1154%routine FDIV
@16_1158%routine FPOW
@16_115C%routine FNEG
@16_1160%routine FLOA
@16_1114%record(*)%map ZNEW(%name(d0) v)
@16_1114%routine DISPOSE(%record(*)%name v)
@16_10C8%routine READSYMBOL(%name(d0) n)
@16_10C4%routine PRINTSTRING(%string(255) z)
@16_1118%routine READ(%name(d0) v)
%externalroutinespec READREAL(%realname v)
%externalroutinespec READSTRING(%string(*)%name v)

@0%record(*) NIL
%constinteger NL=10
@0%integerfn ADDR{(%name n)
@0%integermap INTEGER(%integer a)
@0%realmap REAL(%integer a)
@0%string(*)%map STRING(%integer a)
@0%record(*)%map RECORD(%integer a)
@0%bytemap BYTEINTEGER(%integer a)
@0%shortmap SHORTINTEGER(%integer a)
@0%bytemap LENGTH(%string(*)%name z)
@0%bytemap CHARNO(%string(*)%name z, %integer n)
%string(1)%fn TOSTRING(%integer k)
%short z=k
  byteinteger(addr(z)) = 1
  %result = string(addr(z))
%end
@16_1124%integerfn REM(%integer a,b)
@0%integerfn SIZEOF
@16_10CC%integerfn NEXTSYMBOL
@16_10C0%routine PRINTSYMBOL(%integer k)
@16_10C8%routine SKIPSYMBOL
@16_10D0%routine PROMPT(%string(255) z)
@16_10D4%integerfn TESTSYMBOL
@16_10D8%routine SELECTINPUT(%integer n)
@16_10DC%routine SELECTOUTPUT(%integer n)
@16_10E0%routine RESET INPUT
@16_10E4%routine RESET OUTPUT
@16_10E8%routine CLOSE INPUT
@16_10EC%routine CLOSE OUTPUT
@16_10F0%routine OPEN INPUT(%integer n, %string(255) z)
@16_10F4%routine OPEN OUTPUT(%integer n, %string(255) z)
@16_111C%routine WRITE(%integer m, n)
%constinteger NOECHO=1,NOTERMECHO=2,SINGLE=4,NOPAGE=8
@16_1140%routine SET TERMINAL MODE(%integer m)
@16_1130%integerfn CPUTIME
@16_1168%integerfn INTPT(%real x)
@16_1164%realfn FRACPT(%real x)
@16_116C%realfn SQRT(%real x)
%routine NEWLINE
  printsymbol(nl)
%end
%routine NEWLINES(%integer i)
  newline %and i = i-1 %while i > 0
%end
%routine SPACE
  print symbol(' ')
%end
%routine SPACES(%integer i)
  space %and i = i-1 %while i > 0
%end
%routine NEWPAGE
  print symbol (12)
%end
%externalintegerfnspec INSTREAM
%externalintegerfnspec OUTSTREAM
%externalstring(15)%fnspec DATE
%externalstring(15)%fnspec TIME
%externalstring(31)%fnspec DATETIME
%string(1)%fn SNL;%result=tostring(nl);%end
%externalstring(255)%fnspec SUBSTRING(%string(255) z, %integer from,to)
%externalroutinespec PRINT(%real x, %integer n,m)
%externalroutinespec PRINTFL(%real x, %integer n)
%externalintegerfnspec INT(%real r)
@16_1160%realfn FLOAT(%integer i)
%externalstring(255)%fnspec cliparam
