Poll

Orgams: Separator for module (aka namespace)

. (dot)
5 (83.3%)
:: (double colon)
1 (16.7%)

Total Members Voted: 6

Author Topic: Orgams: Best assembler in my living room.  (Read 9564 times)

0 Members and 1 Guest are viewing this topic.

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 1.245
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #50 on: 14:36, 10 August 21 »
it would be friendly to use


Code: [Select]
/*
ld hl,#4000
ld de,#4001
ld bc,#3fff
ld (hl),l
ldir
*/
ld hl,#c000 ; this instruction will be assembled.


in this case, all the instructions between /* and */ are comments...





like
0
No reactions
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcomed !

Offline m_dr_m

  • 464 Plus
  • *****
  • Posts: 325
  • Country: gb
  • http://orgams.wikidot.com/
    • OrgaMS!
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #51 on: 00:43, 11 August 21 »
Thank you for the suggestion.
Yet, in my book it's far more convenient to do:
Code: [Select]
if 0
 ld hl,#4000
 ld de,#4001
 ld bc,#3fff
 ld (hl),l
 ldir
end

or even better:

Code: [Select]
clear_screen = 0
display_tm = 1
dev_checks = 1
[...]


if clear_screen
 ld hl,#4000
 ld de,#4001
 ld bc,#3fff
 ld (hl),l
 ldir
end

So you can control all conditional assembly from one place, and go from the flag definition to its use(s) with CONTROL-*.
There are other advantages not to bury code in comments.

Alternatively, you can put the clear routine in a macro, and just comment the macro invocation.


Be creative!
« Last Edit: 00:45, 11 August 21 by m_dr_m »
like
0
No reactions

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.899
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #52 on: 15:53, 11 August 21 »
Or get out of the 50ies. Let the Editor care about what's comment and what's not.
On screen show code and comments in different colors or in regular and italics. Something like that.
This would save as from strange comment characters like ";" or "/*".


Yes, you won't like the idea, but I needed to tell .  :) :) :)
like
0
No reactions
http://futureos.de --> Get the revolutionary FutureOS (Update: 2021.01.24)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.07.15)

Offline Cwiiis

  • CPC664
  • ***
  • Posts: 140
  • Country: gb
    • Blog
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #53 on: 23:58, 11 August 21 »
After getting used to Orgams a bit more, I think my number 1 feature request would be to show all 8 bits, including leading zeros for binary numbers, and all 2 or 4 characters for 8 or 16-bit hex values. Thought I'd post because that seems like quite an easy thing to do and would have a huge impact, at least for me :)
I suppose with the 80-character per line limit, perhaps it'd make more sense for it to just remember the number of leading zeros the user inputs, but if that's less feasible, I'd definitely pick showing all 2/4/8 digits over stripping the leading zeros.
like
0
No reactions

Offline m_dr_m

  • 464 Plus
  • *****
  • Posts: 325
  • Country: gb
  • http://orgams.wikidot.com/
    • OrgaMS!
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #54 on: 02:47, 12 August 21 »
Or get out of the 50ies. Let the Editor care about what's comment and what's not.
On screen show code and comments in different colors or in regular and italics. Something like that.
This would save as from strange comment characters like ";" or "/*".

* Orgams already shows comments in shaded colour. You should try it, really.
* Ast suggestion was about block-comment. Relying on editor command and invisible markers isn't practical in my book. For instance, that means you have to reselect the whole block to uncomment.

Yes, keeping the leading 0s for binary or hex values is good idea!

like
0
No reactions

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.899
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #55 on: 15:52, 12 August 21 »
Yeah, I guessed that. The world is not ready for my idea. I'll come back to it in 2028.  ;D
like
0
No reactions
http://futureos.de --> Get the revolutionary FutureOS (Update: 2021.01.24)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.07.15)

Offline Cwiiis

  • CPC664
  • ***
  • Posts: 140
  • Country: gb
    • Blog
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #56 on: 14:54, 14 August 21 »
Another feature request; I'm very used to using vim and split panels - if you could introduce a horizontal split at the cursor so you could look at a different range of lines in the same file, that would be great. I realise you could open the same file in a different tab, but sometimes you just want to have a reference handy. Still really liking Orgams btw :)
like
0
No reactions

Offline Cwiiis

  • CPC664
  • ***
  • Posts: 140
  • Country: gb
    • Blog
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #57 on: 15:19, 15 August 21 »
A question and possible request, for macros, can you use parameters in commands? I wanted to do this for a line-interrupt macro;

Code: [Select]
MACRO LINE_INT n
        MAP_PLUS(1)
        ld a,n
        ld (&6800),a
        MAP_PLUS(0)
ENDM

MAP_PLUS is a predicate macro to page in CRTC registers. Building this, I get a syntax error on ld a,n - is there a way to do this currently? If not, that'd definitely be nice :)

like
0
No reactions

Offline m_dr_m

  • 464 Plus
  • *****
  • Posts: 325
  • Country: gb
  • http://orgams.wikidot.com/
    • OrgaMS!
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #58 on: 01:12, 16 August 21 »
I'm also a long time user of Vim (hence the CONTROL-* to go to next occurrence of label!).
Split panes would require a lot of work, though. Maybe less through Gedeihen (Declarative GUI engine), which is still WIP.


Parameters in MACRO is meant to work, and you are the first one to report a bug about that.
I wasn't able to reproduce your problem, would you be able to post a complete exemple with invocation that triggers the syntax error?


Hypothesis: there is a syntax error in MAP_PLUS(1), and a bug about the reported line.
What happen if you put a NOP before ld a,n?
like
0
No reactions

Offline Cwiiis

  • CPC664
  • ***
  • Posts: 140
  • Country: gb
    • Blog
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #59 on: 19:41, 18 August 21 »
Hypothesis: there is a syntax error in MAP_PLUS(1), and a bug about the reported line.
What happen if you put a NOP before ld a,n?
No idea what happened, but I uncommented it and it just works now. Previously it was complaining that the parameter label didn't exist... Who knows!

Another question, are there greater than/less than predicates? Following your example for a nops macro, I wanted it to preserve all registers and in the case that you give it a value less than the minimum, just use nops... But it seems </> aren't valid syntax. They aren't mentioned in the user guide, so I suppose not... In which case, that's definitely another feature request :)

And aside, I've switched to real hardware instead of WinAPE now (6128 Plus, X-MEM and Gotek) and a weird bug I get, on first launch of Orgams, after scrolling a few pages, it resets back to basic. Relaunching orgams, everything seems fine and I can just carry on as normal (the cursor starts in the margin, but once I move it away, it behaves normally). Bit of an odd one!
like
0
No reactions

Offline m_dr_m

  • 464 Plus
  • *****
  • Posts: 325
  • Country: gb
  • http://orgams.wikidot.com/
    • OrgaMS!
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #60 on: 07:10, 19 August 21 »
Previously it was complaining that the parameter label didn't exist...
That can happen when the passed expression cannot be resolved at invocation time (e.g. forward reference).
Code: [Select]
   LINE_INT(defined_after)
[...]
defined_after = 4

Another question, are there greater than/less than predicates?
Not yet! I can explain how to add them :)

it resets back to basic
Orgams is pretty much crash-safe (at worse, some assert/breakpoint might be triggered, which would switch to debugger page).
Make sure your connector is perfectly clean.
Anyway, glad to hear you use the real stuff!
like
0
No reactions

Offline Cwiiis

  • CPC664
  • ***
  • Posts: 140
  • Country: gb
    • Blog
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #61 on: 02:16, 26 August 21 »
I've got to the point where I could really use a way of transferring text from PC to Amstrad. If I put a text file on a disc using WinAPE without generating an AMSDOS header, Protext views it fine, but if I try to import it in Orgams, it hangs.

On reset, I can see it imported the text, but then it also imports thousands of lines of nothing... So I guess somehow Orgams is missing the end of the file, or I'm not doing this correctly? I don't have an M4 cart, so Gotek + WinAPE to edit disc files is my current means of transfer. Any tips?
like
0
No reactions

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.899
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #62 on: 15:42, 26 August 21 »
Can you please make a DSK with that file and post it here. I will have a look at it.
like
0
No reactions
http://futureos.de --> Get the revolutionary FutureOS (Update: 2021.01.24)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.07.15)

Offline m_dr_m

  • 464 Plus
  • *****
  • Posts: 325
  • Country: gb
  • http://orgams.wikidot.com/
    • OrgaMS!
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #63 on: 13:51, 27 August 21 »
then it also imports thousands of lines of nothing...
Which DOS are you using?
If CubeMDOS, this is due to https://www.cpcwiki.eu/forum/applications/cubeios-fat16fat32-rom-for-the-cpc's-with-xmass/msg203159/#msg203159

Either way, I'll try to publish a corrected version this week-end.
like
0
No reactions

Offline Cwiiis

  • CPC664
  • ***
  • Posts: 140
  • Country: gb
    • Blog
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #64 on: 14:06, 27 August 21 »
I don't recall if I was using AMSDOS or ParaDOS, but one of those. I've attached the disc image, 'GHOST.TXT' is the text file in question (I think - can't conveniently check right now). Please ignore the rest of it :)
like
0
No reactions

Offline m_dr_m

  • 464 Plus
  • *****
  • Posts: 325
  • Country: gb
  • http://orgams.wikidot.com/
    • OrgaMS!
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #65 on: 23:00, 03 September 21 »
I think my number 1 feature request would be to show all 8 bits
Done!
So I guess somehow Orgams is missing the end of the file
Fixed!

Available in alpha7. http://orgams.wikidot.com/working

The world is not ready for my idea
The world was ready decades ago. It's called WYSIWYG, and that's usually in a pain in the ass.
I guess the best of both worlds is markdown-like markup with immediate render.
like
0
No reactions

Offline m_dr_m

  • 464 Plus
  • *****
  • Posts: 325
  • Country: gb
  • http://orgams.wikidot.com/
    • OrgaMS!
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #66 on: 14:19, 20 September 21 »
Poll: Separator for module (aka namespace)
Context:
Since FroggyFlags Alpha2, Orgams allows local labels (which can be reused in different scope / macro invocations):
Code: [Select]
gen_mesh
   ld b,width
.loopx
    [...]
    djnz loopx
[...]
   
display_mesh
   ld b,width
.loopx
    [...]
    djnz loopx
[...]
For now, you cannot access those labels outside of their scopes. Once possible, the syntax would be:
Code: [Select]
   ld b,width2
   jr gen_mesh.loopx


Now, I will also introduce module/namespace:
[/size]In that case you can write:
Code: [Select]
module Player


init
 [...]


update
.loop
  [...]
  djnz .loop
  ret


display
  [...]



endmodule
[/size]The poll question amounts to how to access `init` outside `Player` scope?
  • [/size]Also with dot notation.
Code: [Select]
call Player.init
jr Player.update.loop
  • [/size]Used dy other assemblers (e.g. sjasmplus)
  • [/size]Nice symmetry with global+local labels (it’s a pro from some, a con for others).
  • [/size]With :: separator
Code: [Select]
call Player::init
jr Player::update.loop
  • [/size]Similar to namespace qualification in some languages (rust)
  • [/size]Would allow having both a module and a global label with the same name (I’m not convinced it’s a good thing).
  • [/size]Would allow having two imports with same name but different extension (idem):
Code: [Select]
import “math.i”
import “math.o”


    ld hl,math.i::PI
    call math.o::cos
[/size]FWIW, rams uses `_`, but since it’s also a valid label character, I find it too ambiguous.


like
0
No reactions

Offline krusty

  • CPC464
  • **
  • Posts: 12
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #67 on: 14:38, 20 September 21 »
I vote for the dot and will implement like this for my own assembler.
There is no reason to differentiate modules from global labels. And to use : everywhere would be unusual.Nested modules should be possible.To name a module with the imported file name is maybe not a good idea: you illustrate the issue with the extension, and what happens with compatible cross-assembler that can use complex paths ? I would rather use the filename without extension/path or provide it explicitly

import “math.i” as math_i
import “math.o” as math_o


In case of ambiguity, module name could be prefixed by :: to ensure lookup starts at module level and not inside module level

::Player is module Player
Player
is label player if any otherwise module Player
like
0
No reactions

Offline m_dr_m

  • 464 Plus
  • *****
  • Posts: 325
  • Country: gb
  • http://orgams.wikidot.com/
    • OrgaMS!
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #68 on: 14:13, 21 September 21 »
The 'as' syntax is sweet, but I'd rather re-use existing mechanism (well, not existing yet, but soon enough):


Code: [Select]
module math_i
   import "math.i"
endmodule



module math_o
   import "math.o"
endmodule
like
0
No reactions

Offline m_dr_m

  • 464 Plus
  • *****
  • Posts: 325
  • Country: gb
  • http://orgams.wikidot.com/
    • OrgaMS!
    • Awards
Re: Orgams: Best assembler in my living room.
« Reply #69 on: 14:14, 21 September 21 »
Also, please share your enlightened opinions about http://memoryfull.net/post.php?id=30&page=3#863

like
0
No reactions