This wiki is being migrated to



This shows you the differences between two versions of the page.

platform:amstradcpc [2018/02/07 20:37]
platform:amstradcpc [2018/02/12 22:41] (current)
Line 141: Line 141:
=== Stack Pointer === === Stack Pointer ===
-The CPC crt0 will pick a stack based on the contents of ($ae60) which defines the UDG address. On a CPC464 this value is uninitialised so the stack will probably end up at 0x0000. This is likely to paged out during firmware operations and cause a crash, in addition to corrupting the screen.+The CPC crt0 will use the 256 byte stack made available by the firmware. If this is not large enough then you will need to specify a stack address. This can be achieved with:
-Thus on a CPC464, you should compile with -pragma-define:REGISTER_SP=-0xae7d+-pragma-define:REGISTER_SP=0xnnnn
-If your program only uses a small stack (<256 bytes), then you can get away without initialising the stack pointer by giving the option -pragma-define:REGISTER_SP=-1 which will cause your program to use the same stack as BASIC. 
=== Application Creation === === Application Creation ===
platform/amstradcpc.txt · Last modified: 2018/02/12 22:41 by dom
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki