User Tag List

Показано с 1 по 10 из 377

Тема: Ищу Си для Z80

Комбинированный просмотр

Предыдущее сообщение Предыдущее сообщение   Следующее сообщение Следующее сообщение
  1. #1

    Регистрация
    21.05.2006
    Адрес
    Canada
    Сообщений
    78
    Спасибо Благодарностей отдано 
    3
    Спасибо Благодарностей получено 
    2
    Поблагодарили
    2 сообщений
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от Sergey Посмотреть сообщение
    Hello, Alcoholics Anonymous!
    I would be very grateful for your work. This is my sources adapted to z88dk.
    Я думаю, что некоторые из наших инструментов есть проблемы с кириллицей, которые мне придется взять добычу в.

    Но вот компиляции, что я надеюсь, что произведения. На эмуляторе я вижу выход, но, конечно, нет CMOS часы для измерения времени.

    Скрытый текст


    I think some of our tools have problems with the cyrillic alphabet which I will have to take a loot at.

    But here's a compile that I hope works. On an emulator I can see the output but of course there's no cmos clock for time measurement.
    [свернуть]


    https://drive.google.com/file/d/0B6X...ew?usp=sharing

    Если вы используете бинарный вместо крана, вы должны CLEAR 32768, а затем загрузить двоичный обратиться 32768 и, наконец, RAND USR 32768.

    Позвольте мне знать, если он не работает.

    Одна вещь, я не сделать, изменить программу, чтобы передавать параметры реестра или использовать вызываемого абонента связь, которая большинство других компиляторов не может сделать, чтобы получить более прямое сравнение.

    Скрытый текст


    If you use the binary instead of the tap, you must CLEAR 32768, then load the binary to address 32768 and finally RAND USR 32768.

    Let me know if it doesn't work.

    One thing I didn't do was change the program to pass parameters by register or use callee linkage which most of the other compilers cannot do to get a more direct comparison.
    [свернуть]
    Последний раз редактировалось Alcoholics Anonymous; 13.12.2015 в 01:52.

  2. #1
    С любовью к вам, Yandex.Direct
    Размещение рекламы на форуме способствует его дальнейшему развитию

  3. #2

    Регистрация
    23.12.2006
    Адрес
    Славный город Самара
    Сообщений
    484
    Спасибо Благодарностей отдано 
    135
    Спасибо Благодарностей получено 
    16
    Поблагодарили
    12 сообщений
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от Alcoholics Anonymous Посмотреть сообщение
    Let me know if it doesn't work.
    It works fine. 512 sec. Great!

    Can You give "magic" command line options for ZCC?
    С уважением,
    Gris / Red Triangle.
    _____________________________________
    ZX-EVO/TS-Labs config/NGS/HDD/SD-card
    Amiga A1200/Blizzard 1230@50/32/60GB
    Amiga A1200/Apollo 1260@66/32/60GB
    UnAmiga (C5) AGA GM7123 VideoDAC

  4. #3

    Регистрация
    21.05.2006
    Адрес
    Canada
    Сообщений
    78
    Спасибо Благодарностей отдано 
    3
    Спасибо Благодарностей получено 
    2
    Поблагодарили
    2 сообщений
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от Sergey Посмотреть сообщение
    Can You give "magic" command line options for ZCC?
    You must have sdcc installed.

    sdcc must be modified a little bit to be compatible with z88dk. If you are running on windows, copy zsdcc.exe from this zip file to sdcc's bin directory sdcc/bin. If you're not running on windows, check out http://www.z88dk.org/wiki/doku.php?id=temp:front#sdcc1 .

    You must have a recent version of z88dk installed. I'd suggest waiting until the Dec 15 build is finished in about 3 hours from now. I put in a fix so the tools will not crash if the source contains Cyrillic letters. The nigthly build is here: http://nightly.z88dk.org/ Click on the latest win32 build and unzip where you like. You must set a few environment variables as described here: http://www.z88dk.org/wiki/doku.php?i...:front#windows sdcc should also be in the path.


    z88dk compiles are very configurable so one compile line (and a set of pragmas in your source code) does not always fit. The library can also be rebuilt to make the compiled code faster or smaller by selecting different options. For example, you can opt out of individual printf/scanf converters to reduce size or you can enable the fast integer library if you are ok with an additional ~1k code. The latter makes z88dk's integer math several times faster than all other compilers. If you read through the links mentioned in this section: http://www.z88dk.org/wiki/doku.php?i...ling_with_sdcc you will have an idea of how things work.


    A general magic compile line for the zx looks like one of these:

    32 column stdin/stdout/stderr z88dk terminal drivers
    zcc +zx -vn -SO3 -clib=sdcc_ix --reserve-regs-iy --max-allocs-per-node200000 test.c -o test
    zcc +zx -vn -SO3 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test

    64 column stdin/stdout/stderr z88dk terminal drivers
    zcc +zx -vn -SO3 -startup=4 -clib=sdcc_ix --reserve-regs-iy --max-allocs-per-node200000 test.c -o test
    zcc +zx -vn -SO3 -startup=4 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test

    fzx proportional fonts stdin/stdout/stderr z88dk terminal drivers
    zcc +zx -vn -SO3 -startup=8 -clib=sdcc_ix --reserve-regs-iy --max-allocs-per-node200000 test.c -o test
    zcc +zx -vn -SO3 -startup=8 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test

    Nothing on stdin/stdout/stderr
    zcc +zx -vn -SO3 -startup=31 -clib=sdcc_ix --reserve-regs-iy --max-allocs-per-node200000 test.c -o test
    zcc +zx -vn -SO3 -startup=31 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test


    The "-clib=sdcc_iy" compile gives IX to sdcc and IY to the c library. This will be the smallest and fastest code. However, you must disable interrupts or have your own isr installed because the rom interrupt uses iy and if it runs, it will be poking random stuff into memory and eventually cause a crash.

    The "-clib=sdcc_ix" option has sdcc and the c library sharing IX. The rom isr can continue to run.


    You must add "-lm" if using floats. If you need to printf floats (%aefg) you must re-build the library because the default build has %aefg disabled. You can also use stdlib functions dtoa / ftoa, etc to render floats into text.


    The default zx crt is doing something we call an "automatic malloc". It creates a heap between the end of the program and the bottom of the stack automatically when the program runs. If it finds the available space is 0 or less, the program will just exit without any indication. This can happen if you CLEAR before loading the program because CLEAR moves the stack underneath the executable. So by default the crt also moves the stack pointer underneath the UDGs. For someone new to C and just wanting to compile stuff, this is most often what is wanted. But for more complicated programs this is often not what you want. You can put pragams into the source to change the crt behaviour. These two may be helpful:

    #pragma output REGISTER_SP = -1 // do not change the stack pointer
    #pragma output CLIB_MALLOC_HEAP_SIZE = 0 // do not create a heap

    z88dk's library and crts are very configurable so if you use it, take some time to learn these things in order to make best use of the compiler.


    If you get things working, try compiling your program in the zip I posted a little further back. The compile line I used is listed at the top of the .c file. You can make the result a little bit faster by changing the function linkage of put__ch() and print() like this:

    unsigned char* put__ch(char sym) __z88dk_fastcall
    void print(char* str) __z88dk_fastcall

    Adding "__z88dk_fastcall" will make sdcc pass a single parameter by register instead of by stack. This shaves another 10 seconds or so from running time.


    There are a few example programs in z88dk/libsrc/_DEVELOPMENT/EXAMPLES

    - - - Добавлено - - -

    Цитата Сообщение от krt17 Посмотреть сообщение
    Когда пытался использовать sdcc и z88dk столкнулся с непониманием как разделить код по необходимости компиляции в медленную/быструю память. Как сделать ?
    В z88dk пространство памяти делится на разделы. Раздел представляет собой контейнер, чем может удерживать код или данные и может иметь дополнительный Org. По умолчанию компилирует настроить карту памяти, которая будет производить один двоичный в разделе "CODE" (так выходные двоичные файлы из z88dk всегда будет под названием "name_CODE.bin"); это на самом деле содержит двоичный код традиционной / части DATA / BSS исполняемого все слиплись.

    Это очень легко иметь код компилятора компиляции на 32768 и есть один раздел определяемые пользователем отображается на 23296, например, что вы положили данных или подпрограммы по сборке в. Просто создайте другой файл, как это:

    Скрытый текст


    In z88dk the memory space is divided into sections. A section is a container than can hold code or data and can have an optional ORG. The default compiles set up a memory map that will produce a single binary in the "CODE" section (so output binaries from z88dk will always be called "name_CODE.bin"); this binary actually contains the traditional CODE/DATA/BSS parts of an executable all stuck together.

    It's very easy to have the compiler compile code at 32768 and have another user-defined section mapped to 23296, eg, that you put data or assembly routines into. Just create another file like this:
    [свернуть]


    Код:
    SECTION LOWMEM
    org 23296
    
    PUBLIC _map
    
    _map: defs 100
    
    ...
    И добавить его к линии компиляции. Тогда выход будет два бинарных файла: "name_CODE.bin", содержащий C код компилятора на 32768 и "name_LOWMEM.bin", содержащий другие вещи, которые должны быть загружены по адресу 23296.


    Это, как большинство людей используют нижние области памяти, потому что это легко. Если вы действительно хотите, чтобы скомпилировать код там, вы должны сказать SDCC использовать другое имя раздел, и это делается по линии компиляции. Я никогда не делал этого, так что я не могу дать конкретные указания. В любом случае, если вы сообщите его скомпилировать в разделе "Lowmem", код будет поставить там. Но SDCC можно скомпилировать только одной секции с каждого исходного файла. Так что вам нужно сделать, это разделить ваш источник C, так что каждый С файла относится к собственной секции. Тогда ты скомпилировал бы каждый файл C объектный файл, а затем, наконец, положить все это вместе на последнем этапе компиляции. Затем выводе будет одним двоичным в разделе определенной которые вам придется загрузить в память.

    Вот как это будет работать с z88dk но я никогда не делал этого раньше.

    Скрытый текст


    And add it to the compile line. Then the output will be two binaries: "name_CODE.bin" containing the C compiler code at 32768 and "name_LOWMEM.bin" containing the other stuff that should be loaded at address 23296.


    This is how most people are using the lower areas of memory because it's easy. If you actually want to compile some code there, you have to tell sdcc to use a different section name and this is done on the compile line. I have never done this so I can't give specific instructions. Anyway if you tell it to compile into the "LOWMEM" section, code will be put there. But sdcc can only compile to one section with each source file. So what you need to do is divide up your C source so that each C file belongs to its own section. Then you would compile each C file to an object file and then finally put it all together in the last compile step. Then the ouput will be one binary per section defined which you will have to load into memory.

    That's how it would work with z88dk but I have never done this before.
    [свернуть]
    Последний раз редактировалось Alcoholics Anonymous; 15.12.2015 в 03:31.

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •