Свирепый агрессивно-депрессивный мордовец!
Не уверен - не напрягай!
Не сдавайся. Дыши?
Virtual TR-DOS
С любовью к вам, Yandex.Direct
Размещение рекламы на форуме способствует его дальнейшему развитию
Ped7g, а можно сделать отдельный
для названий макросов, меток итд ?i Case insensitive instructions/directives
то есть нужно чтоб компилировало
какКод:macro aaa nop endm bbb = 3 l1 AAa aAA AAA aaa jp l1 jp L1 ld a,bbb ld a,BBB
Код:macro aaa nop endm bbb = 3 l1 aaa aaa aaa aaa jp l1 jp l1 ld a,bbb ld a,bbb
или мне приходится городить
для каждой комбинации символов...Код:macro AAa macro aAA macro AAA macro aaa
так как я не могу предсказать какая комбинация попадется
нужно для моего набора макросов для компиляции chip8 кода
щас у меня это выглядит так...
и работать с таким исходником очень не удобноКод:macro scleft ;00FC SCLEFT defb $00, $FC endm macro SCLEFT defb $00, $FC endm macro scl defb $00, $FC endm macro SCL defb $00, $FC endm
так же у всех команд окончание выглядит как e*** end***
dup
edup
if
endif
а
macro
endm (что совершенно не логично)
хотелось бы чтобы асм переваривал все варианты окончания команды
dup edup enddup
if eif endif
macro emacro endmacro
итд
так же не помешало бы
кроме
$ current program counter
$$ current page at program counter (in virtual device mode)
еще иметь и
$$$ current code line number
чтоб использовать так
чтобы выдавалоКод:1 macro aaa b 2 if (b) > $FFF 3 display $$$," error" 4 endif 5 defb b 6 endm 7 8 aaa $FFE 9 aaa $1000
Код:>9 error
Последний раз редактировалось NEO SPECTRUMAN; 18.02.2020 в 16:12.
Ped7g(18.02.2020)
Unfortunately the "syntax=i" does exist because it was reasonably easy to add to current code.
The planned "I" for labels, and making the "i" or "I" affect also macros and defines is surprisingly high-friction in current sjasmplus.
I will take a look again, what is the exact problem, but it did look to me it's lot less problematic to fix the asm source to use correct case, than add case insensitivity to labels/macros. But maybe I just didn't find the simple solution.
"endX" vs "eX" - I agree with your idea, to bring better consistency into the "language", but code written for sjasmplus already does use current keywords, and just adding dozen new keywords for future will maybe break someone source (if they use the keyword as label or macro name), and will make even bigger mess.
I think I will keep this as compatibility-breaking change for v2.x, if it ever happens (cleaning up the directives keyword, maybe even removing some duplicities like rept vs dup, and similar), as the v2.x will be presented as not 100% compatible (there will be more syntax changes, not big, but enough to break old sources).
But I have still no idea when v2.x will happen, currently I have no time and no energy/incentive to work on it, the v1.x is quite OK currently. I don't like everything about it, but I can live with the current version.
The "$$$" is the only simple thing to add, which also looks like it would not break anything, but if I will add it, I think I would prefer the GCC-ification of it, i.e. __LINE__, __FILE__, etc... to copy the standard C/C++ macros when possible. I'm pretty sure I even have __LINE__ somewhere in my notes for v2.x.
... so, thanks for ideas, it's increasing priority of some things I have in plans, but I don't have any particular date when these things will happen.
-------------------
Meanwhile the next version will be v1.15.0, the planned changes so far:
- reworking the virtual device state for zx48/zx128+ to make the virtual memory closer to the fake "CLEAR x : LOAD "" CODE : RANDOMIZE USR y" state, which will change SAVESNA snapshot binaries (will hopefully break only minimum of projects, but fix the few issues I have seen recently, like the ROM keyboard routine reading BASIC keywords instead of characters, or the examples/Fros4k intro was broken in v1.13.0..v1.14.4 because the snapshot stack was $FFxx, in older versions it was $6000 ... after new changes it will be around $5D00 or something like that (impossibly low fake CLEAR).
- hopefully the larger memory spectrum-like devices, if I don't forget about it again
- maybe removing few more VS-specific calls and using the same source under every compiler
... I was hoping to release v1.15.0 around end of Feb initially, but currently I have no time to develop sjasmplus, so maybe toward end of March or April.
(and I will check again, if there's some simple trick for case insensitive macros, but I can't promise anything, last time the code did look very fragile and difficult to modify without affecting the assembling speed a lot)
BTW, about assembling speed... I was for fun trying out older versions, and seems the v1.14.5 is about two times slower than 1.10.4 ... Then again I personally prefer +0.2s per assembling instead of +100 bugs in assembler...![]()
И еще
можно сделать игнорирование ошибок?
error: Not enough arguments for macro:
error: Too many arguments for macro:
и продолжать использовать макрос несмотря не на что
в sjasm-е всегда не хватало макросов с переменным числом аргументов
сейчас сделав так
этим можно пользоваться и пытаться отличать макрос с аргументом от макроса без аргументаКод:macro mc xx cc = xx ld a,cc endm mc 3 mc
не смотря на ошибки
Код:184+ 0286 mc 3 184+ 0286 >cc = 3 184+ 0286 3E 03 > ld a,cc 184+ 0288 > 185+ 0288 ;ld a,3 test_code.asm(186): warning: [Macro argument parser] empty value: 186+ 0288 mc test_code.asm(175): error: Expression error: test_code.asm(186): ^ emitted from here 186+ 0288 >cc = 186+ 0288 3E 00 > ld a,cc 186+ 028A > 187+ 028A ;ld a,0
а вот повторить такое же с
macro mc xx,yy
уже не получается
(когда делаешь только mc xx)
сразу сыпяться
error: Not enough arguments for macro:
и макрос даже не копируется
Код:test_code.asm(184): error: Not enough arguments for macro: mc 184+ 0286 mc 3 185+ 0286 ;ld a,3 test_code.asm(186): warning: [Macro argument parser] empty value: test_code.asm(186): error: Not enough arguments for macro: mc 186+ 0286 mc 187+ 0286 ;ld a,0
так же была бы полезно иметь
проверку есть ли аргумент или нет
macro mc a,b,c,d
ifdef a
ifdef b
ifnotdef c
xor a
endif
endif
endif
ifdef a
ifdef b
ifdef c
ifnotdef d
xor b
endif
endif
endif
endif
mc a.b
;xor a
mc a,b,c
;xor b
Последний раз редактировалось NEO SPECTRUMAN; 19.02.2020 в 16:58.
yep, definitely variable-arguments for macros are on my TODO list, but it always felt to me this is "v2.x" feature, because it's both quite some work to implement it, and I'm worried about backward syntax compatibility (although I guess correct v1.15.0 syntax would not trigger macro var-args feature by accident, so it's just FUD on my side?). I guess it's mostly my feel that this needs serious amount of work, also adding new operators to manipulate with the var-arg list (some kind of "shift" operator), and needs good syntax design - I don't think I will add these as some kind of quick-hack to v1.x in hurry.
(of course if somebody will show me reasonable pull request with nice implementation and prove me wrong in terms of syntax-clash fear, it would be very nice addition to current sjasmplus)
Но переменное число аргументов
работает уже сейчас
если число аргументов 0...1
пример я дал выше
такой код сейчас вроде работает
не смотря на то что выводятся ошибки (и это меня устраивает)
правда он не отличаетКод:macro mc xx cc = xx if cc = 0 ld a,1 else xor cc endif endm
mc 0 от mc
дальше все упирается в то что
sjasm не использует макрос
когда у макроса 2 аргумента
а 1 из них не указан
можно было бы просто выдавать ошибку
но продолжать использовать макрос
и на обратную совместимость это бы не повлияло
наверно
Последний раз редактировалось NEO SPECTRUMAN; 20.02.2020 в 21:28.
А может все проще сделать??) Чем городить огород из макросов, может проще попросить автора впилить поддержку асм-а? там то команд 36 штук. Всего-ничего. для некст-а же он сделал.
Только мнемонику все же какую то определенно-распространенную сделать, а то мне как минимум три варианта попалось.
Profi v3.2 -=- Speccy2010,r2
по моему он где то говорил
что не особо горит желанием делать отдельный новый асм
а поддержал только те что очень похожи на асм z80
и где не нужно было много дополнительной работы
лично я за поддержку всех существующих и не конфликтующих между собой мнемоник
ну а я знаю 4 варианта
в придачу там
разные трактования некоторых команд
и требуются дополнительные опции у компилятора
Последний раз редактировалось NEO SPECTRUMAN; 20.02.2020 в 22:01.
угу
зоветсо octo
у него даже не асм а редкостное неизвестно что
пришлось ручками переписывать ВСЁ под свой асмv0 := va
v1 := vb
v2 := vc
v3 := vd
i := player-position
save v3
(по моему я ругался на этот счет в текстовичках самого nschip-аmov V0,VA
mov V1,VB
mov V2,VC
mov V3,VD
mvi player_position
str v0-V3)
ну и в его комплекте
жменя софтварей
которые работают только в самом octo
там вообще не удосужились прочитать мануалы
и сделали по своему...
...но та софтварь по качеству на уровень выше
чем все что было выпущено до этого
Последний раз редактировалось NEO SPECTRUMAN; 20.02.2020 в 22:52.
Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)