home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!agate!ucbvax!LL.MIT.EDU!sage
- From: sage@LL.MIT.EDU (Jay Sage)
- Newsgroups: comp.os.cpm
- Subject: Re: 8080/8085/Z80 Code Identifier
- Message-ID: <9301241501.AA23431@LL.MIT.EDU>
- Date: 24 Jan 93 20:01:31 GMT
- Sender: daemon@ucbvax.BERKELEY.EDU
- Distribution: world
- Organization: The Internet
- Lines: 32
-
- John Winslade asked about determining if a given COM file included Z80 or
- 8085 code in addition to 8080 code. A few people offered answers. One was
- the following:
-
- >> There's a trick I SORTA remember which uses the Z80's additional overflow
- >> capability of the parity flag.
-
- This is not the answer to the question at hand. It is a method of
- determining within a program what kind of processor it is actually running
- on at the time. It is often used in programs that require a Z80 to make
- sure they are NOT running on just an 8080 so that they can abort gracefully
- before they go up in flames.
-
- In fact, as one reply noted, it would be extremely difficult to determine
- by any simple analysis what opcodes appear in a COM file, since there is no
- easy way to discriminate between code and data. However, there is a rather
- nice way to find out if you have, of all things, a DOS machine with the
- 22NICE emulator. If I remember correctly, it can optionally be set up to
- emulate only 8080 opcodes or to emulate the full Z80 set. In the former
- mode, it will trap Z80 opcodes as illegal. This approach works because the
- emulator actually tries to execute the program, and that distinguishes
- between data and code.
-
- It would be possible to do the same thing under CP/M itself, namely, to
- write an 8080/Z80 emulator (strange to emulate a processor on the very
- processor that is being emulated!). In fact, it may even be that the DSD
- (Dynamic Screen Debugger) tool already does this (it certainly could be made
- to do it), since it supports an emulation mode in which it does not actually
- run the code (as DDT and SID do) but emulates (simulates) its operation
- while allowing a user routine to evaluate whatever one wishes on each step
- of the code.
-
-