Важная информация

User Tag List

Страница 57 из 63 ПерваяПервая ... 535455565758596061 ... ПоследняяПоследняя
Показано с 561 по 570 из 627

Тема: SjASMPlus от z00m

  1. #561
    Master
    Регистрация
    31.01.2007
    Адрес
    Москва
    Сообщений
    715
    Спасибо Благодарностей отдано 
    7
    Спасибо Благодарностей получено 
    43
    Поблагодарили
    32 сообщений
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Не могу понять что не так с if not exist. Без модулей все в порядке, в модуле не совсем. Проверял с 18.2 и 19
    Вложения Вложения

  2. #562
    Master
    Регистрация
    31.01.2007
    Адрес
    Москва
    Сообщений
    715
    Спасибо Благодарностей отдано 
    7
    Спасибо Благодарностей получено 
    43
    Поблагодарили
    32 сообщений
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Наверное ped7g сюда больше не заходит, сделал иссуе на гитхабе, очень уж охота переопределяемость в асме без дефайнов.

  3. #563
    Activist
    Регистрация
    10.05.2019
    Адрес
    Prague, Czech Republic
    Сообщений
    223
    Спасибо Благодарностей отдано 
    48
    Спасибо Благодарностей получено 
    99
    Поблагодарили
    74 сообщений
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    sorry, busy with a newborn baby, so I didn't notice there's new post. Github surely works better. ( https://github.com/z00m128/sjasmplus/issues/177 )

    But this issue is a bit puzzling to me, not sure what to do about it, technically it works "as designed", but in your example it is very counter-intuitive and feels wrong...

    Also I'm a bit confused what you mean "Без модулей все в порядке"
    If I do in empty asm file this:

    Код:
    	IF !exist non_mod_l1
    non_mod_l1 ds 1
    	ENDIF
    it will do the conditional block only in first pass, creating the label "non_mod_l1", but not doing `ds 1` in pass 2 and 3, so this is broken logic even without modules.
    (but the `exist` was not meant to be used like this, for conditional "linking" there is `IFUSED` which works a bit differently, and for replacing default definitions with external code I would suggest DEFINE + IFDEF)

  4. Этот пользователь поблагодарил Ped7g за это полезное сообщение:

    LW (06.05.2022)

  5. #564
    Master
    Регистрация
    31.01.2007
    Адрес
    Москва
    Сообщений
    715
    Спасибо Благодарностей отдано 
    7
    Спасибо Благодарностей получено 
    43
    Поблагодарили
    32 сообщений
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Поздравляю с приятными хлопотами, рад за вас.
    У меня была идея использовать в виде именно переопределяемых процедур и данных, возможно я немного не так подошел к функционалу. Допустим есть тематический модуль, но мы хотим изменить процедуру или данные в нем не переписывая его. Раньше я делал такое через define но exist показался прямо предназначенным для этого.
    Возможно тут применима логика когда фактически exist проверяется только на первом проходе, слежение за ссылками вперед оставим на писателя, тут мне кажется это не применимо. Но в целом я понял, буду использовать define, если есть обходной путь овчинка не стоит выделки.
    То что у меня сработало без модуля перепроверю, вполне возможно я ошибся.

  6. Этот пользователь поблагодарил krt17 за это полезное сообщение:

    Ped7g (07.05.2022)

  7. #565
    Activist
    Регистрация
    10.05.2019
    Адрес
    Prague, Czech Republic
    Сообщений
    223
    Спасибо Благодарностей отдано 
    48
    Спасибо Благодарностей получено 
    99
    Поблагодарили
    74 сообщений
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    I have been thinking about the issue for few more hours, and I think it will stay as is.

    While your example is quite logical on first read, and I would sweat a bit to explain to new assembler users why this is a problem, it *is* a problem.

    Generally assemblers collect symbol values over several passes, before they start emitting machine code, at that point the symbol values should be stable. So it's impossible to reset values before each pass, and EXIST targets symbols. (contrary to that DEFINEs are reset before each pass, and are re-created each pass, so IFDEF + DEFINE works the way how you expect).

    Thinking about it, the assembler working like mdlz80optimizer doing lazy evaluation of labels and "single pass" (I think, not sure about how exactly it works, but it's not N-pass) would probably work for your example, but that's completely different architecture, not going there with sjasmplus.

    (and for general library, the IFUSED can be used, although I personally prefer to have full source of project together, so even when I use some "library", I first copy the library source to the project, so I can then easily modify it only for the particular project and I don't need to worry about other projects using the same base library)

  8. #566
    Activist
    Регистрация
    27.02.2005
    Адрес
    Белоруссия
    Сообщений
    382
    Спасибо Благодарностей отдано 
    17
    Спасибо Благодарностей получено 
    16
    Поблагодарили
    11 сообщений
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Ограничение на длину строки в 128 байт для BYTE/DB/DC является очень важным, или лимит можно увеличить?
    Your life is REAL. Change it UNREAL!

  9. #567
    Activist
    Регистрация
    10.05.2019
    Адрес
    Prague, Czech Republic
    Сообщений
    223
    Спасибо Благодарностей отдано 
    48
    Спасибо Благодарностей получено 
    99
    Поблагодарили
    74 сообщений
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от transman Посмотреть сообщение
    Ограничение на длину строки в 128 байт для BYTE/DB/DC является очень важным, или лимит можно увеличить?
    All internal buffers are fixed size. read-line is 2048, define-substitution two buffers 2048, emit-bytes-values inside BYTE/DB/DC/DZ directive is 128+2, etc...

    You can raise limits of all those buffers (and hope that you did find all relevant ones) and build version which will accept more, but there will be always some hard limit unless you rewrite the code to use dynamic memory allocation per line.

    But even to reach 128 items in DB it must be super long source-code line which is difficult to read+edit in text editor, so I don't see 128 limit as an issue (in my own source I'm often limiting number values to 16 or 32 per line and quoted text to 64 chars).

    For binary data like gfx consider `INCBIN` instead of converting it to source code, or patch the convertor to split it into multiple lines.

  10. #568
    Activist
    Регистрация
    10.05.2019
    Адрес
    Prague, Czech Republic
    Сообщений
    223
    Спасибо Благодарностей отдано 
    48
    Спасибо Благодарностей получено 
    99
    Поблагодарили
    74 сообщений
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    https://github.com/z00m128/sjasmplus...es/tag/v1.20.0
    • Lua: upgrade to 5.4, replacing tolua++ bindings with LuaBridge2.6 library, extending some bindings
    • Lua: bindings slightly modified (required by upgrade), refreshed docs, added test coverage
    • Lua: the 3rd party extensions (BTW not working for many years) are obsolete in 5.4 and removed
    • Lua: more accurate errors/warning location reported even in complex cases
    • warnings: added -Wall, --help=warnings shows on/off status, rdlow off by default
    • Added HIGH mode to relocation data generator (MSB-only relocation mode)
    • many open-file "fatal" errors become "non-fatal", assembling will continue
    • deprecated features removed: --syntax=m, label abs in expressions
    • --color=auto will stay no-color when env.var. NO_COLOR is defined
    • refactorings, improving some error messages and parsing, small fixes in parsing logic
    • fix listing of Lua's sj.parse_code (eol-comments), minor memory leaks fixed
    • fix relocation of temporary labels in expressions
    • invalid CLI options are reported as regular errors (also changing exit code)
    • errors are colored similarly to gcc (only keyword has color), console input name is <stdin>


    Please be aware the upgrade of Lua may break some older scripts:
    - the sjasmplus bindings had been restricted to only documented API, removing some of the secret optional arguments (hopefully not used by many people, in case you did use them, use instead the _pl/_pc function producing required asm line as string and letting sjasmplus to parse it as regular piece of code).
    - Lua 5.4 has several incompatible syntax changes compared to 5.1, some stuff is quite subtle (for example _pc("ld a," .. 4/2) will produce string "ld a,2.0" which will cause "Unexpected: .0" error in parser)
    - check the docs and tests to see how I adjusted old source to assemble again in similar cases

  11. Эти 2 пользователя(ей) поблагодарили Ped7g за это полезное сообщение:

    Dart Alver (15.06.2022), Dr.OM (15.06.2022)

  12. #569
    Guru Аватар для Sayman
    Регистрация
    16.02.2006
    Адрес
    Новосибирск
    Сообщений
    3,277
    Спасибо Благодарностей отдано 
    17
    Спасибо Благодарностей получено 
    91
    Поблагодарили
    54 сообщений
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    вопрос: можно ли как то переназначать переменную компилятора __DATE__. её формат YYYY-MM-DD не удобен.
    0A заповедей:
    I. Не удаляй каталог свой.
    II. Не удаляй до времени ни одного файла.
    III. Не кради файлы.
    IV. Не желай программы ближнего своего.
    V. Почитай BDOS и BIOS как родителей своих ...
    ---
    Sprinter resurrect:
    Telegram
    Discord
    Repo
    Forum

  13. #570
    Activist
    Регистрация
    10.05.2019
    Адрес
    Prague, Czech Republic
    Сообщений
    223
    Спасибо Благодарностей отдано 
    48
    Спасибо Благодарностей получено 
    99
    Поблагодарили
    74 сообщений
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    https://devrant.com/rants/1791863/a-...r-a-programmer

    I can't imagine which else format would you want, the YYYY-MM-DD is perfect.

    If you need different format, there are no string operators in sjasmplus, so Lua for the rescue:
    Код:
    	LUA ALLPASS
    		date = sj.get_define("__DATE__")
    		year = date:sub(2,5)
    		month = date:sub(7,8)
    		day = date:sub(10,11)
    		wrong_format = "\""..day.."."..month.."."..year.."\""
    		sj.insert_define("WRONG_FORMATTED_DATE", wrong_format)
    	ENDLUA
    
    	DISPLAY WRONG_FORMATTED_DATE
    but that's just wrong.

Страница 57 из 63 ПерваяПервая ... 535455565758596061 ... ПоследняяПоследняя

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

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

Эту тему просматривают: 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

Ваши права

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