Page 2 of 2
Re: Which assembler/syntax?
Posted: Fri Aug 27, 2021 4:57 am
by cjs
It's nice to get rid of the semicolons [for comments] anyway, so you can have something like...
Code: Select all
COMMENT
Don't use N-1 like other systems. It's not necessary with 816 & it'll put you
in XSAVE....
END_COMMENT
There are a few advantages to comments that use a line prefix:
- Auto-formatting tools generally work better with them, because they require less syntactical analysis than block comments, particularly block comments with word-based delimiters. (Many reformatting tools can't even be programmed to properly reformat your example above without manual marking of the first and last lines in the block to exclude COMMENT and END_COMMENT.)
- A line prefix makes it easier to use programs like grep to extract or strip out comments.
- Perhaps just a personal thing, but I generally find the semicolon-prefixed version of things like that easier to read because the comments are clearly set off in a way that scans quickly, especially if the comment is very long. I certainly prefer BDDs current version he posted below to one without the semicolon prefixes.
Of course I'm sure that the COMMENT / END_COMMENT thing also has its particular advantages; I just wanted to point out some of the advantages a line prefix has. And also note that easier formatting for formatting tools is not an advantage of block comments, unless you're using a relatively primitive formatting tool. All of the reasonably sophisticated ones deal exactly the same even with bullet points, hanging indents and suchlike, whether or not a comment prefix character is used.
In other words, if you aren't driving a 2022 model year automobile you had better take your current vehicle to the junkyard and then hightail to the new car dealer with checkbook in hand. After all, your old car won't be operable on the new roads some unnamed propeller-heads are paving. Sounds to me like a good reason to not visit websites that will only support the bleeding edge.
This analogy is broken in so many ways:
- The new car is free of cost, for God's sake.
- You're driving a non-standard car and asking folks writing code for you for free to write yet more code (and do more support work) to support your non-standard car in addition to the standard.
- The propeller-heads here are not unnamed; you can easily go find out who they are, and you even had an opportunity to give input on the new standards.
- You are perfectly welcome not to visit web sites you don't want to visit, but complaining about web sites you don't even want to visit is merely dragging your problems into other peoples' lives. If you don't like something you don't want to use, especially when you had a opportunity to influence that design that you were too lazy or ignorant to take, just shut up about it already.
Re: Which assembler/syntax?
Posted: Fri Aug 27, 2021 5:04 am
by Individual_Solid
The Web Standards Consortium are currently in the middle of trying to establish a new file access api, to allow browsers to have consistent and secure access to user files - unfortunately, Firefox and Safari are struggling to keep up with the changes in standards, so writing for them involves using APIs that they have deprecated, in the knowledge that upcoming releases will stop that code from working at an unpredictable time.
In other words, if you aren't driving a 2022 model year automobile you had better take your current vehicle to the junkyard and then hightail to the new car dealer with checkbook in hand. After all, your old car won't be operable on the new roads some unnamed propeller-heads are paving. Sounds to me like a good reason to not visit websites that will only support the bleeding edge.
The author has already graciously offered to make the application Firefox compatible once the codebase is a little more stable. They've also enumerated the specific APIs that don't currently work on Firefox, so it's likely you could even use the application today without touching the load/save/usb-serial features and have an enjoyable time. This seems like an unnecessarily negative attitude toward someone sharing their creation. The feedback that Firefox-compatibility would be useful has been addressed.
Tuna, your project is very cool. Given your ambitions for compatibility with common assemblers, it could be very cool to see it on the command line (via node, deno, whatever). Another neat capability would be load/save from github (or other web-scm) repositories. If you don't want to just go on and do a VS Code plugin

Re: Which assembler/syntax?
Posted: Fri Aug 27, 2021 8:06 am
by BigEd
Nice project Andy! (One might say, don't feed the trolls.)
Re: Which assembler/syntax?
Posted: Fri Aug 27, 2021 9:46 am
by Tuna
The Web Standards Consortium are currently in the middle of trying to establish a new file access api, to allow browsers to have consistent and secure access to user files - unfortunately, Firefox and Safari are struggling to keep up with the changes in standards, so writing for them involves using APIs that they have deprecated, in the knowledge that upcoming releases will stop that code from working at an unpredictable time.
In other words, if you aren't driving a 2022 model year automobile you had better take your current vehicle to the junkyard and then hightail to the new car dealer with checkbook in hand. After all, your old car won't be operable on the new roads some unnamed propeller-heads are paving. Sounds to me like a good reason to not visit websites that will only support the bleeding edge.
Since you clearly don't want to use the tool I'm providing for free, please can you provide your IP address and I'll ban you from my site to make sure you can't be offended.
I've just checked it on the current release of Firefox (91.0.2 (64-bit)) and it works just fine. If you aren't running a reasonably recent release, can I take it from your analogy that you never check and replace your tires, oil or belts in your automobile, and complain that other people's cars "brake too well"?

Re: Which assembler/syntax?
Posted: Fri Aug 27, 2021 9:51 am
by Tuna
Tuna, your project is very cool. Given your ambitions for compatibility with common assemblers, it could be very cool to see it on the command line (via node, deno, whatever). Another neat capability would be load/save from github (or other web-scm) repositories. If you don't want to just go on and do a VS Code plugin

Thank you. I'd very much like to make it work with github at-al, but have so far committed to making it a completely static web page (no back end server) - that makes authenticating to web-scm repos a bit of a challenge.
A command line tool should be easier to create once I've rounded out the core functionality a little.
Re: Which assembler/syntax?
Posted: Sat Aug 28, 2021 6:44 am
by BillG
and I've tried to make it fairly syntax-neutral, so:
Hex can be written as $FE 0xFE, binary as %101010 or 0b10101
Better add FEH and 101010B too.
Good point, though I must admit FEH is horrible to parse as it can appear ambiguous (for instance: A5H and ASH, visually similar, or BAH - is that a label or a value?)
That one is easy.
Every assembler using the "trailing h" notation requires starting with a numeric digit.
So it is written like 0FEh
Re: Which assembler/syntax?
Posted: Sat Aug 28, 2021 6:48 am
by BillG
It's nice to get rid of the semicolons [for comments] anyway, so you can have something like...
Code: Select all
COMMENT
Don't use N-1 like other systems. It's not necessary with 816 & it'll put you
in XSAVE....
END_COMMENT
I am cheap. For commenting out a block of code, I use
The assembler already has conditional assembly constructs.
Re: Which assembler/syntax?
Posted: Sat Aug 28, 2021 7:15 am
by BigDumbDinosaur
I am cheap. For commenting out a block of code, I use
The assembler already has conditional assembly constructs.
That's too easy!
Re: Which assembler/syntax?
Posted: Sat Aug 28, 2021 7:55 am
by fachat
Also, what output format can the assembler produce? An o65 file is essential for relocation of binaries at load time.it has been mentioned here already that separate link stage is desirable which would require a linkable file format.
Re: Which assembler/syntax?
Posted: Sat Aug 28, 2021 7:57 am
by fachat
Does it support arbitrary nested blocks?
I use this a lot in my code with xa65, that has .( and .) for block demarcation.
Re: Which assembler/syntax?
Posted: Sat Aug 28, 2021 12:14 pm
by Tuna
Also, what output format can the assembler produce? An o65 file is essential for relocation of binaries at load time.it has been mentioned here already that separate link stage is desirable which would require a linkable file format.
It's not a goal (at present) to generate relocatable binaries. Running within the browser, the assembler produces a listing output and writes binary to the emulated system. A command line version would obviously have to write a binary file (or files) - but as there are plenty of command line tools out there, it's not a priority to 'compete' with existing, mature offerings.
Internally, the assembler supports an arbitrary number of nested scopes, which will be available when I add block level directives.
Re: Which assembler/syntax?
Posted: Sat Aug 28, 2021 12:16 pm
by Tuna
and I've tried to make it fairly syntax-neutral, so:
Hex can be written as $FE 0xFE, binary as %101010 or 0b10101
Better add FEH and 101010B too.
Good point, though I must admit FEH is horrible to parse as it can appear ambiguous (for instance: A5H and ASH, visually similar, or BAH - is that a label or a value?)
That one is easy.
Every assembler using the "trailing h" notation requires starting with a numeric digit.
So it is written like 0FEh
Doh! Of course. That'll teach me not to engage the braincell.

Re: Which assembler/syntax?
Posted: Sat Aug 28, 2021 12:49 pm
by cjs
Every assembler using the "trailing h" notation requires starting with a numeric digit.
Not every one. Some, such as certain MSX assemblers, will simply look up the token as a symbol first and, if a symbol with that name is not found, process it as a hex number if it's in a valid format for that. So `LD A,BAH` will use the value of symbol `BAH` if it exists, or the hex value BA if it doesn't.
If that strikes you as unfortunate, I believe the assembler also allowed Motorola-style hexadecimal literals, so you could just use `$BA`.
(I don't recall the name of the assembler in question, unfortunately. But it may have been multiple assemblers that all did this; I got the impression that this kind of thing was not uncommon in the MSX world.)
Re: Which assembler/syntax?
Posted: Fri Sep 03, 2021 12:40 pm
by jgharston
and I've tried to make it fairly syntax-neutral, so:
Hex can be written as $FE 0xFE, binary as %101010 or 0b10101
Better add FEH and 101010B too.
Can I throw in a vote for &FE as well.
Does your conditional assembly accept
if-defined label-name as well as
if label-name? #IFDEF helps a lot with much of the code I write as unknown defaults can easily be set.
Re: Which assembler/syntax?
Posted: Sat Sep 04, 2021 9:53 pm
by fachat
Can I throw in a vote for &FE as well.
Some assembler use the ampersand for octal
Does your conditional assembly accept if-defined label-name as well as if label-name? #IFDEF helps a lot with much of the code I write as unknown defaults can easily be set.
Good point.
Also what about
if-used label-name?
I use this for (assemble-time) libraries, to only include code that has actually been referenced.
André