Memory Full

Forum / Development

Orgams - The Users Speak!

first previous Page: 1 2

Hicks * 22 Mar 2019 09:18:05 * Modified at 09:19:00

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?

m_dr_m * 22 Mar 2019 15:00:44

Be creative!

   MACRO RWORD m
     BYTE m/&100,m and &ff
   ENDM

   RWORD(&0bed - 2)  ; Writes &0b,&eb

Hicks * 24 Mar 2019 18:25:07

Good idea, it fits very well!

Hicks * 14 Jun 2019 00:40:01 * Modified at 00:40:40

With repeated blocs, it will be convenient to be able to shorter the last one, for example like that:

8 ** [
ld (hl),a
set 3,h
ld (hl),a
res 3,h
...
ld (hl),a
add hl,bc
] - 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
add hl,bc
END

toms * 14 Jun 2019 16:50:01

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).

m_dr_m * 14 Jun 2019 17:24:54

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 ** [
   ld (de),a
BREAK if #=width-1
  inc e
]



Another option to know we've reached the last iteration: implicit pseudo-label.

width ** [
   ld (de),a
BREAK if __LAST__
   inc e
]



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.

m_dr_m * 15 Jun 2019 14:11:01

What's with the set 3 / res 3 by the way?

ast * 16 Jun 2019 11:42:05 * Modified at 11:42:32

@m_dr_m : no way !!

:D

m_dr_m * 16 Jun 2019 14:48:50

More precisely: what's with the res 3 ?

m_dr_m * 19 Jun 2019 11:36:52

In the next version "Erratic Endeavour", one shall be able to enter RSXs in monogams.
Thus, I consider switching to firmware screen dimensions (80x25).

WDYT?

m_dr_m * 24 Jun 2019 09:40:37

Important!

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.

WDYT?

Hicks * 29 Jun 2019 11:32:40

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.

m_dr_m * 30 Jun 2019 15:07:09

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:

import "toolbox"

  ld a,&45:call test_key

test_key TEST_KEY():RET



The interesting point is that you could inline instead:

 ld a,&45:TEST_KEY() 



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.

m_dr_m * 08 Jul 2019 03:01:22

Tip of the day. Expressions work uniformly.

  BYTE "!"  ; &21
  ld a,"!"  ; &3e,&21

And in Monogams
?"!"
&0021   33    %00000000  00100001 

first previous Page: 1 2