[z88dk-dev] some changes to appmake +rom

Bridge to the z88dk-developers mailing list
Post Reply
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

[z88dk-dev] some changes to appmake +rom

Post by alvin »

The main point of the changes was to allow a binary to be embedded at its proper org address inside an output rom. The old code wasn't allowing that and always created a rom with the binary at the beginning and padded to correct size.

Now the characteristics of the destination rom are separate from the binary. You can specify the rom size as well as its base address and the output binary will be placed into that rom at the correct org address. If rom size == 0, the output will contain the binary only.

For the new c lib embedded target in particular, you can specify that the output binary should be embedded in a 16k rom at address 0 as part of create-app like this:

zcc +embedded +vn -SO3 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test -create-app -Cz--romsize=0x4000

You could also place the output binary in a 32k rom that is mapped to upper memory at address 32768 like this:

zcc +embedded +vn -SO3 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test -create-app -Cz--rombase=32768 -Cz--romsize=0x8000

In both cases the output will be a *.rom file of 16k (first case) or 32k (second case) size with the binary correctly orged inside those. If the binary does not fit into the specified rom, an error is generated.

Further binary files can be injected into the output rom using appmake +inject.



------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

zcc +embedded +vn -SO3 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test -create-app -Cz--romsize=0x4000
zcc +embedded +vn -SO3 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test -create-app -Cz--rombase=32768 -Cz--romsize=0x8000
Woops, those compile lines should be:

zcc +embedded +vn -SO3 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test -create-app -Cz--romsize -Cz0x4000
zcc +embedded +vn -SO3 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test -create-app -Cz--rombase -Cz32768 -Cz--romsize -Cz0x8000

I'm getting too used to the pragma-define stuff that zcc accepts. appmake requires option and parameter to be separate on the command line.



------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

zcc +embedded +vn -SO3 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test -create-app -Cz--romsize=0x4000
zcc +embedded +vn -SO3 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test -create-app -Cz--rombase=32768 -Cz--romsize=0x8000
Woops, those compile lines should be:

zcc +embedded +vn -SO3 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test -create-app -Cz--romsize -Cz0x4000
zcc +embedded +vn -SO3 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test -create-app -Cz--rombase -Cz32768 -Cz--romsize -Cz0x8000
I've modified appmake to optionally accept parameters following a long option name and an equal sign. So the above compile lines can also be written as:

zcc +embedded +vn -SO3 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test -create-app -Cz--romsize=0x4000
zcc +embedded +vn -SO3 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test -create-app -Cz--rombase=32768 -Cz--romsize=0x8000

which should annoy less with fewer "-Cz" in there.



------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
Post Reply