home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / TURBOPAS / PMLINK.LBR / PMLINK.DQC / PMLINK.DOC
Text File  |  2000-06-30  |  3KB  |  62 lines

  1. M80 assembly routines as 'inline' statements for Turbo-Pascal
  2.  
  3.     From MC - Die Microcomputer Zeitschrift Juni 1986
  4.  
  5.            "free translation" by BGE.
  6.  
  7.  
  8. To  stop  the messy handcoding of inline statements, PMLINK takes
  9. the REL-file and generates an  INL-file.   The  INL-file  can  be
  10. [either]  included via {$I } or edited into the Turbo-source.  As
  11. an example see ROTLFT.* or GETBTS.* .
  12.  
  13. PMLINK  prompts  for  name  of  REL-file  {extension  if left out
  14. defaults to .REL} - and name  of  INL-file  {name  and  extension
  15. default  to name of REL-file and extension INL}.  An empty answer
  16. for another REL-file stops PMLINK.
  17.  
  18. PMLINK  consists  of  three  modules  {PMLINK.PAS, PMLINK.BIT and
  19. PMLINK.UTL}.  A slightly changed version uses PMLINK's service to
  20. replace the original GETBITS routine with  assembly  code.   {see
  21. differences  between  PMLINK.BIO  and  PMLINK.BIT using the newly
  22. generated GETBTS in assembly {or inline} code.
  23.  
  24. PMLINK  uses  two  passes.  In pass one it reads the REL-file and
  25. constructs a table containing BYTE,flags and  Symbols  /  Offsets
  26. {to  be  able  to  work  out  "ld  A,(NUM  +  5)".  Pass two then
  27. generates the code for the .INL file.
  28.  
  29.          PMLINK limitations and features
  30.  
  31.  
  32. Names  and  Symbols can only be 6 characters max !!  {GETBITS ==>
  33. GETBTS}
  34.  
  35. Turbo  routines  callable from assembly {see call to InByte} [for
  36. Turbo V2 users : place a  typed  BYTE  constant  infront  of  the
  37. routine  to  be called - i.e.  CONST InBtAd: byte = 0; infront of
  38. the routine.  Change the CALL InByte to CALL InBtAd  and  declare
  39. InBtAd external.  The compiled program will see InBtAd as a NO-OP
  40. and work as planned].
  41.  
  42. PMLINK  is  NOT a linking loader , so declarations of ASEG, DSEG,
  43. COMMON, PHASE or PUBLIC will not be  handled  correctly.   It  is
  44. however  possible  to  use  LIB80  to  combine  several  assembly
  45. routines.  PMLINK will handle the combined pieces  correctly  and
  46. seperate  the  code  via  Begin-End  sequences  plus  keeping the
  47. original names as comments.
  48.  
  49. All  Items, which PMLINK can't handle, will be flagged with error
  50. messages, computation is not interrupted - although the generated
  51. inline code is not necessarily correct anymore.
  52.  
  53. Turbo  Pascal  executes  special code for functions, which return
  54. their values in HL - in this case, the assembly functions  should
  55. end with a RET to circumvent Turbo Pascals unneeded special code.
  56.  
  57. Assembly routines using VAR parameters have to be aware, that the
  58. parameters only POINT to the cell holding the value - they DO NOT
  59. hold  the  value  directly.   Parameters  transfered  via call or
  60. declared inside a procedure or function however hold their values
  61. directly.g VAR parameters have to be aware, that the
  62. parameters only POINT to the cell holding the value - they DO NO