Date : Tue, 30 Jan 1990 09:10:03 GMT
From : mintaka!snorkelwacker!spdcc!merk!alliant!linus!nixbur!nixpbe!peun11!josef@CS.YALE.EDU (Moellers)
Subject: program name under CP/M
wittig@gmdzi.UUCP (Georg Wittig) writes:
>Does there exist a standard way to determine the name of the current program
>from within a program under CP/M PLUS?
[...stuff deleted...]
>I couldn't find a CALL 5 entry, nor do the addresses 0H - 0FFH contain that
>information on my CP/M PLUS machine. :-|
>But there *must* be a way to determine it, because the CCP displays the last
>command (program) executed when I type Control-W. Where is the pointer to that
>text?
I'm not sure about CP/M PLUS but my ZCPR33/Z-System works like this ...
As the CCP loads the program the same way as any other program would
load a file, it uses an FCB.
This FCB is located not in low core (0..ff) but rather somewhere in high
core (probably even above the CCP/BDOS/BIOS).
One trick might be to write a program which scans the entire memory for
it's own name (Call it AAAAAAAA.COM, look for 8 consecutive A's but
watch out for the command line buffer).
ZCPR33 has the address of this "external FCB" stored in it's
"environment descriptor" so you can just use a library function and
voila ... You know who You are (at least Your program knows who it is).
regards
Josef Moellers | c/o Nixdorf Computer AG
USA: uunet!philabs!linus!nixbur!mollers.pad | Abt. DX-PC
!USA: mcvax!unido!nixpbe!mollers.pad | Pontanusstr
Phone: (+49) 5251 146245 | D-4790 Paderborn