News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_m_dr_m

From MaXaM to OrGamS. A journey towards sanity.

Started by m_dr_m, 08:09, 01 June 21

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

m_dr_m


Here is a little summary of what is missing to migrate from MaXaM to OrgAmS.


# Missing features


• Includes. Weren't really missed since Orgams sources takes much less space and are easier to navigate. Also, independent modules are a better alternative in most cases.
   -> Nevertheless, they are incoming, in a better way! See description here (in 12 years-old English): http://orgams.wikidot.com/userguide#toc38


• Scripting from BASIC (numeric "for loops")
  -> Workaround:
Replace:



10 for i=1 to 12
20 |assemble,i
30 `get necronautical
40 `ld a,necronautical
40 'ld b,necronautical*3
30 next



By:



12 ** [
  ld a,#+1
  ld b,[#+1]*3
]





• Scripting from BASIC (passing different arguments)
   -> Workaround: Use macro.
   -> Proper solution: Support it! http://orgams.wikidot.com/v2boiteaidees#toc7


GUNHED

Thanks for opening this thread!!! What would be of general interest is a simple "How to move my source code form Maxam to Orgams" manual, explaining in few steps how to do it. If you want "for newbies"  ;) :)
Also, it would be nice to mention potential pitfalls.


What is needed else?
- The READ"FILE instruction
- The WRITE"FILE instruction

- The WRITE"FILE.COM" instruction

What doesn't matter much (for me):
- ASM code in BASIC, because we all have ediors nowadays

http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

m_dr_m


Thank you for the suggestions. I will update the top post, but I would love some precisions and use cases!


Migrating your source: basically |O, CONTROL-I filename Enter, CONTROL-1 to assemble, CONTROL-4 to cycle through assembly errors :)
Note: All those shortcuts are visible via CONTROL-H (HELP).
Most of the conversion (DB to BYTE etc...) is automatic, but the import is pretty slow (incoming: progress bar).
There is a more detailled description here: http://orgams.wikidot.com/userguide#toc6
A manual is a good idea, but I wonder whether more doc would help, if the existing doc isn't consulted anyway.


Regarding the missing directives:- READ will be covered by IMPORT.


- WRITE is actually achieved by CONTROL-1 (assemble) and B (save to binary). It's not versatile at all, so we might introduce a SAVE directive. But I need to know what are the use cases! Because i'm not quite convinced by the utility of such a directive.


- WRITE .COM: does it simply write an headerless file? Or are there some other CP/M specificities? Who uses that?


https://www.manualslib.com/manual/1124962/Maxam-10-Series.html

GUNHED


Thank you very much for your detailed answer.  :)  It will help lots of us a lot.  :)

Quote from: m_dr_m on 17:19, 01 June 21
- WRITE .COM: does it simply write an headerless file? Or are there some other CP/M specificities? Who uses that?
Yes! And it's of course very important. It does not only allow to assemble for CP/M.
It also allows to add some custom header to your file. Which is cool to add icons, additional informations and so on. I don't want to spam here too much, but on interest I can provide an example.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

m_dr_m

IIUC, that's just the absence of AMSDOS header that you need.
So basically, it would be more generic to allow: SAVE "toto.ico" ASCII
akin to [size=78%]BASIC's save"roger",a[/size]


I'm not fond of ".com" hack, but to ease migration, we could trigger an error or warning in this case:

line 42: Must specify ASCII or BIN for ".COM" files
     SAVE "DOT.COM"

GUNHED

Quote from: m_dr_m on 10:26, 02 June 21
IIUC, that's just the absence of AMSDOS header that you need.
Yes!

Quote from: m_dr_m on 10:26, 02 June 21
So basically, it would be more generic to allow: SAVE "toto.ico" ASCII
akin to BASIC's save"roger",a


See, this is where the problems start. There is no reason not to use the ".COM" for headerless files.

Why to change it to ".ico"? Just for the sake of itself?
If you want people coming over from Maxam to the great Orgams - then please make it easy! :) :) :)

Stay compatible where you can!  :) :) :)

Quote from: m_dr_m on 10:26, 02 June 21I'm not fond of ".com" hack, but to ease migration, we could trigger an error or warning in this case:

line 42: Must specify ASCII or BIN for ".COM" files

     SAVE "DOT.COM"

Sorry, TBH if I get a bunch of that errors then I just stop migrating and use what I always used. Just for a lack of time.

Hope this helps. You got an awesome product, but try to put yourself in perspective of somebody who would love to use Orgams - just as long as this is not too hard.  :) :) :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

m_dr_m

No, not replacing .COM by .ICO! That was just an exemple.


You said yourself:
QuoteIt also allows to add some custom header to your file.


So I picked an exemple of file which wouldn't be necessarily a .COM.


Quote
[size=0px]There is no reason not to use the ".COM" for headerless files.[/size]


I can see several reasons :)
* The headerless property and the name of the extension should be unrelated. We are not on MSDOS.
* I don't like "magical" behaviours and things that happen in inconsistent ways.


Again, my point is not to replace ".COM", but to be consistent, predictable, legible and beautiful.

Quote
[/size][size=0px]If you want people coming over from Maxam to the great Orgams - then please make it easy![/size]

[/size]

[/size]Fair, but backward compatibility sucks. Especially if it ends up being unused.[size=78%]
[/size]I've tried to make it easy (e.g. Maxam syntax is automatically converted, even on the fly when editing, so finger memory isn't an issue).[size=78%]
[/size]But I haven't seen any Maxam user migrating.[size=78%]












GUNHED

It's not being backward compatible. It's more about sticking to established standards. Look at the chaos we have on mass storage now, we have five DOS for FAT32 on CPC now - that's crazy!

Of course it's great to add new things to a modern assembler. However saving something as ".COM" usually doesn't want to have a header in CPC world.  ;)

Good luck with the project anyway, I'll have a look at it again when I finished some actual projects.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

m_dr_m

Cool! What are those projects?


If you wish, send me one of your source, so I can showcase a migration.
It's always very satisfying to go from 2 minutes assembling to 2 seconds.

GUNHED

Quote from: m_dr_m on 08:46, 04 June 21
Cool! What are those projects?
If you wish, send me one of your source, so I can showcase a migration.
It's always very satisfying to go from 2 minutes assembling to 2 seconds.
Right now, I do improve the software for the LambdaSpeak FS, that's a ROM providing RSX commands to deal with the LFS expansion. The newest update is always on my homepage (see link in my signature). Of course I do provide source code for that too. However, there's no artificial header.
Sources with artificial headers (including an icon for example) can be found there too, just look for source code for FutureOS applications.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

m_dr_m

#10
Thank you for sharing the sources, that's really nice.



Here is a little step by step guide, tested with LS-TIME.MAX.



Loading LS-TIME.COM from BASIC (at e.g. &3000)  ; For further check
|O  ; Enter the editor
CONTROL-I LS-TIME.MAX ENTER ; Import from ascii (or dams)
    ; The import is quite long (16 seconds). But it only has to be done once.
    ; Also, I wonder what is the MaxaM assembling time for this file!
CONTROL-1 ; Assemble. **TAKES 0.5 SECONDS**
    ; The shortcut might seem arbitrary. Luckily there is an embedded help (CONTROL-H).
-> DEFM wasn't recognised, contrary to DEFB and DB, but that's fixed now (incoming in FF alpha 6).
CONTROL-4 ; Cycle through remaining errors:
-> WRITE directive not recognised now (cf previous discussion).
-> TIMEPRG label undefined. Because Orgams is case sensitive. There is a plan to relax the sensitivity while importing, and perhaps while editing when using uppercase letters.
; That's it. Took 1 minute to fix.
CONTROL-1 ; Assemble fixed version.
ESC ; To go to monitor
x&100,&3000  ; Diff: compare assembled code with reference binary.
; The first difference is far past the end of code: SUCCESS!



The file went from 14kb to 10kb (that's not much. Mark of a source with lots of comments and text. Also further gain are obtained with MACRO and repetitions blocs).


Addenda:
* NOLIST isn't recognised, yet it doesn't trigger any error, since it's seen as a label!

GUNHED

#11
These are great news!!! Thanks a lot of testing!!!

The NOLIST thing is just to suppress displaying source on the screen as you know. It makes only sense if there is a display at all and to suppress it for 100 KB source files or so.

I will have a deeper look now again at Orgams! Looks that lots of features are getting better and better.  :) :) :)


EDIT:

Quote from: m_dr_m on 19:53, 13 June 21Loading LS-TIME.COM     ; Also, I wonder what is the MaxaM assembling time for this file!
Loading source is 21 seconds (Loading from disc is better in Maxam 1.5, but I use 1.15)
Assembling time is 12 seconds.

http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

zhulien

#12
hi, do you have any examples of what orgams source looks like?


importing a simple maxam source, there are syntax errors, the simplest being defb for example is not recognised.  I did try BYTE and variations...


eg:


label: defb 1 ; comment

to:


label: BYTE 1 ; comment

.label BYTE 1 ; comment

label: BYTE 1

etc...

m_dr_m

I recommend to pick the lastest FF version (alpha 7): http://orgams.wikidot.com/working


db, defb, byte, defm, etc... will all be recognised (**and shown as BYTE**, for consistency sake and for technical reasons!).


All your variations should work. The ":" is removed since unneeded.
.label  ; Local label, only visible from the previous global label scope.

Powered by SMFPacks Menu Editor Mod