Binary packaging on the CPCs
Binary packaging on the CPCs
Should the appmake features need fixes or improvements ?
Do we need to update the documentation (see below) ?
http://www.z88dk.org/wiki/doku.php/platform:amstradcpc
Do we need to update the documentation (see below) ?
http://www.z88dk.org/wiki/doku.php/platform:amstradcpc
I had no problems while using create-app. It produced a good CPC binary, including AMSDOS header with correct origin and execution address. Lovely !
On the other side, I had to use some third-party tools to convert binary data to source-code and so on (using well-known tools such as BIN2C etc) but I think it's outside z88dk's scope.
About the wiki, I just noted few things..
"zcc +cpc [...] -lmz -l6128_math
or -l664_math or -l664_math which will save about 600 bytes of memory."
I wonder why this 600 bytes difference !
Still, on the wiki. If you produce code under 0x1200 and needs to get loaded then run from BASIC, you need the following sequence :
On the other side, I had to use some third-party tools to convert binary data to source-code and so on (using well-known tools such as BIN2C etc) but I think it's outside z88dk's scope.
About the wiki, I just noted few things..
"zcc +cpc [...] -lmz -l6128_math
or -l664_math or -l664_math which will save about 600 bytes of memory."
I wonder why this 600 bytes difference !
Still, on the wiki. If you produce code under 0x1200 and needs to get loaded then run from BASIC, you need the following sequence :
Code: Select all
openout"d":memory &3ff:closeout:load"mybin",&400:call &400
Actually, it's because there's a generic CPC math library which will pull in all cpc math routines and patch them so that the correct firmware address is called. Using the machine specific one will only pull in the routines that are needed.stefano wrote:As far as I recall the 600 bytes was the difference between the standard z88dk float lib and the target specific one.
Each files in Amstrad file-system is defined by the following header :Could you please help explaining in detail the..
run"binary
Code: Select all
typedef struct
{
BYTE UserNumber;
BYTE FileName[ 15 ];
BYTE BlockNum;
BYTE LastBlock;
BYTE FileType;
WORD Length;
WORD Adress;
BYTE FirstBlock;
WORD LogicalLength;
WORD EntryAdress;
BYTE Unused[ 0x24 ];
WORD RealLength;
BYTE BigLength;
WORD CheckSum;
BYTE Unused2[ 0x3B ];
} StAmsdos;
When using run"Binary", the system check for the file's header. It loads the binary at LoadAdress and execute (call) EntryAdress, once loaded.
Run"Binary is equal to
Code: Select all
memory LoadAdress - 1
load "binary", LoadAdress
call EntryAdress
As you can see in this other post that its not totally true.norecess wrote:Run"Binary is equal to
Code: Select all
memory LoadAdress - 1 load "binary", LoadAdress call EntryAdress
Finally i have tested -create-app and -make-App:
-create-app Inserts amsoft header, so the binary can execute with run"binary
-make-app need to use memory/load/call to run.
Cheers.
I not use it, i only say that:stefano wrote:"-make-app" is new to me.. is it really necessary ?
What if you just omit that flag ?
-create-app Inserts amsoft header, so the binary can execute with run"binary
-make-app need to use memory/load/call to run.
I tried it in the past because i don't understand the difference between them, i think the doc explanation is confused:
http://www.z88dk.org/wiki/doku.php/zcc
-create-app Create an application image (i.e. bank 63,62 etc)
-make-app (App) Notify the compiler that you're trying to make an
application
Cheers.