NEO SPECTRUMAN(11.11.2020)
странно на вид работает о_О
когда последний раз проверял макросы
по моему или неправильно находилась длина процедур и часть их потом затиралась
или jp вели на другие адреса
конечно еще нужно проверить в реальном коде
- - - Добавлено - - -
хотя это не выход из положения
мне нужна именно временная метка
так как
скомпилируется какКод:tamp_left_allocate_macro callNoSp ix,someProcedure end_tamp_left_allocate_macro tamp_right_allocate_macro callNoSp ix,someProcedure end_tamp_right_allocate_macro tamp_left_allocate_macro jp $ end_tamp_left_allocate_macro
когда нужноКод:$8000 ld hl,$8006 jp procedure $8006 jp $8006 $C300 ld hl,$C306 jp procedure
Код:tamp_left_allocate_macro ld hl,temp jp procedure end_tamp_left_allocate_macro tamp_right_allocate_macro temp ld hl,temp jp procedure end_tamp_right_allocate_macro tamp_left_allocate_macro temp jp $ end_tamp_left_allocate_macroКод:$8000 ld hl,$С300 jp procedure $8006 jp $8006 $C300 ld hl,$8006 jp procedure
память может быть сильно фрагментированной
и такая конструкция работать не будет
- - - Добавлено - - -Код:dup 100 tamp_left_allocate_macro callNoSp ix,someProcedure end_tamp_left_allocate_macro edup
наглядный пример
Код:org_allocate_macro $C010 di : halt end_org_allocate_macro org_allocate_macro $C021 di : halt end_org_allocate_macro DUP 100 tamp_left_allocate_macro callNoSp ix,someProcedure end_tamp_left_allocate_macro EDUP
так же невозможно организовать выход из такой процедуры
так как последний ix должен вести на выход
Последний раз редактировалось NEO SPECTRUMAN; 11.11.2020 в 18:00.
That screenshot: so you did want "C019 ld ix,C023" to make "C00B" procedure return AFTER the "di:halt", right?
And the final "C046 ld ix,C04D" should be "ld ix,someExit"?
well, the second part is easy, just: ".100 callNoSp ix,proc" turns to ".99 callNoSp ix,proc" + "ld ix,exit : jp proc"
but the first part is changing the task completely, so you don't want to IX="after `jp proc`", but you need IX="ahead of next code block".
If I understand you correctly now.
what about this:
(took me couple of minutes of thinking to avoid Lua ... but in the end the extra helper macro did the trickКод:; helper macro to make __COUNTER__ sub-word substitution possible (hiding it in macro arg) ; ("FollowingCode___COUNTER__" would not substitute, but "FollowingCode_suffix?" does) MACRO nextFollowingCodeLabel suffix? IFDEF FollowingCodeLabel FollowingCodeLabel: UNDEFINE FollowingCodeLabel ENDIF DEFINE FollowingCodeLabel FollowingCode_suffix? ENDM MACRO tamp_left_allocate_macro ; ... some allocation done and final ORG nextOrg=(nextOrg+$6789)&$FFFF ; for fun jump around memory (not real "allocate") ORG nextOrg ; where next code block should land ; mark this new code-block with "FollowingCodeLabel" label, and advance it for next code-block nextFollowingCodeLabel __COUNTER__ ; ... other preamble shared code ... ENDM MACRO end_tamp_left_allocate_macro ; ... ENDM MACRO callNoSp returnReg?, procedureAdr? ld returnReg?,FollowingCodeLabel jp procedureAdr? ENDM ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; the memory location of code blocks is not important (could jump back and forth) ; ; the source code order of blocks is important - "FollowingCodeLabel:" is relative ; to where in source you currently are. ; ; And "tamp_left_allocate_macro" will advance it ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; nextOrg = $1234 DUP 100 tamp_left_allocate_macro nop callNoSp ix,someProcedure end_tamp_left_allocate_macro EDUP ; one manual block outside of DUP ... nextFollowingCodeLabel __COUNTER__ ; define label for this block and advance it daa ; manual block code callNoSp ix,someProcedure ; exit-block manually added, just defining last FollowingCodeLabel label FollowingCodeLabel: ; create one more "next code block" label for exit-block ; ... exit code (after last block) di halt someProcedure: ; ... jp ix)
(I don't see how that matters for that example, just extract the functionality and add it in the form valid for your use case - I can't produce your code, if you don't share it first, if you will re-read history of this topic, you keep coming with new bits of info after every response posting you working example fitting your previous rules - stops being fun after like third try, that you can't explain yourself clearly in the first post
.. so you have like one try left)
Последний раз редактировалось NEO SPECTRUMAN; 16.11.2020 в 13:17.
yep. I have no plans to extend temporary digit-labels to work with all instructions, the current design of making them valid only with `jr/jp/call` is fine by me (I think I understand *why* Sjoerd Mastijn designed it like that... even current sjasm 0.42 has still the same design of "reusable labels") (while checking sjasm docs, I see somewhat adjusted rules for regular labels, this looks interesting, the "!" prefix would be nice to add into sjasmplus - not related to your issue, just taking note for myself).
There are two issues about extending temporary/reusable labels:
1) I don't have vision of clearly-better solution, when I gave it some short thought, I see only more mess and confusion
2) I have lot of other stuff to do on sjasmplus (SLD export and warnings-system improvements, then release), but little time for it
And for me the proposed solution in my last answer with code looks good, like valid solution, feels to me much more solid than some temporary label hack.
(of course anyone else can redesign the feature and ask me (and other contributors) if we like the new design, and implement a patch and create pull request... it's open project and I would feel bad to just reject it)
If I will have nothing else to do on sjasmplus and feel bored, I will certainly revisit any remaining suggestions and try to pick some good ones.
With regard to your current issue, I provided you working solution. I don't see what more you want, sorry.
Последний раз редактировалось Ped7g; 16.11.2020 в 13:40.
https://github.com/z00m128/sjasmplus...es/tag/v1.18.0
- some new/improved directives: WHILE<->ENDW, ELSEIF, DEFINE+, DISPLAY
- abs operator
- new warning system (with systematic suppression scheme)
- some bugfixes/implementation rewritten
- and more tiny details...
... I have a feeling this may be default setup of some guys here (but you may try first without and see if it's relevant)
Anyway, if you see some new warning with "warning[some_id]" form, then `-Wno-some_id` will switch it off completely, and line comment "; some_id-ok" will suppress it for particular line.Код:; ... in source ... OPT -Wno-rdlow -Wno-out0 -Wno-trdext -Wno-trdext3
Have fun.![]()
Evgeny Muchkin(16.12.2020), NEO SPECTRUMAN(12.12.2020)
Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)