home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / msdos / programm / 9121 < prev    next >
Encoding:
Text File  |  1992-09-08  |  2.5 KB  |  58 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: sparky!uunet!uunet.ca!geac!torag!zooid!ross
  3. From: Ross Ridge <ross@zooid.guild.org>
  4. Subject: Re: studying executables
  5. Organization: ZOOiD BBS
  6. Distribution: comp
  7. Date: Mon, 7 Sep 1992 09:09:18 GMT
  8. Message-ID: <1992Sep7.090918.18154@zooid.guild.org>
  9. References: <ARA.92Sep6131908@camelot.ai.mit.edu> <1992Sep6.232408.11684@zooid.guild.org> <1992Sep7.034936.28892@ringer.cs.utsa.edu>
  10. Lines: 46
  11.  
  12. ara@zurich.ai.mit.edu (Allan Adler) writes:
  13. >First, it seems to me that every compiler and every assembler must have its
  14. >own idiosyncratic way of producing the executable. Is that true?
  15.  
  16. ross@zooid.guild.org (Ross Ridge) writes:
  17. >For compilers yes, for assemblers no.  With assemblers every byte of
  18. >the execuatable is under the programmers control.
  19.  
  20. mlevis@ringer.cs.utsa.edu (Mike Levis) writes:
  21. >Actually, assemblers have their own way of producing executables, too.
  22. >There is a share-ware assembler (I think it is called A86) that even
  23. >says that it creates opcodes different from other assemblers.  This
  24. >way, the author can sue unregistered owners for not registering.
  25. >There are different ways an assembler can create a "fingerprint".
  26. >One example is ``MOV BX, AX''.  An assembler can generate either
  27. >``89h C3h'' or ``8Bh D8h'' for the opcode (I don't have A86, so I
  28. >don't know which opcode set it uses for ``MOV BX, AX'').
  29.  
  30. True, this can be used to identify assemblers.  I hadn't thought
  31. of that.  But it isn't of any use in helping you understand
  32. the programme.
  33.  
  34. >Likewise, an assembler can optimize the code for speed and/or size.
  35. >For example, I have TASM, which converts a far call into the same
  36. >segment into a push cs and near call.
  37. >
  38. >TASM also automatically generates code for you, such as when using
  39. >Language modifiers.  For example, you can call a C function from
  40. >your ASM program.  TASM will push your parameters (using the C
  41. >parameter passing protocol), make the call, then adjust the stack
  42. >for you.
  43.  
  44. Neither of these examples help you identify the assembler, the code
  45. generated by TASM could've easily been generated explicitly by another 
  46. assembler or even automatically by a compiler.  They're still also fully
  47. under control of the programmer.  The second example however, a programme
  48. using the C language calling convention, whether automatically or not is
  49. something that can be used to gain some insight into the programme.
  50.  
  51.                         Ross Ridge
  52.  
  53. -- 
  54. Ross Ridge - The Great HTMU                         l/     //
  55.                                     [OO][oo]
  56. ross@zooid.guild.org                            /()\/()/
  57. uunet.ca!zooid!ross                             db     //
  58.