ROM disk file slack?

57 views
Skip to first unread message

Robb Bates

unread,
Nov 3, 2025, 3:17:55 PM (2 days ago) Nov 3
to RC2014-Z80
Wayne, in the ROM disk, are the files entirely contiguous or are they arranged in sectors?  If so, how big?  128 bytes?  4k?

Just wondering about optimizing the file size of a program I'm working on.  Not critical, just curiosity.

Robb

Wayne Warthen

unread,
Nov 3, 2025, 3:51:30 PM (2 days ago) Nov 3
to RC2014-Z80
https://www.cpm8680.com/cpmtools/cpm.htmHi Robb,

The ROM disk is a CP/M filesystem.  A CP/M filesystem stores files using block pointers, so the files may not be contiguous.  A good reference for the CP/M filesystem can be found at https://www.cpm8680.com/cpmtools/cpm.htm.  With that said, since the ROM Disk is built from a blank disk image, the files are probably all contiguous.

The RomWBW ROM Disk has the following attributes:

    B: Drive Characteristics
 3072: 128 Byte Record Capacity
  384: Kilobyte Drive  Capacity
  256: 32  Byte Directory Entries
    0: Checked  Directory Entries
  256: Records/ Extent
   16: Records/ Block
   64: Sectors/ Track
    0: Reserved Tracks

CP/M uses a 128-byte "record".  Files are stored in "blocks" of records.  In the case of the RomWBW ROM Disk, you can see above that a block is 16 records, so 2K bytes per block.  So, all files are stored in increments of 2K.  So, to optimize files for storage on the ROM Disk, you would want to avoid going over 2K chunks by small amount.  A file that is 2049 bytes will requires 2 x blocks thus using up 4K of disk space and wasting most of the second block.

Note that the 2K blocksize used by RomWBW is the smallest possible in CP/M for disks >= 256K.

Thanks, Wayne

Richard Deane

unread,
Nov 4, 2025, 2:36:39 AM (2 days ago) Nov 4
to rc201...@googlegroups.com
That disk wastage was one reason LBR files were invented, and loader hacks/extensions to load the file out of the LBR. I think that may be built into nzcom and z-system.
Richard



--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/rc2014-z80/870c2b1f-d283-4e4c-8f7a-d924db6db356n%40googlegroups.com.

Robb Bates

unread,
Nov 4, 2025, 12:37:22 PM (2 days ago) Nov 4
to RC2014-Z80
Thanks Wayne, that's exactly the answer I was looking for.  The program I'm working on is right around 2k, so making it 1500 bytes makes little difference than if it was 2048.  But 2049 is a whole other story.  <=2048 is my goal then.  Looking for those JPs I can turn into JRs!

Robb

Reply all
Reply to author
Forward
0 new messages