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 :D ... heh, sorry)
Вид для печати
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
подразумевается много строк кода с условной компиляцией
для которых нужен счетчик
- - - Добавлено - - -
тем кому надо
понимают и english
- - - Добавлено - - -
ну по идеи 8 должно хватить всем :)
это удвоит видимый размер кода в 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
well... the original sjasmplus design has some limits... but in some cases (in your original example) you can swap the order:
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)Код:cnt = 0
cnt = cnt + 4 : ld a,b
cnt = cnt + 7 : and $70
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. :D 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:
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.Код:
DISPLAY "value ",/B,123
--> outputs:
> value %0111'1011
oh.. WARNING .. the line:
will understand the `and` as part of the expression! Not instruction! So it will do `cnt = (cnt + 7) & $70`.Код:cnt = cnt + 7 and $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:
... 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)Код:posX=$+1 ld hl,1234
(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 :/ )
было бы лучше так
%0111 1011
но в приципе и такой вариант пойдет
%0111'1011
то есть уже давно можно вводить and %0000'0000 ?
а то я все хочу попросить реализацию чего то подобного
тк работать с 00000000000000000000 не удобно
- - - Добавлено - - -
правда это плохо сочетается с моим
правда таких строк обычно не многоКод:cnt = $+1 : ld hl,$0000
frq = $+1 : ld de,$0123
странно я всегда этим пользуюсь
но чего то
cnt=cnt+1 : xxxx
не пришел в голову
since v1.12.1:
(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)Цитата:
(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.
читаю инструкцию
нашел опечатку
- - - Добавлено - - -Цитата:
[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
все равно метки получаются плохо различимыми
https://jpegshare.net/images/e7/b4/e...19069d4aa4.png
https://jpegshare.net/images/b4/27/b...4fee85e69d.png