Editing
File Formats
(section)
From F256 Foenix
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== PGZ == This is a more advanced multi-segment executable. It can be loaded as low as $0200. It is loaded using <code>pexec</code>. When <code>pexec</code> loads a program, the program must not load itself into RAM banks 6 & 7, as these are used by the kernel, and the kernel is doing the actual loading. If the program does not need the kernel, it may of course utilize these banks once it is running. <code>pexec</code> is otherwise able to load code and data into anywhere in physical memory. When the program starts, the state of the MMU LUTs is very similar to when a KUP starts. LUT #3 is active and slots 0-4 are mapped to RAM banks 0-4. The program's entry point must be in this region. Slots 6 and 7 are mapped to the kernel, which is intact and usable right away. Slot 5 is currently undefined. Testing a PGZ can be done by using FoenixMgr and the <code>xdev</code> firmware component. It can of course also be copied to a disk or SD card, and manually run it on the machine. A PGZ cannot "return" to another program, it can either start a KUP (if the kernel is intact) or reset the machine. The first byte of the file is a file signature and also a version tag. If the first byte is an upper case Z, the file is a 24-bit PGZ file (i.e. all addresses and sizes specified in the file are 24-bits). If the file is a lower case Z, the file is a 32-bit PGZ file (all address and sizes are 32-bits in length). Note that all addresses and sizes are in little endian format (that is, least significant byte first). After the initial byte, the remainder of the PGZ file consists of segments, one after the other. Each segment consists of two or three fields: {| class="wikitable" !Field!!Size!!Description |- |address||3 ('''Z''') or 4 ('''z''') bytes||The target address for this segment |- |size||3 ('''Z''') or 4 ('''z''') bytes||The number of bytes in the data field |- |data||'''size''' bytes||The data to be loaded (optional) |} For a particular segment, if the size field is 0, there will be no bytes in the data field, and the segment specifies the starting address of the entire program. At least one such segment must be present in the PGZ file for it to be executable. If more than one is present, the last one will be the one used to specify the starting address. <br />''Original Information Source:'' https://github.com/FoenixRetro/Documentation/blob/main/f256/programming-file-formats.md
Summary:
Please note that all contributions to F256 Foenix are considered to be released under the Creative Commons Zero (Public Domain) (see
F256 Foenix:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
Edit source
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Tools
What links here
Related changes
Special pages
Page information