Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Just think, with VLSI we can have 100 ENIACS on a chip!" -- Alan Perlis


devel / comp.os.cpm / Re: Self-decompressing COM files?

SubjectAuthor
* Self-decompressing COM files?Steve Nickolas
`* Re: Self-decompressing COM files?Jacob Nevins
 +- Re: Self-decompressing COM files?Steve Nickolas
 `* Re: Self-decompressing COM files?Steve Nickolas
  `* Re: Self-decompressing COM files?Jacob Nevins
   +- Re: Self-decompressing COM files?Steve Nickolas
   `- Re: Self-decompressing COM files?Tony Nicholson

1
Self-decompressing COM files?

<alpine.DEB.2.21.2401030808450.13188@sd-119843.dedibox.fr>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4686&group=comp.os.cpm#4686

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: usots...@buric.co (Steve Nickolas)
Newsgroups: comp.os.cpm
Subject: Self-decompressing COM files?
Date: Wed, 3 Jan 2024 08:16:29 -0500
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <alpine.DEB.2.21.2401030808450.13188@sd-119843.dedibox.fr>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset=US-ASCII
Injection-Info: dont-email.me; posting-host="90a60193a2656d3738df1c006aa061fe";
logging-data="3384054"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+396D0Gz6N3T1xLUhlNjZIhd0jYbWqxC8="
User-Agent: Alpine 2.21 (DEB 202 2017-01-01)
Cancel-Lock: sha1:v4kQThKeaz2MKesaM2JL8EVT0e8=
X-X-Sender: mary@sd-119843.dedibox.fr
 by: Steve Nickolas - Wed, 3 Jan 2024 13:16 UTC

OK, this is going to get weird. The tl;dr of it is that I'm wondering if
there's a tool to create self-decompressing (like what upx does) binaries
for CP/M-80 (i.e., a CP/M executable cruncher). I'll get into the gories.

I've been working on porting some games to a system (Nabu) that runs CP/M
3.1 - the call at 5 is to $BA06. (There are two other unofficial ports of
CP/M, both of 2.2, and one of them I'll probably need to figure out the
equivalent value; the other I don't care about.)

For one of them, I've been working on trying to expand it from the source
version's (MSX) 76 levels to the full 150. I don't think there's memory
to have all 150 and still enough room to load the program from CP/M. (The
level storage format is kind-of sparse and wasteful, but easy to figure
out. Basically, it's BCD.) I decided to include 120 levels.

But I was wondering about whether, using an executable cruncher, I could
try to include the whole set of 150.

(The other method - to store them in a file and load them on the fly, like
the original game on the Apple ][ - would require a lot more refactoring
of the code to move where scratch RAM is located.)

-uso.

Re: Self-decompressing COM files?

<L6g*biwzz@news.chiark.greenend.org.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4687&group=comp.os.cpm#4687

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!nntp.comgw.net!weretis.net!feeder8.news.weretis.net!newsfeed.xs3.de!nntp-feed.chiark.greenend.org.uk!ewrotcd!.POSTED.chiark.greenend.org.uk!not-for-mail
From: jac...@chiark.greenend.org.uk (Jacob Nevins)
Newsgroups: comp.os.cpm
Subject: Re: Self-decompressing COM files?
Date: 03 Jan 2024 16:15:01 +0000 (GMT)
Organization: SGO
Message-ID: <L6g*biwzz@news.chiark.greenend.org.uk>
References: <alpine.DEB.2.21.2401030808450.13188@sd-119843.dedibox.fr>
Injection-Info: chiark.greenend.org.uk; posting-host="chiark.greenend.org.uk:212.13.197.229";
logging-data="7082"; mail-complaints-to="abuse@chiark.greenend.org.uk"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: jacobn@chiark.greenend.org.uk ([212.13.197.229])
 by: Jacob Nevins - Wed, 3 Jan 2024 16:15 UTC

Steve Nickolas <usotsuki@buric.co> writes:
>OK, this is going to get weird. The tl;dr of it is that I'm wondering if
>there's a tool to create self-decompressing (like what upx does) binaries
>for CP/M-80 (i.e., a CP/M executable cruncher).

PopCom! is one such.

Apparently I've lost track of where CP/M archive mirrors are these days,
but you can download a copy, and documentation in Japanese (looks like
Shift-JIS encoding), from
https://www.asahi-net.or.jp/~am9y-mn/fswlist.htm

>I've been working on porting some games to a system (Nabu) that runs CP/M
>3.1 - the call at 5 is to $BA06. (There are two other unofficial ports of
>CP/M, both of 2.2, and one of them I'll probably need to figure out the
>equivalent value; the other I don't care about.)
>
>For one of them, I've been working on trying to expand it from the source
>version's (MSX) 76 levels to the full 150. I don't think there's memory
>to have all 150 and still enough room to load the program from CP/M.
[...]
>But I was wondering about whether, using an executable cruncher, I could
>try to include the whole set of 150.

I'm not sure how much PopCom will help you increase your maximum program
size on your CP/M 3.1 system, though?
(Disclaimer: I only ever used a banked 3.1 system with loads of memory,
so I had a massive TPA and never had to understand any of this stuff
properly. So I may have misunderstood. Also I haven't thought about any
of this for a very long time.)

Machine-translating the PopCom docs:

"When a programme compressed with PopCom! is executed, it is not limited
by the TPA size when PopCom! is executed."

Looking at this CP/M 2 description
http://www.gaby.de/cpm/manuals/archive/cpm22htm/ch5.htm
I can see how PopCom can increase effective program size, because the
definition of TPA (limiting the loaded program's size) doesn't include
the CCP, but your program can re-use the CCP's space once it's loaded.
So I guess PopCom lets you increase your program size by the size of the
CCP (however much that is), since PopCom can uncompress into space that
was occupied by the CCP during loading.

However, on CP/M 3, I think that restriction on loaded program size
is reduced to the LOADER (not the whole CCP), which is documented as
being "three pages long" (= 384 bytes IIRC).
(http://www.cpm.z80.de/manuals/cpm3-pgr.pdf pp17-8)
So I think PopCom can only increase your maximum program size by that
much on CP/M 3? (And I don't know how much of that PopCom's own
overheads might eat.)

Other tidbits machine-translated from POPCOM.DOC, in case they avoid
wasting your time:
"PopCom! can be used with CP/M of 47K or more (TPA 42K or more).
However, a CPU equivalent to Z80 or higher is required."
"It also uses only the minimum amount of memory required for
decompression, so if the source programme is one that does not destroy
CCP, the compressed programme will also work without destroying CCP in
most cases."

It looks like your TPA is 46.25 kbyte or thereabouts, so I guess PopCom
will work on your system.

Re: Self-decompressing COM files?

<alpine.DEB.2.21.2401031126400.14728@sd-119843.dedibox.fr>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4688&group=comp.os.cpm#4688

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: usots...@buric.co (Steve Nickolas)
Newsgroups: comp.os.cpm
Subject: Re: Self-decompressing COM files?
Date: Wed, 3 Jan 2024 11:30:22 -0500
Organization: A noiseless patient Spider
Lines: 57
Message-ID: <alpine.DEB.2.21.2401031126400.14728@sd-119843.dedibox.fr>
References: <alpine.DEB.2.21.2401030808450.13188@sd-119843.dedibox.fr> <L6g*biwzz@news.chiark.greenend.org.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII; format=flowed
Injection-Info: dont-email.me; posting-host="90a60193a2656d3738df1c006aa061fe";
logging-data="3437026"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/7YKluWWsjt1vMX79WvnIXiZL2+v029Qg="
User-Agent: Alpine 2.21 (DEB 202 2017-01-01)
Cancel-Lock: sha1:oUsgab79WVnJkaOEvO7txp8XsAI=
X-X-Sender: mary@sd-119843.dedibox.fr
In-Reply-To: <L6g*biwzz@news.chiark.greenend.org.uk>
 by: Steve Nickolas - Wed, 3 Jan 2024 16:30 UTC

On Wed, 3 Jan 2024, Jacob Nevins wrote:

> Steve Nickolas <usotsuki@buric.co> writes:
>> OK, this is going to get weird. The tl;dr of it is that I'm wondering if
>> there's a tool to create self-decompressing (like what upx does) binaries
>> for CP/M-80 (i.e., a CP/M executable cruncher).
>
> PopCom! is one such.
>
> Apparently I've lost track of where CP/M archive mirrors are these days,
> but you can download a copy, and documentation in Japanese (looks like
> Shift-JIS encoding), from
> https://www.asahi-net.or.jp/~am9y-mn/fswlist.htm

Yeah, it's SJIS. My Japanese isn't great but I do speak it a little... ;p

>> I've been working on porting some games to a system (Nabu) that runs CP/M
>> 3.1 - the call at 5 is to $BA06. (There are two other unofficial ports of
>> CP/M, both of 2.2, and one of them I'll probably need to figure out the
>> equivalent value; the other I don't care about.)
>>
>> For one of them, I've been working on trying to expand it from the source
>> version's (MSX) 76 levels to the full 150. I don't think there's memory
>> to have all 150 and still enough room to load the program from CP/M.
> [...]
>> But I was wondering about whether, using an executable cruncher, I could
>> try to include the whole set of 150.
>
> I'm not sure how much PopCom will help you increase your maximum program
> size on your CP/M 3.1 system, though?
> (Disclaimer: I only ever used a banked 3.1 system with loads of memory,
> so I had a massive TPA and never had to understand any of this stuff
> properly. So I may have misunderstood. Also I haven't thought about any
> of this for a very long time.)

I'm actually kicking CP/M out after I load the program. But the program
won't load right if it's big enough to step on the BDOS in the process.

> Other tidbits machine-translated from POPCOM.DOC, in case they avoid
> wasting your time:
> "PopCom! can be used with CP/M of 47K or more (TPA 42K or more).
> However, a CPU equivalent to Z80 or higher is required."
> "It also uses only the minimum amount of memory required for
> decompression, so if the source programme is one that does not destroy
> CCP, the compressed programme will also work without destroying CCP in
> most cases."
>
> It looks like your TPA is 46.25 kbyte or thereabouts, so I guess PopCom
> will work on your system.

Nod. It's an unbanked 64K system.

I'm just using CP/M as a loader, so if the decompressor stomps on CP/M, I
don't really care. Might have to make it DI first though, if it doesn't
already.

-uso.

Re: Self-decompressing COM files?

<alpine.DEB.2.21.2401031140240.14831@sd-119843.dedibox.fr>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4689&group=comp.os.cpm#4689

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: usots...@buric.co (Steve Nickolas)
Newsgroups: comp.os.cpm
Subject: Re: Self-decompressing COM files?
Date: Wed, 3 Jan 2024 11:41:37 -0500
Organization: A noiseless patient Spider
Lines: 5
Message-ID: <alpine.DEB.2.21.2401031140240.14831@sd-119843.dedibox.fr>
References: <alpine.DEB.2.21.2401030808450.13188@sd-119843.dedibox.fr> <L6g*biwzz@news.chiark.greenend.org.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII; format=flowed
Injection-Info: dont-email.me; posting-host="90a60193a2656d3738df1c006aa061fe";
logging-data="3440357"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18KWAPzPaor2oMc2ZG7E6T/R09VlRcdUdw="
User-Agent: Alpine 2.21 (DEB 202 2017-01-01)
Cancel-Lock: sha1:2Vckv0MTjYETvyutSdt2oSG//70=
X-X-Sender: mary@sd-119843.dedibox.fr
In-Reply-To: <L6g*biwzz@news.chiark.greenend.org.uk>
 by: Steve Nickolas - Wed, 3 Jan 2024 16:41 UTC

Just tested it - had to go into an actual CP/M environment, but that was
fine - crunched the game I was working on (Lode Runner btw) and tried it,
and it worked.

-uso.

Re: Self-decompressing COM files?

<bBh*Eqwzz@news.chiark.greenend.org.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4690&group=comp.os.cpm#4690

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!.POSTED.chiark.greenend.org.uk!not-for-mail
From: jac...@chiark.greenend.org.uk (Jacob Nevins)
Newsgroups: comp.os.cpm
Subject: Re: Self-decompressing COM files?
Date: 03 Jan 2024 16:51:05 +0000 (GMT)
Organization: SGO
Message-ID: <bBh*Eqwzz@news.chiark.greenend.org.uk>
References: <alpine.DEB.2.21.2401030808450.13188@sd-119843.dedibox.fr> <L6g*biwzz@news.chiark.greenend.org.uk> <alpine.DEB.2.21.2401031140240.14831@sd-119843.dedibox.fr>
Injection-Info: chiark.greenend.org.uk; posting-host="chiark.greenend.org.uk:212.13.197.229";
logging-data="7611"; mail-complaints-to="abuse@chiark.greenend.org.uk"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: jacobn@chiark.greenend.org.uk ([212.13.197.229])
 by: Jacob Nevins - Wed, 3 Jan 2024 16:51 UTC

Steve Nickolas <usotsuki@buric.co> writes:
>Just tested it - had to go into an actual CP/M environment, but that was
>fine - crunched the game I was working on (Lode Runner btw) and tried it,
>and it worked.

\o/

Re running in actual CP/M environment: for what it's worth, I find that
utilities like PMEXT run fine under zxcc, which means I can conveniently
run them in my host (Linux) environment.
https://www.seasip.info/Unix/Zxcc/index.html
POPCOM may work this way too. (In a quick test, it seemed to basically
work, although there was a "cpmredir: Corrupt FCB" glitch on exit.)

Re: Self-decompressing COM files?

<alpine.DEB.2.21.2401031207150.14958@sd-119843.dedibox.fr>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4691&group=comp.os.cpm#4691

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: usots...@buric.co (Steve Nickolas)
Newsgroups: comp.os.cpm
Subject: Re: Self-decompressing COM files?
Date: Wed, 3 Jan 2024 12:07:39 -0500
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <alpine.DEB.2.21.2401031207150.14958@sd-119843.dedibox.fr>
References: <alpine.DEB.2.21.2401030808450.13188@sd-119843.dedibox.fr> <L6g*biwzz@news.chiark.greenend.org.uk> <alpine.DEB.2.21.2401031140240.14831@sd-119843.dedibox.fr> <bBh*Eqwzz@news.chiark.greenend.org.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII; format=flowed
Injection-Info: dont-email.me; posting-host="90a60193a2656d3738df1c006aa061fe";
logging-data="3447663"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19X5bfsV1J2OHlAtq3SBXyivClogiYlzhk="
User-Agent: Alpine 2.21 (DEB 202 2017-01-01)
Cancel-Lock: sha1:UZaocUIXoSGkDVBERU1R9KPDFZk=
In-Reply-To: <bBh*Eqwzz@news.chiark.greenend.org.uk>
X-X-Sender: mary@sd-119843.dedibox.fr
 by: Steve Nickolas - Wed, 3 Jan 2024 17:07 UTC

On Wed, 3 Jan 2024, Jacob Nevins wrote:

> Steve Nickolas <usotsuki@buric.co> writes:
>> Just tested it - had to go into an actual CP/M environment, but that was
>> fine - crunched the game I was working on (Lode Runner btw) and tried it,
>> and it worked.
>
> \o/
>
> Re running in actual CP/M environment: for what it's worth, I find that
> utilities like PMEXT run fine under zxcc, which means I can conveniently
> run them in my host (Linux) environment.
> https://www.seasip.info/Unix/Zxcc/index.html
> POPCOM may work this way too. (In a quick test, it seemed to basically
> work, although there was a "cpmredir: Corrupt FCB" glitch on exit.)
>

Perhaps. I tried the Lopushinsky emulators in DOSBOX. (I also run on a
Linux host.)

-uso.

Re: Self-decompressing COM files?

<un9q66$9g46$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4692&group=comp.os.cpm#4692

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tony.nic...@computer.org (Tony Nicholson)
Newsgroups: comp.os.cpm
Subject: Re: Self-decompressing COM files?
Date: Sat, 6 Jan 2024 07:52:23 +1100
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <un9q66$9g46$1@dont-email.me>
References: <alpine.DEB.2.21.2401030808450.13188@sd-119843.dedibox.fr>
<L6g*biwzz@news.chiark.greenend.org.uk>
<alpine.DEB.2.21.2401031140240.14831@sd-119843.dedibox.fr>
<bBh*Eqwzz@news.chiark.greenend.org.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 5 Jan 2024 20:52:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4b4eab0ff17b725fea4aa945e3ae89eb";
logging-data="311430"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/yDlmZszvkmQmixQkyWhY4"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:T44dBq94+NW18JkCxLzNtolbKdU=
In-Reply-To: <bBh*Eqwzz@news.chiark.greenend.org.uk>
Content-Language: en-US
 by: Tony Nicholson - Fri, 5 Jan 2024 20:52 UTC

On 4/01/2024 3:51 am, Jacob Nevins wrote:
> Steve Nickolas <usotsuki@buric.co> writes:
> Re running in actual CP/M environment: for what it's worth, I find that
> utilities like PMEXT run fine under zxcc, which means I can conveniently
> run them in my host (Linux) environment.
> https://www.seasip.info/Unix/Zxcc/index.html
> POPCOM may work this way too. (In a quick test, it seemed to basically
> work, although there was a "cpmredir: Corrupt FCB" glitch on exit.)

I've collected some updates and patches for John Elliot's ZXCC which
you'll find on GitHub at

https://github.com/agn453/ZXCC

Be sure to read the README for the complete list of changes.

Tony

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor