It would be quite convenient to add an operand allowing us to reverse the LSB & MSB of a WORD, for example:
WORD &0BEB ; write &EB,&0B
RWORD &0BEB ; write &0B,&EB
But there is maybe already a way to do that without a new operand?
MACRO RWORD m
BYTE m/&100,m and &ff
RWORD(&0bed - 2) ; Writes &0b,&eb
Good idea, it fits very well!
With repeated blocs, it will be convenient to be able to shorter the last one, for example like that:
8 ** [
] - 1
Here, 7 complete blocs, and the last one without the last byte (-1) because 'add hl,bc' is useless. Or something equivalent.
Maybe more elegant than:
IF # < 7
In the example you suggest, is it better that the "-1" means -1 byte or -1 instruction?
If it's instruction related, it's easier to use (however, in some cases it could prevent clever tricks).
Not sure about the elegance of « -1 »
• Error prone
• Not self documenting (Exhibit A: Toms' question)
Considering « # »
is already known, « if #<7 »
is more explicit.
By the way, a label should be used, to prevent changing the number of iteration while overlooking the test.
Another option to 'exit' the loop: C-like 'break'.
width ** [
BREAK if #=width-1
Another option to know we've reached the last iteration: implicit pseudo-label.
width ** [
BREAK if __LAST__
Or, a bit more cryptic:
width ** [ ld (de),a / inc e ]
Don't forget code is more often read than written, some verbosity doesn't hurt.
What's with the set 3 / res 3 by the way?
More precisely: what's with the res 3 ?
In the next version "Erratic Endeavour", one shall be able to enter RSXs in monogams.
Thus, I consider switching to firmware screen dimensions (80x25).
Version EE will allow to include source files. Actually, I plan to name the directive IMPORT, since it doesn't strictly account to textual inclusion (by design, the included source cannot see the labels of the parent source).
Now there is another point: If two sources (A and B) both import a source L (useful routines, aka library) and a main root source imports A and B. We don't want L to be duplicated.
* For MACROs it's not a big deal since Orgams could reconcile them.
* For routines it's annoying.
We might use a "PRAGMA ONCE" directive, but I'm not fond of it.
The default should correspond to the most frequent usage.
So, I'm considering: only the first occurence of an import loads the source. In the rare case we actually want to include something several time, we'll just put it in a MACRO and invoke the MACRO at each place.
Oh, set 3/res 3 was a mistake, I would like to write set 3/set 4 (classical '2us' BC26).
Thanks for the workaround solution for last iteration of a repeated code. But am I wrong or they are not yet implanted in Orgams? Is there already other implicit pseudo-labels (__LAST__) to know? (if yes, useful to include in the documentation?)
Firmware screen dimensions for Monogams (not Trace I guess): I think that's ok, a high height was mostly useful for the dump.
Nice news for the EE version!
'IMPORT library' is cool, but do you plan something like 'FROM library IMPORT keytest'? But it will be needed to put some balises to define 'keytest' in the source...
The situation you are mentionning won't be very commun I think so it seems to be ok for the MACRO tips to bypass the problem.
None of these is available. The incoming priority is arithmetic comparators, so we'll stick to « if # < width-1 »
option. No other pseudo label than $, $$, #, ##, ### yet.
Thanks for the screen dimensions feedback. Anyway, the futurs prepares a full-blown hex editor (for files, snapshots or memory views), which will have it's own format (likely 25 lines of a customizable number of bytes up to 16. 25x16 > 31*8).
« 'IMPORT library' is cool, but do you plan something like 'FROM library IMPORT keytest'?
No, because I think it's best to put such routines in macro which don't emit code anyway. You might write:
ld a,&45:call test_key
The interesting point is that you could inline instead:
Which is might be beneficial for compression purpose, even if used more than once.
Also you'll be able to pass flags to imported source in order to activate or deactivated some part with conditional assembling.
Tip of the day. Expressions work uniformly.
BYTE "!" ; &21
ld a,"!" ; &3e,&21
And in Monogams
&0021 33 %00000000 00100001