6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 6:54 am

All times are UTC




Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Fri Aug 27, 2021 4:57 am 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
GARTHWILSON wrote:
It's nice to get rid of the semicolons [for comments] anyway, so you can have something like...
Code:
  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.

BigDumbDinosaur wrote:
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.

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 27, 2021 5:04 am 
Offline
User avatar

Joined: Fri Jun 25, 2021 5:38 am
Posts: 72
Location: Portland, Oregon, USA
BigDumbDinosaur wrote:
Tuna wrote:
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 ;)

_________________
https://github.com/Individual-Solid/


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 27, 2021 8:06 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Nice project Andy! (One might say, don't feed the trolls.)


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 27, 2021 9:46 am 
Offline

Joined: Mon Aug 23, 2021 9:01 pm
Posts: 10
BigDumbDinosaur wrote:
Tuna wrote:
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. :lol:

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"? :wink:


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 27, 2021 9:51 am 
Offline

Joined: Mon Aug 23, 2021 9:01 pm
Posts: 10
Individual_Solid wrote:
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.


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 28, 2021 6:44 am 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 704
Location: North Tejas
Tuna wrote:
GARTHWILSON wrote:
Quote:
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


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 28, 2021 6:48 am 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 704
Location: North Tejas
cjs wrote:
GARTHWILSON wrote:
It's nice to get rid of the semicolons [for comments] anyway, so you can have something like...
Code:
  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

Code:
if 0

<commented out code>

endif


The assembler already has conditional assembly constructs.


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 28, 2021 7:15 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8505
Location: Midwestern USA
BillG wrote:
I am cheap. For commenting out a block of code, I use

Code:
if 0

<commented out code>

endif

The assembler already has conditional assembly constructs.

That's too easy! :D

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 28, 2021 7:55 am 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1043
Location: near Heidelberg, Germany
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.

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 28, 2021 7:57 am 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1043
Location: near Heidelberg, Germany
Does it support arbitrary nested blocks?

I use this a lot in my code with xa65, that has .( and .) for block demarcation.

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 28, 2021 12:14 pm 
Offline

Joined: Mon Aug 23, 2021 9:01 pm
Posts: 10
fachat wrote:
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.


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 28, 2021 12:16 pm 
Offline

Joined: Mon Aug 23, 2021 9:01 pm
Posts: 10
BillG wrote:
Tuna wrote:
GARTHWILSON wrote:
Quote:
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. :lol:


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 28, 2021 12:49 pm 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
BillG wrote:
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.)

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 03, 2021 12:40 pm 
Offline

Joined: Sun Feb 22, 2004 9:01 pm
Posts: 108
GARTHWILSON wrote:
Quote:
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.

_________________
--
JGH - http://mdfs.net


Top
 Profile  
Reply with quote  
PostPosted: Sat Sep 04, 2021 9:53 pm 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1043
Location: near Heidelberg, Germany
jgharston wrote:
Can I throw in a vote for &FE as well.

Some assembler use the ampersand for octal
Quote:
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é

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: