User Tag List

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

Тема: SjASMPlus от z00m

Древовидный режим

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

    Регистрация
    10.05.2019
    Адрес
    Prague, Czech Republic
    Сообщений
    229
    Спасибо Благодарностей отдано 
    51
    Спасибо Благодарностей получено 
    103
    Поблагодарили
    77 сообщений
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от Sayman Посмотреть сообщение
    Вопрос: условия в макросах добавили или нет ещё?
    What do you mean precisely? The reasonably simple cases work for me, like:

    Код:
    ; conditions_in_macro.asm
    testCond    MACRO arg1?, arg2?, arg3?
                    IF arg1?
                        DB  arg2?
                        IF !arg1?
                            never happens
                        ENDIF
                    ELSE
                        DB  arg3?
                        IF $8004 <= $
                            DB  "..."
                        ELSE
                            jr  nc,.localLabelInCondition + '!'
                        ENDIF
    .localLabelInCondition
                    ENDIF
    
                ENDM
        
            DEVICE ZXSPECTRUM48 : ORG $8000
            OUTPUT "conditions_in_macro.bin"
            testCond 1, 'A', 'B'    ; A
            testCond 0, 'A', 'B'    ; B0!
            DB " "                  ; " "
            testCond 0, 'C', 'D'    ; D...
            OUTEND
    The binary contains expected "AB0! D..."

    Maybe if you would combine them also with DUP and emit macro inside macro which has conditionals, etc... I'm not claiming it's 100% bug free, but AFAIK it works.

    If you have some example of something what doesn't produce correct result, just post it here or open issue on github, thank you.

    -----------------------------------------------------------------

    EDIT: one thing "obviously" (if you know how sjasmplus works, hehe) does NOT work, you can't only start/end conditional block in macro, i.e. the whole block must belong to the same macro.. i.e. things like:

    Код:
    MyEndIf MACRO
            ENDIF
        ENDM
    
        IF 1
            nop
        MyEndIf
    will NOT work, and I don't have any plan to support them, not even in v2.x (I mean, they may happen by accident if I rewrite the parser in certain way and I was toying with that idea for a short while, but I don't find these important, actually opposite, seems like code smell).

    edit2: unfortunately, similar logic does apply DUP/EDUP blocks and others, basically any block (dup-edup, if-endif, macro-endm) should be nested in other block fully, interleaving start/end of different types of blocks will in 99% not work... and that's something I'm thinking about for v2.x, to allow things like conditional EDUP, but it's very complicated, so rather do not expect this ever working. I'm also not completely convinced this is real limitation, so far I had never issues to organize my code around these rules, but as always, by posting real-world issue with real project helps tremendously to shift my bias...
    Последний раз редактировалось Ped7g; 10.09.2019 в 21:05.

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

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

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

Похожие темы

  1. SjASMPlus Z80 кросс ассемблер
    от Aprisobal в разделе Программирование
    Ответов: 1663
    Последнее: 19.06.2021, 01:36
  2. Исходники TR-DOS для SjASMPlus
    от Keeper в разделе Программирование
    Ответов: 20
    Последнее: 11.02.2011, 11:57
  3. Запуск STS из .sna, сгенерированного sjasmplus.
    от siril в разделе Программирование
    Ответов: 7
    Последнее: 11.10.2010, 21:33
  4. Breakpoints в связке Sjasmplus+UnrealSpeccy
    от Kurles в разделе Программирование
    Ответов: 19
    Последнее: 26.01.2009, 12:36
  5. Disturbed COverMAnia ( music disk with z00m music collection)
    от kyv в разделе Музыка
    Ответов: 10
    Последнее: 27.03.2008, 10:01

Ваши права

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