!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_3400record (eventfm) EVENT
@16_1114routine  SIG
@16_1128routine  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_11B4routine  RES
@16_11BCroutine  LOA
@16_1120routine  MUL
@16_1124routine  DIV
@16_1144routine  POW
@16_1148routine  FPLUS
@16_114Croutine  FMIN
@16_1150routine  FMUL
@16_1154routine  FDIV
@16_1158routine  FPOW
@16_115Croutine  FNEG
@16_1160routine  FLOA
@16_1114record (*)map  ZNEW(name (d0) v)
@16_1114routine  DISPOSE(record (*)name  v)
@16_10C8routine  READSYMBOL(name (d0) n)
@16_10C4routine  PRINTSTRING(string (255) z)
@16_1118routine  READ(name (d0) v)
externalroutinespec  READREAL(realname  v)
externalroutinespec  READSTRING(string (*)name  v)

@0record (*) NIL
constinteger  NL=10
@0integerfn  ADDR{(%name n)
@0integermap  INTEGER(integer  a)
@0realmap  REAL(integer  a)
@0string (*)map  STRING(integer  a)
@0record (*)map  RECORD(integer  a)
@0bytemap  BYTEINTEGER(integer  a)
@0shortmap  SHORTINTEGER(integer  a)
@0bytemap  LENGTH(string (*)name  z)
@0bytemap  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_1124integerfn  REM(integer  a,b)
@0integerfn  SIZEOF
@16_10CCintegerfn  NEXTSYMBOL
@16_10C0routine  PRINTSYMBOL(integer  k)
@16_10C8routine  SKIPSYMBOL
@16_10D0routine  PROMPT(string (255) z)
@16_10D4integerfn  TESTSYMBOL
@16_10D8routine  SELECTINPUT(integer  n)
@16_10DCroutine  SELECTOUTPUT(integer  n)
@16_10E0routine  RESET INPUT
@16_10E4routine  RESET OUTPUT
@16_10E8routine  CLOSE INPUT
@16_10ECroutine  CLOSE OUTPUT
@16_10F0routine  OPEN INPUT(integer  n, string (255) z)
@16_10F4routine  OPEN OUTPUT(integer  n, string (255) z)
@16_111Croutine  WRITE(integer  m, n)
constinteger  NOECHO=1,NOTERMECHO=2,SINGLE=4,NOPAGE=8
@16_1140routine  SET TERMINAL MODE(integer  m)
@16_1130integerfn  CPUTIME
@16_1168integerfn  INTPT(real  x)
@16_1164realfn  FRACPT(real  x)
@16_116Crealfn  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_1160realfn  FLOAT(integer  i)
externalstring (255)fnspec  cliparam