Если вы хотели бы попробовать, у нас есть SDCC работы с z88dk. Все операции выполняются автоматически, с ЭЛТ специализируется на спектр, который уже включен.ЭЛТ настраиваемый по в исходных директив или файла конфигурации. Он заботится о всех данных и BSS инициализации секции, а также инициализацию кучи и, возможно, размещая драйверов на stdin/stdout/stderr.
Выход необработанных двоичных данных, к которым вы можете предварять заголовок, если это то, что вам нужно.
Пример:
zcc +zx -vn -clib=sdcc_ix --reserve-regs-iy --max-allocs-per-node200000 test.c -o testКод:#include <stdio.h>
#include <stropts.h>
#include <arch/spectrum.h>
#include <string.h>
#include <stdlib.h>
char buffer[100]; // max edit buffer size is 64
main()
{
unsigned int i;
zx_border(INK_WHITE);
ioctl(1, IOCTL_OTERM_CLS);
for (i=0; ; ++i)
{
printf("%5u %0#5x %I\n", i, i, i + ((unsigned long)(~i) << 16));
if (rand() > 32100)
{
printf("\nEnter a message:\n");
fflush(stdin);
scanf("%[^\n]", buffer);
printf("\nMessage received and reversed:\n%s\n\n", strrev(buffer));
}
}
}
все, что нужно для компиляции с SDCC.Выход необработанных двоичных данных "test_CODE.bin" org 32768 по умолчанию.
Есть много вариантов CRT, выбранные, используя опцию "-startup = N", чтобы выбрать один по количеству.
zcc +zx -vn -startup=8 -clib=sdcc_ix --reserve-regs-iy --max-allocs-per-node200000 test.c -o test
выберет ЭЛТ с fzx водителя прилагается стандартный вывод (fzx является пропорциональная система шрифта, шрифт "Soxz" по умолчанию). Концевые водители настраиваемый и оконный.
Вы можете уменьшить размер исполняемого путем удаления вещи на ЭЛТ с помощью директив измените значения по умолчанию и при выборе ЭЛТ, который не имеет ничего, прикрепленный к stdin/stdout/stderr (-startup = 31)
Код:#include <stdio.h>
#include <stropts.h>
#include <arch/spectrum.h>
#include <string.h>
#include <stdlib.h>
#pragma output CRT_ORG_CODE = 30000 // change ORG
#pragma output REGISTER_SP = 60000 // change location of stack
#pragma output CLIB_MALLOC_HEAP_SIZE = 0 // change size of heap
#pragma output CRT_ENABLE_RESTART = 1 // on exit restart program
// many more pragmas
char buffer[100]; // max edit buffer size is 64
main()
...
Мы ищем людей, чтобы помочь тест. Библиотеки в z88dk позволит вам сделать гораздо больше вещей, чем может быть сделано с один и с SDCC в качестве дополнительного генератора кода вы не должны терять качество кода SDCC.
Мы не имеем 64-разрядных целыми или с плавающей точкой, поддерживаемый с SDCC еще.
Вам нужна последняя ночную сборку отсюда:
http://nightly.z88dk.org/
Вы также должны модифицированную версию SDCC.Патч будет применен к официальной SDCC раз регрессии испытания прошли. В этом молнии является исполняемым окна и СВН патч, который может быть применен к источнику SDCC собрать на месте.
https://drive.google.com/open?id=0B6...bWs&authuser=0
Если у вас возникли проблемы с SDCC, все происходит автоматически и легко z88dk. Есть, конечно, могут быть некоторые ошибки присутствуют :)
===========
If you would like to try it, we have sdcc working with z88dk. Everything is automatic, with crt specialized for the spectrum already included. The crt is highly customizable by in source pragmas or config file. It takes care of all the data and bss section initialization as well as initialization of the heap and optionally placing drivers on stdin/stdout/stderr.
The output is a raw binary to which you can prepend a header if that's what you need.
Example:
zcc +zx -vn -clib=sdcc_ix --reserve-regs-iy --max-allocs-per-node200000 test.c -o testКод:#include <stdio.h>
#include <stropts.h>
#include <arch/spectrum.h>
#include <string.h>
#include <stdlib.h>
char buffer[100]; // max edit buffer size is 64
main()
{
unsigned int i;
zx_border(INK_WHITE);
ioctl(1, IOCTL_OTERM_CLS);
for (i=0; ; ++i)
{
printf("%5u %0#5x %I\n", i, i, i + ((unsigned long)(~i) << 16));
if (rand() > 32100)
{
printf("\nEnter a message:\n");
fflush(stdin);
scanf("%[^\n]", buffer);
printf("\nMessage received and reversed:\n%s\n\n", strrev(buffer));
}
}
}
is all it takes to compile with sdcc. The output is a raw binary "test_CODE.bin" org 32768 by default.
There are many crt variations chosen by adding a "-startup=N" option to choose one by number.
zcc +zx -vn -startup=8 -clib=sdcc_ix --reserve-regs-iy --max-allocs-per-node200000 test.c -o test
will choose a crt with fzx driver attached to stdout (fzx is a proportional font system, font "Soxz" is default). The terminal drivers are customizable and are windowed.
You can reduce the size of the binary by removing things from the crt using pragmas to alter the defaults and by choosing a crt that has nothing attached to stdin/stdout/stderr (-startup=31)
We're looking for people to help test. The libraries in z88dk enable you to do many more things than can be done with sdcc alone and with sdcc as optional code generator you don't have to lose any code quality.Код:#include <stdio.h>
#include <stropts.h>
#include <arch/spectrum.h>
#include <string.h>
#include <stdlib.h>
#pragma output CRT_ORG_CODE = 30000 // change ORG
#pragma output REGISTER_SP = 60000 // change location of stack
#pragma output CLIB_MALLOC_HEAP_SIZE = 0 // change size of heap
#pragma output CRT_ENABLE_RESTART = 1 // on exit restart program
// many more pragmas
char buffer[100]; // max edit buffer size is 64
main()
...
We do not have 64-bit ints or floating point supported with sdcc yet.
You need the latest nightly build from here:
http://nightly.z88dk.org/
You also need a modified version of sdcc. The patch will be applied to official sdcc once the regression tests have passed. Included in this zip is a windows executable and an svn patch that can be applied to sdcc source to compile locally.
https://drive.google.com/open?id=0B6...bWs&authuser=0
If you're having trouble with sdcc, everything is automatic and easy with z88dk. Of course there may be some bugs present :)

