а сейчас можно как то сделать?
что то на подобии
чтобы не писать одинаковоеКод:if aaa = 1,2,3 nop endif
Код:if aaa = 1 nop endif if aaa = 2 nop endif if aaa = 3 nop endif
а сейчас можно как то сделать?
что то на подобии
чтобы не писать одинаковоеКод:if aaa = 1,2,3 nop endif
Код:if aaa = 1 nop endif if aaa = 2 nop endif if aaa = 3 nop endif
С любовью к вам, Yandex.Direct
Размещение рекламы на форуме способствует его дальнейшему развитию
http://z00m128.github.io/sjasmplus/d...#s_expressions
`if 1 <= aaa && aaa <= 3`
or
`if 1 == aaa || 2 == aaa || 3 == aaa`
NEO SPECTRUMAN(05.07.2020)
hmm... it's right there in the operators list:
"bitwise" vs "logical" ... maybe it's confusing if you are not sure what that means.Код:& x&y bitwise and and x and y bitwise and ^ x^y bitwise xor xor x xor y bitwise xor | x|y bitwise or or x or y bitwise or && x&&y logical and || x||y logical or
Where would you put such example (= "where would you look for it")?
Would it help in the Conditional assembly section under the IF/IFN as example? (I see there are examples of IFDEF and IFUSED, but no example for IF).
Any idea for example, what should I show there? (I guess the logical and/or is obvious candidate, but if you think there's something else tricky... I think the logical NOT is another interesting one as `!0` results in value 0xFF if I remember the implementation correctly, so I may double-check in the source and add some non-trivial example showing this.
Thank you for this kind of feedback, as I'm sort of "blind" toward the documentation, knowing the implementation quite well, so any help to point out which area can be improved and how is important.
это конечно хорошо
но хотелось бы использовать вот так
или такКод:if super_mega_very_long_and_big_stupid_variable_maybe_not = 0 || 1 || 5 || 7 nop endif
а приходится делать такКод:if super_mega_very_long_and_big_stupid_variable_maybe_not = (0 || 1 || 5 || 7) nop endif
что абсолютно не читаемо
Код:if super_mega_very_long_and_big_stupid_variable_maybe_not = 0 || super_mega_very_long_and_big_stupid_variable_maybe_not = 1 || super_mega_very_long_and_big_stupid_variable_maybe_not = 5 || super_mega_very_long_and_big_stupid_variable_maybe_not = 7 nop endif
еще могу предположить что кому нибудь может понадобиться такая конструкция
- - - Добавлено - - -Код:if var_a || var_b || aaa || bbb = 1
так же только что нашел такую ошибку
коментарий написанный впритык уничтожает endif
сходу и не ясно где ошибка и почему
выдает такое
error: Label not found: label2
error: [IF] No ENDIF
Код:aaa = 3 jp label if aaa = 3 nop endif label jp label2 if aaa = 0 nop endif; label2
Последний раз редактировалось NEO SPECTRUMAN; 10.07.2020 в 17:14.
Мне бы тоже каких-нибудь инструкций для конструкций
Посмотрел все примеры для работы с TRD. Не очень то и понял.
В примере для автостарта такая конструкция:
SAVETRD "autostart_warning.trd","ok.B",$C001,$100,$123 4
$1234 - это номер строки Бейсика? или специальная такая уникальная метка??
Ладно, предположим это номер строки.
пишу простую конструкцию -
SAVETRD "my_test.trd","boot.B",$C000,$100
ожидаемо вижу файл размером в 256 байт. Логично??
пишу СЛОЖНУЮ конструкцию -
SAVETRD "my_test.trd","boot.B",$C000,$100,$1
По логике все то же самое, но автозапуск с первой строки??
Угадайте размер файла boot.B в контейнере. Мне лично хотелось бы прежний![]()
Profi v3.2 -=- Speccy2010,r2
well.. I don't know anything about TRD except what I learned from the sjasmplus source (I have never seen TRD in real life or used such file), so I can easily answer you what the sjasmplus is doing, but whether it is correct thing to do, that's question for actual TRD experts.
The autostart argument is line number in BASIC, like `SAVE "boot" LINE 10` -> `SAVETRD "my.trd","boot.B",23755,256,10` (if your BASIC is 256 bytes long).
BTW, I find creating BASIC in sjasmplus very cumbersome and tedious, I would rather suggest to use working ZX or emulator to create disc with your BASIC loader, then turn this disc into TRD image file like "loader.trd", and have build script of project copying such empty disc with "boot.B" from "loader.trd" to "my.trd" before each assembling, so the SAVETRD of sjasmplus will add files after that. But if you don't mind produce the BASIC code in the sjasmplus, or you have hex-dump of it, then it makes sense to build it from ASM source from scratch too.
About size of file inside the TRD. The TRD operates with 256 bytes long sectors, so 256 bytes long "boot.B" will fit precisely into single sector without auto-start line! The auto-start line adds another four bytes of content after the BASIC program in the form of: { $80, $AA, low autostart, high autostart }, so the length of file goes from 256 to 260 and it will occupy two sectors on the disc.
Ну я как бы тоже не специалист по TRD, так, мимо проходил, но вот все равно бы сказал, что автозапуск Бейсик файлов как то странно сделан
Может на примере легче объяснить.
В аттаче два файла,
my_Dizzy_test_128.trd, который я собирал руками и бейсик загрузчик 256 байт, и работает правильно, автозапускается, и второй файл, My_test2.zip , который собран средствами исключительно SJAsm-a,
но тот же самый загрузчик уже два сектора занимает. Но как бы тоже все работает правильно.
Мне конечно ни разу не принципиально +1 сектор, но "как-то неаккуратненько, доктор" (с)
Второй файл собран вот так:
Скрытый текст
Код:End: savebin "my_test.bin",Start, End - Start emptytrd "my_test.trd" ORG $C000, 7 ; "page 7" incbin "TRD/boot.B" SAVETRD "my_test.trd","boot.B",$C000,$100,$1 ORG $C000, 7 ; "page 7" incbin "my_test.bin" SAVETRD "my_test.trd","my_test.C",$C000,End - Start ORG $C000, 7 ; "page 7" incbin "TRD/pent.scr" SAVETRD "my_test.trd","pent.C",$C000,$1B00 ORG $C000, 7 ; "page 7" incbin "TRD/dizzy00.pak" SAVETRD "my_test.trd","dizzy00.C",$C000,$4000 ORG $C000, 7 ; "page 7" incbin "TRD/dizzy01.pak" SAVETRD "my_test.trd","dizzy01.C",$C000,$4000 ORG $C000, 7 ; "page 7" incbin "TRD/dizzy02.pak" SAVETRD "my_test.trd","dizzy02.C",$C000,$4000 ORG $C000, 7 ; "page 7" incbin "TRD/dizzy03.pak" SAVETRD "my_test.trd","dizzy03.C",$C000,$4000 ORG $C000, 7 ; "page 7" incbin "TRD/dizzy04.pak" SAVETRD "my_test.trd","dizzy04.C",$C000,$4000 ORG $C000, 7 ; "page 7" incbin "TRD/dizzy05.pak" SAVETRD "my_test.trd","dizzy05.C",$C000,$4000 ORG $C000, 7 ; "page 7" incbin "TRD/press.scr" SAVETRD "my_test.trd","press.C",$C000,$1B00 end
[свернуть]
То есть я сперва компилирую свой код, сохраняю его, формирую пустой диск ,и начинаю
его заполнять строго по очереди, согласно купленным билетам.
И да, как видите в моей сборке расширения имен файлов трехбуквенные, Ваш компилятор только одну букву разрешает
Ну и если бы можно файлы сначала не incbin-ить, а потом записывать, а сразу добавлять в образ TRD, было бы вообще замечТательно)
Последний раз редактировалось zebest; 06.07.2020 в 23:18.
Profi v3.2 -=- Speccy2010,r2
В мастер ветке гита уже 3 буквы можно. И можно пробовать в моноблок куски памяти собирать с префиксом '&' :
SAVETRD "имя образа TRD",&"имя файла в образе",[адрес блока памяти], [длина блока памяти в байтах] ; Прибавляет блок памяти к указанному файлу, начиная со следующего за ним сектора. Изменяет в идентификаторе файла только размер в секторах. Ругается ошибкой если получилось больше 255 ))
Я х.з. как создаются автозапуски, но в первом случае длина 250 байт, во втором 256. А если будете 250 указывать для второго ?
А вообще есть от них смысл ? boot запустится хоть с авто хоть без, а прочие все всё равно через RUN заходят. Имеет смысл если строка запуска не первая, или с программой данные переменных хранятся, но подобный изврат явно не ассемблерное дело на мой взгляд.
Последний раз редактировалось Dart Alver; 07.07.2020 в 00:19.
Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)