cgs@umd5.umd.edu (Chris Sylvain) (09/21/88)
This program unravels MS-DOS's (on most machines, Versions 2.0 up to 3.3) memory control blocks (MCBs) and prints the information it finds. If run under MS-DOS 3.0 or later, it will also print the name it can find for each program in memory. The commenting and wording of printing messages have been changed in a number of places. MS-DOS allocates blocks in 16-byte paragraphs, so multiply the block size reported by the program by 16 to determine the block length in bytes. Microsoft has never officially documented how MSDOS allocates memory, so much of this program is based on techniques others have discovered. Written for MASM 5.0 by Hardin Brothers for PCResource. The original appeared in the July 1988 issue of their magazine. Entire contents of the July 1988 issue, Copyright 1988 by IDG Communications/Peterborough, Inc. Chris Sylvain ARPA: cgs@umd5.UMD.EDU BITNET: cgs%umd5@umd2 UUCP: ..!uunet!umd5.umd.edu!cgs [ The executable and assembly source are included. Memlist works very nicely, and gives a nice clean display of what is in memory. Since this program was published in PC Resource magazine, and typed by Chris Sylvain from the printed listing, I suggested that he investigate the magazine's copyright policy. He explained Usenet to the magazine, and here is a slightly edited summary of what he told me: "1. If the code is obtained from the Clone Phone BBS, then it is OK to distribute for free. "2. Since I typed it in from the pages of the magazine, it is essentially OK to distribute for free as long as it is attributed to the magazine. "I asked him if it was the spirit of proper attribution that was most essential, and he assented. They have my name and phone number, and I described very briefly to him what is USENET. "So it sounds to me that you may post MEMLIST with permission, and the other things that I have from the magazine will be OK to post as well." PC Resource readers readers should therefore feel free to submit good programs obtained from the magazine, with proper credit to the source. checksum size (bytes) file 58639 9699 this uuencoded posting 60150 6905 memlist.arc -- R.D. ] BEGIN--cut here--cut here begin 644 memlist.arc M&@A-14U,25-4+D%330!>3!<``"01D::Y#MPM```,8]ZT:5/T0?!HH4)B`6 M"IHT<T#`D?/FC)PP;4#4<7/13ADV$8D\F7(B(HHW;D"T>3/G8)LP8QZZ*3.'_ M!0@K9>3,28,RH@P7,#3"`4'G#8@9+F:D8$API9P\(`(:I,@&A!@V;\:L,=EDY MB)`Y*4"$<4-&HIPT!B/205,&!%HS;^2\I,,S99J#9M"2F>."81(S(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