agn453 / UNZIP-CPM-Z80

UNZIP and ZIP for CP/M Z80
The Unlicense
34 stars 4 forks source link

Question: port it to 8080? #14

Closed roytam1 closed 8 months ago

roytam1 commented 8 months ago

I wonder if it is possible to remove Z80-only instructions and make it work on Intel 8080?

agn453 commented 8 months ago

I wouldn't say it is impossible - but, given that the current unzip implementation (UNZIP157.COM) uses self-modifying code (like modifying the destination of a z80-relative branch instruction to achieve significant speed improvements), z80 index register and z80 bit test/set/reset instructions, I don't think I will attempt this.

If you're up for a challenge, a suitable starting point would be to run the Zilog assembler source file UNZIP157.Z80 through a Z80 to Intel translator ( such as XZI.COM from http://cpmarchives.classiccmp.org//cpm/mirrors/oak.oakland.edu/pub/cpm/asmutl/xizi-3.lbr ) then manually go through the code and write 8080 code to emulate the Z80 specific code (e.g. replace relative branches with absolute jumps etc).

Tony