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

User Tag List

Страница 36 из 70 ПерваяПервая ... 323334353637383940 ... ПоследняяПоследняя
Показано с 351 по 360 из 699

Тема: SjASMPlus от z00m

  1. #351

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

    По умолчанию

    Цитата Сообщение от NEO SPECTRUMAN Посмотреть сообщение
    Ped7g, а можно сделать чтоб DISPLAY выводил и в binary виде?
    da, mozno. Tolko 8-bit ja dumaju? Kakda budet nuzno 16-bit, jest mozno ... split the value to high/low and print both of them ... (my Russian is too limited to make full sentence ... heh, sorry)

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

    NEO SPECTRUMAN(24.08.2020)

  2. #352

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

    По умолчанию

    Ped7g, нужна реализация


    Код:
    cnt = 0
    
    	ld a,b	: cnt = cnt + 4
    	and $70 : cnt = cnt + 7
    или

    Код:
    	lua allpass
    	cnt = 0
    	endlua
    
    
    	ld a,b	: lua allpass : cnt = cnt + 4 : endlua
    	and $70 : lua allpass : cnt = cnt + 7 : endlua

    не то не то сейчас не работает

    как то можно сейчас проделать подобное?



    под ld a,b and $70
    подразумевается много строк кода с условной компиляцией
    для которых нужен счетчик

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

    Цитата Сообщение от Ped7g Посмотреть сообщение
    my Russian is too limited to make full sentence
    тем кому надо
    понимают и english

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

    Цитата Сообщение от Ped7g Посмотреть сообщение
    Tolko 8-bit ja dumaju?
    ну по идеи 8 должно хватить всем
    Последний раз редактировалось NEO SPECTRUMAN; 24.08.2020 в 00:06.

  3. #353

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

    По умолчанию

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

    Код:
    cnt = 0
    
    	ld a,b	: cnt = cnt + 4
    	and $70 : cnt = cnt + 7
    This should work, except `cnt` is symbol (label), so it must start at the beginning of line, like this:

    Код:
    cnt = 0
    
    	ld a,b
    cnt = cnt + 4
    	and $70
    cnt = cnt + 7

  4. #354

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

    По умолчанию

    Цитата Сообщение от Ped7g Посмотреть сообщение
    like this:
    это удвоит видимый размер кода в 2 раза
    который и без того плохо читается

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

    от такого код станет плохо читаемым \ редактируемым

    Код:
    	ld a,b
    cnt_name = cnt_name + 4
    	and $70
    cnt_name = cnt_name + 7
    	ld a,b
    cnt_name = cnt_name + 4
    	and $70
    cnt_name = cnt_name + 7
    	ld a,b
    cnt_name = cnt_name + 4
    	and $70
    cnt_name = cnt_name + 7
    	ld a,b
    cnt_name = cnt_name + 4
    	and $70
    cnt_name = cnt_name + 7
    	ld a,b
    cnt_name = cnt_name + 4
    	and $70
    cnt_name = cnt_name + 7
    	ld a,b
    cnt_name = cnt_name + 4
    	and $70
    cnt_name = cnt_name + 7


    хотя можно отодвинуть так
    Код:
    				ld a,b
    cnt_name = cnt_name + 4
    				and $70
    cnt_name = cnt_name + 7
    				ld a,b
    cnt_name = cnt_name + 4
    				and $70
    cnt_name = cnt_name + 7
    				ld a,b
    cnt_name = cnt_name + 4
    				and $70
    cnt_name = cnt_name + 7
    				ld a,b
    cnt_name = cnt_name + 4
    				and $70
    cnt_name = cnt_name + 7
    				ld a,b
    cnt_name = cnt_name + 4
    				and $70
    cnt_name = cnt_name + 7
    				ld a,b
    cnt_name = cnt_name + 4
    				and $70
    cnt_name = cnt_name + 7
    вроде немного лучше

  5. #355

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

    По умолчанию

    Цитата Сообщение от NEO SPECTRUMAN Посмотреть сообщение
    это удвоит видимый размер кода в 2 раза
    который и без того плохо читается
    well... the original sjasmplus design has some limits... but in some cases (in your original example) you can swap the order:
    Код:
    cnt = 0
    
    cnt = cnt + 4 : ld a,b
    cnt = cnt + 7 : and $70
    Because the `ld` and `and` does not use `cnt`, it doesn't matter if you have it ahead/after the instruction. (you can even remove the colon if you like it more without, the parser will parse only valid expression for the "=" (alias DEFL), and then it will try to parse instruction after, but I would personally use colon. (although colon will split it in listing file to two lines, if that is your problem)

    If the ld would be using `cnt`, then you can't swap them easily, but you can do `ld a,cnt-4` to load the "old" value before +4 ... it's ugly, but should work too.

    Wait a second, are you trying to count T-states of instructions? :-o
    That's ... interesting ... looks a bit dumb approach at first sight, but actually may be valid approach. But seems really tedious, omg. I wouldn't want to create this manually.
    But in such case you can leave the T-state counter at beginning of the line, if you indent the instructions enough, it may be even not-that-bad on reading the source.

    But makes me wonder if it would be better to somehow calculate it, but there's no simple way. Even if you would create some horrible macro to calculate T-states of particular block reading the device memory, it's valid only in pass3, so for first two passes the calculated T-states would be 0 all the time, ruining the conditional assembling of later blocks.

    Other option is to use the IDE/editor plugin to calculate the T-states for selected block (there's Z80 meter plugin for VSC doing this), and do the cnt = cnt + XYZ after full block adding just one total number.

    Either way, feels a bit messy, but I have no better workaround for you.

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

    About binary DISPLAY, how about:
    Код:
        DISPLAY "value ",/B,123
    
    --> outputs:
    
    > value %0111'1011
    I'm not sure about the group-separator in the middle... the C++ syntax is apostrophe (also supported by sjasmplus), but if you will later parse such data in Excel or something, the apostrophes will probably derail the tool a lot... then again you can always use `sed` to remove them from the log before processing it further, and the separator helps to find the 4bit group... So I guess I will do it like this, with the separator.

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

    NEO SPECTRUMAN(24.08.2020)

  6. #356

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

    По умолчанию

    Цитата Сообщение от Ped7g Посмотреть сообщение
    can swap the order:
    Ооо
    это выглядит приемлемо!
    почему то я не подумал о таком варианте

  7. #357

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

    По умолчанию

    oh.. WARNING .. the line:
    Код:
    cnt = cnt + 7       and     $70
    will understand the `and` as part of the expression! Not instruction! So it will do `cnt = (cnt + 7) & $70`.
    So the colon is mandatory with such design... makes me wonder, if the "parse instruction after DEFL" is good idea... I should probably remove that feature, that's very confusing, losing and/or/xor instructions in this way, funny I haven't hit it yet, because I use similar code to define self-modify-code labels, like:
    Код:
    posX=$+1 ld hl,1234
    ... so I was just lucky to not use it with and/or/xor, that would be surprise.. (I was initially thinking there is bug in listing, because there was no instruction opcode for the `and $70`, took me a good minute to realize what happened)

    (yeah, I guess when I remove it, there will be some user crying that I broke their old source... sigh .. but this is really dangerous syntax design :/ )

  8. #358

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

    По умолчанию

    Цитата Сообщение от Ped7g Посмотреть сообщение
    > value %0111'1011
    было бы лучше так
    %0111 1011

    но в приципе и такой вариант пойдет
    %0111'1011



    Цитата Сообщение от Ped7g Посмотреть сообщение
    (also supported by sjasmplus
    то есть уже давно можно вводить and %0000'0000 ?
    а то я все хочу попросить реализацию чего то подобного
    тк работать с 00000000000000000000 не удобно

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

    Цитата Сообщение от Ped7g Посмотреть сообщение
    cnt = 0 cnt = cnt + 4 : ld a,b cnt = cnt + 7 : and $70
    правда это плохо сочетается с моим

    Код:
    cnt = $+1 :	ld hl,$0000
    frq = $+1 :	ld de,$0123
    правда таких строк обычно не много

    странно я всегда этим пользуюсь
    но чего то
    cnt=cnt+1 : xxxx
    не пришел в голову

  9. #359

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

    По умолчанию

    Цитата Сообщение от NEO SPECTRUMAN Посмотреть сообщение
    то есть уже давно можно вводить and %0000'0000 ?
    а то я все хочу попросить реализацию чего то подобного
    тк работать с 00000000000000000000 не удобно
    since v1.12.1:
    (v1.12.1) Optional single quotes(') may be inserted between the digits as a separator (example: ld a,%11'01'11'00 ). They are ignored by the assembler.
    (I really don't like the character picked by C++ commitee ... I would prefer personally underscore like `ld hl,$12_34`, but then again using the same syntax as C++ makes it less difficult to switch between syntax, so I did use the apostrophe too - but it's not my favourite)
    Последний раз редактировалось Ped7g; 24.08.2020 в 00:56.

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

    NEO SPECTRUMAN(24.08.2020)

  10. #360

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

    По умолчанию

    читаю инструкцию
    нашел опечатку
    [void] _pc("code")

    Parse string of Z80 assembly. Example: _pc("ADD A,B")

    [void] _pl("label code")

    Parse line of Z80 assembly. Example: _pc("SOMELABEL ADD A,B")
    [integer] sj.calc("expression")

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

    все равно метки получаются плохо различимыми


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

    Ped7g(24.08.2020)

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

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

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

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

Ваши права

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