User Tag List

Страница 45 из 70 ПерваяПервая ... 414243444546474849 ... ПоследняяПоследняя
Показано с 441 по 450 из 699

Тема: SjASMPlus от z00m

  1. #441

    Регистрация
    22.05.2011
    Адрес
    г. Дзержинск, Украина
    Сообщений
    6,829
    Спасибо Благодарностей отдано 
    483
    Спасибо Благодарностей получено 
    663
    Поблагодарили
    513 сообщений
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от Ped7g Посмотреть сообщение
    To fix your source in later one, don't use trivial argument names like `x`
    я то не использую
    а вот alone coder использует
    и x и _ и __
    и его исходники успешно не компилируются в z00m-овском sjasm
    без подгонки кода напильником

    some alone coder style code 21+

    Код:
    	macro ROTVERTEX2 x,z,y
    	if (x&#8000)==0
    	;display "x>=0 x=",x
    _x=(#1f-x)
    _xsgn=0
    	else
    	;display "x<0 x=",x
    _x=(#1f+x)
    _xsgn=1
    	endif
    _x=_x+#40
    	if (z&#8000)==0 ;display "z>=0 z=",z
    _z=(#1f-z)
    _zsgn=0
    	else ;display "z<0 z=",z
    _z=(#1f+z)
    _zsgn=1
    	endif
    _z=_z+#60

    Код:
    	 ld l,_x
    	 endif
    	if _xsgn
    	sub (hl)
    	else
    	add a,(hl)
    	endif
    	endif
    	;z'
    	call div8xinch
    	push bc
    __=$
    	endm

    Код:
    	 endif
    	 if ((sign&#8000)==0)
        if _==0
            LD A,(HL)
        else
            ADD A,(HL)
        endif
    _=1
    	 else ;((sign&#8000)!=0)
        if _==0
    	xor a
            sub (HL)
        else
            sub (HL)
        endif
    _=1
    	 endif
    	endif ;sign
    _hlneed=_hlneed+1
            ENDM
    [свернуть]



    а так мне иногда приходится жутко коверкать название меток
    чтоб только обойти этот долбанный баг с define
    а теперь еще таже гадость объявилась в макросах
    ...
    Последний раз редактировалось NEO SPECTRUMAN; 22.03.2021 в 15:52.

  2. #442

    Регистрация
    01.03.2005
    Адрес
    Саранск
    Сообщений
    5,830
    Спасибо Благодарностей отдано 
    0
    Спасибо Благодарностей получено 
    247
    Поблагодарили
    106 сообщений
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от Ped7g Посмотреть сообщение
    I'm not sure what you mean by those proposals.
    Basically I only want to see readable text inside same file. If we use some external convertor, then it would mean I have to:
    1. Do a sh script which will compile everything
    2. Do a generator, which will generate converted db "abwgde" strings.asm file and include that strings.asm file in main asm file

    This is what I was actually wanted to avoid somehow. I would be happy, if you can give us some way to run shellexec and insert its results.
    So like db #shellexec('iconv -f UTF8 -t CP866', 'КОНВЕРТИРУЙ ЭТО В 866') // obv this example will not work with real iconv, that's just to illustrate what I want to achieve
    So results of shellexecuted script will be in DB. But this looks really bad, so it would be nice to have something like
    Код:
    strConvert    equ 'iconv -t cp866'
    and later in db would be something like

    Код:
    text1     db 'РУССКИЙ ТЕКСТ' | strConvert
    So idea is to define a line for shellexec and by pipe send that text into shellexec for a defined line as a parameter. So above would mean, that you execute shellexec with 'iconv -t cp866 РУССКИЙ ТЕКСТ' (and as I told I understand that it would not work with iconv, but you can always write a wrapper for it or 3rd party convertor or maybe you can add some "convertor.exe" or anything, it does not matter much, if you can send and retrieve data the way I described, it would be really helpful, I think, not only for text conversions, but for many other things,
    Последний раз редактировалось Shadow Maker; 22.03.2021 в 16:24.
    Свирепый агрессивно-депрессивный мордовец!
    Не уверен - не напрягай!

    Не сдавайся. Дыши?

    Virtual TR-DOS

  3. #443

    Регистрация
    22.05.2011
    Адрес
    г. Дзержинск, Украина
    Сообщений
    6,829
    Спасибо Благодарностей отдано 
    483
    Спасибо Благодарностей получено 
    663
    Поблагодарили
    513 сообщений
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от Shadow Maker Посмотреть сообщение
    I only want to see readable text inside same file.
    lua power
    Код:
    	lua allpass
    
    	string = "Ыячъэюф"	
    
    	for temp = 1,string.len(string),1 do
    		sj.add_byte(string.byte(string,temp))
    	end
    
    	endlua
    Код:
    7    0000              	lua allpass
     8    0000 ~
     9    0000 ~            	string = "Ыячъэюф"
    10    0000 ~
    11    0000 ~            	for temp = 1,string.len(string),1 do
    12    0000 ~            		sj.add_byte(string.byte(string,temp))
    13    0000 ~            	end
    14    0000 ~
    15    0000 DB FF F7 FA  	endlua
    15    0004 FD FE F4
    можно наверно запихнуть всё в одну функцию типа very_angry_russian_function("ЗлойРусски Текст!!!")
    и конвертировать на ходу во что угодно...

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

    вот
    Код:
    	lua allpass
    	function angry_russian_text(string)
    	for temp = 1,string.len(string),1 do
    		sj.add_byte(string.byte(string,temp))
    	end
    		sj.add_byte(0)		--zero terminator
    	end
    
    	angry_russian_text("Злые русские пишут злые русские тексты")
    	angry_russian_text("несмотря ниначто!")
    	angry_russian_text("АХАХАХАХА АХАХАХАХА")	
    
    	endlua


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

    вот так делается масив
    Код:
    	angry_array = {}
    	angry_array[1] = 0x0F
    	angry_array[2] = 0x0E
    	angry_array[3] = 0x1F
    Последний раз редактировалось NEO SPECTRUMAN; 22.03.2021 в 17:00.

  4. #444

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

    По умолчанию

    Цитата Сообщение от Shadow Maker Посмотреть сообщение
    Basically I only want to see readable text inside same file. If we use some external convertor, then it would mean I have to:
    1. Do a sh script which will compile everything
    2. Do a generator, which will generate converted db "abwgde" strings.asm file and include that strings.asm file in main asm file
    ...
    I would rather suggest option 1 for medium-large projects, as you can benefit from using tools like Make quite a bit. But let's assume you don't want to.

    SHELLEXEC will execute first time in third pass, so any INCLUDE of results in first/second pass will have nothing to include. You can wrap INCLUDE in `IF 3 == __PASS__`, but that will probably cause different issues with labels changing values in final pass.

    So if you really want to convert it from inside the .asm source, lua script is the only option (as lua script can execute already in first pass). I haven't tried it myself, but I guess you can call `iconv` from lua, cache the result for following passes, and add the bytes from the result every pass, like Neo shows with `sj.add_byte(...)`.

    Also another option is to edit your sources in cp1251 or dos-866 encoding, depends on your editor, but I'm using Kate, and it does remember the encoding I was using for particular file, so once I switch it from utf-8 to something else, I can edit whole source in different encoding.

    So with utf-8 files - in the end you can have macro `db_cp1251` and call it like:
    Код:
        db_cp1251 "some text"
    which will call the lua script, and receive the converted bytes.

    Syntax like "db 'РУССКИЙ ТЕКСТ' | strConvert" is problematic, as pipe is already binary-or operator, etc... plus you would have to wait until somebody creates the fix, while you can add macro+lua script with current sjasmplus (maybe not "easily", I would need to google a bit for lua syntax to write it, but should be like hour-two of work, let me know if you can't figure it out)


    Цитата Сообщение от NEO SPECTRUMAN Посмотреть сообщение
    а так мне иногда приходится жутко коверкать название меток
    чтоб только обойти этот долбанный баг с define
    а теперь еще таже гадость объявилась в макросах
    well, I'm pretty sure the macro arguments were sensitive to the old bug too. If Alone coder writes source like this, and it works in older sjasmplus versions (1.07), it may be just one change in label/macro argument away from breaking. The 1.12.0+ will break consistently always.

    I guess you don't find it funny.... fair enough. But I'm not sure how to resolve it... maybe disabling mid-word substitution globally by some option? That sounds actually quite OK, it can help with importing project from different assemblers, and it would be optional change. - I can imagine adding this.

    I don't like the idea of doing the "correct" fix (for "v1.x"), switching mid-word substitutions to identifiers with underscore only, it makes lot of sense on syntax level, but would break other sources which depend on the current substitution. (if I ever create some "v2.x", I'm definitely going to change the substitution rules, current situation is not good ... but I have currently no plans/timeline to work on "v2.x", not any time soon)

    - - - Updated - - -

    Цитата Сообщение от NEO SPECTRUMAN Посмотреть сообщение
    вот
    Code:

    lua allpass
    function angry_russian_text(string)
    But this works only if your current source encoding is cp1251? Lua doesn't do utf8->cp1251 conversion, right?? (too lazy to try)
    But if you have source already in cp1251, you don't need to do anything, just use regular DB like `DB "Злые русские пишут злые русские тексты"` - it will work.
    Последний раз редактировалось Ped7g; 22.03.2021 в 17:18.

  5. #445

    Регистрация
    22.05.2011
    Адрес
    г. Дзержинск, Украина
    Сообщений
    6,829
    Спасибо Благодарностей отдано 
    483
    Спасибо Благодарностей получено 
    663
    Поблагодарили
    513 сообщений
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от Ped7g Посмотреть сообщение
    But if you have source already in cp1251
    Цитата Сообщение от Ped7g Посмотреть сообщение
    DB like `DB "Злые русские пишут злые русские тексты"` - it will work.
    у меня компилирует db и с utf8 (вроде бы)
    а нужный конвертер можно написать на lua
    Последний раз редактировалось NEO SPECTRUMAN; 22.03.2021 в 17:44.

  6. #446

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

    По умолчанию

    Цитата Сообщение от NEO SPECTRUMAN Посмотреть сообщение
    у меня компилирует db и с utf8 (вроде бы)
    yeah, of course sjasmplus will also assemble UTF8 source file, but then the resulting machine code is also UTF8 string, which is probably not what you want to process in Z80 assembly...

    Technically whatever binary values you have in source within quotes, the `DB` will emit 1:1 as is, nothing is damaged, except three values having special meaning: 0, 10 and 13. Those three must be escaped like "\0\n\r".

    So the issue is how to write your source in utf8, but assemble into some other encoding like cp1251. And Czechs may want cp1250, etc, etc... there's hundreds of difference encodings.

    The more we discuss it, the more I'm inclining toward these preferences (from the most simple and robust to worst):
    1) edit the source in target encoding, if your text editor allows it
    2) iconv the whole source as part of the build step (I'm usually building from text editor, where I can enter the whole sequence `iconv | sjasmplus ...` for single-file projects, or I tend to use makefiles for multi-file projects)
    3) some lua script calling iconv from inside the asm (or implementing custom encoding which is not available in iconv set)
    4) ??
    10) enter in source the numbers instead of text like `msgTxt: HEX cc ed e5 20 ee e4 ed ee ec f3 20 ea e0 e6 e5 f2 f1 ff`

    Anyway, at this moment of time I believe the encoding translations should be not part of sjasmplus, so I don't plan to add utf8->cp1251. If you prefer the lua script for that, but you don't know how to create such "db_1251" macro, let me know, I will create more complete example.
    (^^ Shadow Maker ^^, but also anyone else struggling with it)

    The 8bit->8bit transformations - some magic syntax to define and use the translation easily -> this one would be nice addition, but I'm failing to see that magic syntax which makes it considerably better than what sjasmplus already could do now (you can for example put the translation table into the DEVICE memory, and use `{b table+char}` to translate it in expressions, or just calculate the value for cases like ASCII -> 5 bit, similar to this https://github.com/ped7g/ZXSpectrumN...cked.i.asm#L26 (although this example also packs the 5bit values into bit-stream, so it's more complicated than just simple conversion).

    But in summary, I have no plans to add anything to sjasmplus right now, in my eyes the current support is reasonable, and the missing bits can be filled in by iconv or macro/lua scripts.

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

    NEO: so... how about the global option disabling mid-word substitution? Do you think that's a good idea? To enable macro/define identifiers like `x`, but not substitute them into `label_x` then.

  7. #447

    Регистрация
    22.05.2011
    Адрес
    г. Дзержинск, Украина
    Сообщений
    6,829
    Спасибо Благодарностей отдано 
    483
    Спасибо Благодарностей получено 
    663
    Поблагодарили
    513 сообщений
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от Ped7g Посмотреть сообщение
    NEO: so... how about the global option disabling mid-word substitution? Do you think that's a good idea? To enable macro/define identifiers like `x`, but not substitute them into `label_x` then.
    лично я сейчас нигде не использую замену внутри слов
    а так как я пишу все слова через "_" и ненавижу unreadablewritestyle
    эта внезапная замена вызывает только проблемы
    тем более в командах от которых этого совершенно не ожидаешь

    я бы сделал это отключение по умолчанию

    но при этом было бы не плохо иметь midword_define midword_macro по отдельности

    я уже много раз просил команды которые бы меняли все что угодно несмотря не на что
    (как автозамена в любом текстовом редакторе)
    по типу replaceall "44 l" "abc"
    с результатом
    label44 ldir
    |
    V
    labelabcdir



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

    Цитата Сообщение от NEO SPECTRUMAN Посмотреть сообщение
    эта внезапная замена вызывает только проблемы
    кстати
    можно же писать все аргументы макроса вот так

    macro maaacro X
    label_x = X
    endm

    я уже пишу все что для difine через UPPERCASE чтоб не конфликтовало с ****_***
    можно же такое делать и с макросами

    но опять же
    это лично я сижу в этой теме
    и уже знаю некоторые не очевидные тонкости поведения sjasm
    но другие же тут не сидят и не знают
    и спотыкаются об это
    Последний раз редактировалось NEO SPECTRUMAN; 23.03.2021 в 13:42.

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

    Ped7g(23.03.2021)

  8. #448

    Регистрация
    23.04.2006
    Адрес
    г. Уфа
    Сообщений
    105
    Спасибо Благодарностей отдано 
    12
    Спасибо Благодарностей получено 
    18
    Поблагодарили
    10 сообщений
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Не верно компилирует метки из инклуд-файла.
    Например, вместо #80D3 вставляет адрес #00D3.
    ULITKA B&W.rar
    Нажмите на изображение для увеличения. 

Название:	Screenshot - 18_06 002.jpg 
Просмотров:	1958 
Размер:	19.9 Кб 
ID:	75635
    https://cloud.mail.ru/public/RxiE/6xVeqhhnB
    Последний раз редактировалось SAVC; 18.06.2021 в 19:47.

  9. #449

    Регистрация
    10.01.2010
    Адрес
    Смоленская обл.
    Сообщений
    556
    Спасибо Благодарностей отдано 
    187
    Спасибо Благодарностей получено 
    197
    Поблагодарили
    100 сообщений
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от SAVC Посмотреть сообщение
    Не верно компилирует метки из инклуд-файла.
    Например, вместо #80D3 вставляет адрес #00D3.
    Всё верно компилирует, вы неверно ORG выставили.
    org ($+255)/256
    а надо
    ($+255)/256*256

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

    SAVC(18.06.2021)

  10. #450

    Регистрация
    23.04.2006
    Адрес
    г. Уфа
    Сообщений
    105
    Спасибо Благодарностей отдано 
    12
    Спасибо Благодарностей получено 
    18
    Поблагодарили
    10 сообщений
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Ага. Точна.
    Thanks.
    Теперь работает.
    Нажмите на изображение для увеличения. 

Название:	Screenshot - 18_06 003.jpg 
Просмотров:	1921 
Размер:	18.5 Кб 
ID:	75638
    https://cloud.mail.ru/public/JQfk/MN7JxqR8A
    Последний раз редактировалось SAVC; 18.06.2021 в 21:14.

Страница 45 из 70 ПерваяПервая ... 414243444546474849 ... ПоследняяПоследняя

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

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

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

Ваши права

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