6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 5:12 pm

All times are UTC




Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Which assembler/syntax?
PostPosted: Thu Aug 26, 2021 3:55 pm 
Offline

Joined: Mon Aug 23, 2021 9:01 pm
Posts: 10
I've been developing my own browser based IDE for the 6502/65C02 (here, requires Chrome/Edge: https://feertech.com/legion/cerberus.html )

The assembler I've written is a basic multipass assembler, and I've tried to make it fairly syntax neutral, so:

.BYTE and DB are synonyms, as are '=' and EQU, .WORD and DW

Hex can be written as $FE 0xFE, binary as %101010 or 0b10101

labels can be any length, with local labels identified with a leading . (ie .local_label).

Comments start with ;

Values can be truncated to 8-bit with < and > (low and high bytes) or forced to 16 bit with !, and full expression evaluation is supported (eg. #<(MY_VALUE+16*OTHER_VALUE & BITMASK) )

I've not (yet) included macro or conditional assembly directives, but would be interested to know which assemblers you all use, preferred syntax and 'must have' features that you use regularly?


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 26, 2021 4:07 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
Tuna wrote:
I've not (yet) included macro or conditional assembly directives, but would be interested to know which assemblers you all use, preferred syntax and 'must have' features that you use regularly?


I use ca65 from the cc65 suite with Makefiles on my Linux desktop system.

Essential to me is separate assembly and linking. e.g. RubyOS (assembles to over 10KB) is split over 35 source files plus 33 header files and my BCPL Cintcode VM is similar (assembles to just under 16KB)

Other than that, macros and conditional assembly are things I use regularly.

https://cc65.github.io/doc/ca65.html

Cheers,

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 26, 2021 4:55 pm 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
I use the Macroassembler AS; it's featureful and supports literally hundreds of CPUs and variants. I have not yet bothered with Make or any other dependency system because even using a single core on a 12-year-old laptop it assembles about 1.5 KB of output per second.

The speed is also advantageous because I don't do linking. I tried it out for a while, but switched to whole-program builds because linking just didn't give enough flexibility. My modules tend to be very heavily parameterised, i.e., I build rather different versions of them when used in different programs.

Thus, of course, I use includes and assembler variables quite heavily. I make slightly less use of functions and macros, but where I do use them they're pretty important. In particular, I use macros for preventing errors in memory placement to keep, e.g., to prove that a combination of separate routines that have fixed starting addresses never overlap each other.

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


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 26, 2021 5:56 pm 
Offline
User avatar

Joined: Mon May 12, 2014 6:18 pm
Posts: 365
Two things that I think are really important are redefining symbols and defining symbols symbolically. CA65 was created to assemble output from the CC65 C compiler so it doesn't handle symbols the way some other assemblers do, unfortunately, although it's nice in other ways. Here's an example of what some assemblers can do:
Code:
A equ_val 5
B equ_val A
C equ_sym A
A equ_val 7
LDX #B
LDY #C
Hopefully this would lead to X=5 and Y=7 since C only gets set to the value of A when it's used with LDY. (equ_val and equ_sym are placeholders. You can use equ, set, = or whatever else.) Even better might be some kind of syntax where you can refer to a symbol in a definition either by it's symbol or current value:
Code:
A = 5
B = $A
C = %A
A = 7

Also, it's good to have a way to store a lot of values generated by macros in some sort of list or stack. I switched from CA65 to Macroassembler AS for this then switched away from Macroassembler AS when I ran into the 256 byte limit of strings generated in macros. For example:
Code:
FUNC foo
   BYTE a, b
   WORD c, d
   MOV a, c
END
I use macros there to record in a string what type of variables a, b, c, and d are so that "MOV a, c" knows it's copying a byte to a word and also to adjust the stack back at END.
EDIT: You can also use it to generate and nest structures like IF and DO where the string holds the name and type of labels.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 26, 2021 6:34 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8504
Location: Midwestern USA
Tuna wrote:
I've been developing my own browser based IDE for the 6502/65C02 (here, requires Chrome/Edge: https://feertech.com/legion/cerberus.html )

Any chance you could make it browser-agnostic? Lots of people don't use Microsoft stuff, and as for Chrome and the company that pushes it...

Quote:
...and full expression evaluation is supported (eg. #<(MY_VALUE+16*OTHER_VALUE & BITMASK) )

That syntax could be problematic. For example...

Code:
         LDA #<(MY_VALUE+16*OTHER_VALUE & BITMASK)

...is unambiguous (at least to a human reader), due to the use of immediate-mode addressing and the "take the LSB" greater-than symbol. On the other hand...

Code:
         LDA (MY_VALUE+16*OTHER_VALUE & BITMASK)

...will be interpreted as zero-page indirect addressing in any compliant 6502 assembler. You'd have to somehow differentiate between parentheses used to indicate indirection and parentheses used to establish expression evaluation.

In the Kowalski assembler, curly brackets ({}) are used to establish expression evaluation, thus preventing ambiguity.

Quote:
I've not (yet) included macro or conditional assembly directives, but would be interested to know which assemblers you all use, preferred syntax and 'must have' features that you use regularly?

I use the aforementioned Kowalski assembler, which thanks to extensive renovation by forum user 8BIT, supports the 65C816, as well as the NMOS 6502 and the WDC 65C02. It may be worth your while to try out that assembler to get a feel for features that you might wish to provide. Also, the assembler has a good macro language, which I find indispensable in my programming.

An essential feature of any assembler is the ability to generate a listing file during assembly. Here's an excerpt from a listing file as generated by the Kowalski assembler:

Code:
02838  00D08A  A3 05         todget   lda api_xrx,S         ;destination LSW
02839  00D08C  85 52                  sta kernptr1          ;set pointer LSW
02840  00D08E  A3 03                  lda api_yrx,S         ;destination MSW
02841  00D090  85 54                  sta kernptr2          ;set pointer MSW
02842  00D092  E2 30                  sep #m_setr
02843  00D094  A9 40                  lda #%01000000        ;suspend...
02844  00D096  04 0F                  tsb tdflag            ;shadow updates
02845  00D098  C2 20                  rep #m_seta
02846  00D09A  A0 04                  ldy #s_time_t-s_word
02847  ;
02848  00D09C  BD 16 01      .0000010 lda uxtimesr,x        ;get date & time &...
02849  00D09F  97 52                  sta [kernptr1],y      ;save it
02850           .rept s_word
02851  00D0A1  88                     dey
02852  00D0A2  88                     dey
02853  00D0A3  10 F7                  bpl .0000010
02854  ;
02855  00D0A5  E2 20         gettmcom sep #m_seta
02856  00D0A7  A9 40                  lda #%01000000        ;resume...
02857  00D0A9  14 0F                  trb tdflag            ;updates
02858  00D0AB  18                     clc                   ;no error
02859  00D0AC  60                     rts

The left-most numbers are line numbers. As this assembly was of 65C816 source code, addresses are 24-bit expressions. The .rept s_word pseudo-op repeats a code section s_word times (s_word is defined as 2). This listing style is informative and helps in debugging code.

Food for thought, I hope.

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


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 26, 2021 7:54 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
Good points have already been made. I'll add my own.

Tuna wrote:
I've been developing my own browser-based IDE for the 6502/65C02 (here, requires Chrome/Edge: https://feertech.com/legion/cerberus.html )

Most of these projects are for the originator's own use, which is perfectly fine, and it's justifiable to do it however he wants; however for others (if that's really an interest), I'll second the motion to not require a particular browser or OS. I will not use Chrome or Windows.

Quote:
The assembler I've written is a basic multipass assembler,

Hopefully it will keep doing passes until all the phase errors are taken care of. Normally two is enough; but I had a situation about 20 years ago where a chain of forward references required dozens of passes. Today's PCs are fast enough that it's not a problem.

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.

Quote:
labels can be any length, with local labels identified with a leading . (ie .local_label).

I'd suggest not requiring labels to start on the margin. Editors with a "condense" mode show, in that mode, only the lines that start with something on the margin, meaning you can make labels of only local interest not show in that mode. If the label is followed by a colon, it also makes it easier to find, as otherwise doing a search for the label may turn up a lot of references to the label before you find the label itself.

Quote:
Comments start with ;

Yes; but please don't require blank lines to start with a ; as it makes the code look messier. It's good to have COMMENT...END_COMMENT directives so you can have a paragraph of description, and if you want to add or delete something and it changes the line lengths, you don't have to adjust them all by hand again as you would with semicolons.

Quote:
I've not (yet) included macro or conditional assembly directives, but would be interested to know which assemblers you all use, preferred syntax and 'must have' features that you use regularly?

The two commercial assemblers I've used for 65xx are 2500AD and Cross-32 (C32 for short), both excellent macro assemblers. I like that C32 doesn't require dots in front of directives. I like that 2500AD allowed different numbers of macro input parameters, and then you could say in essence, "If there's a fourth parameter, do this with it;" and "If there's a fifth one, do the following;". Macros should be nestable, meaning one macro definition can invoke other macros, which in some cases can really shorten the definition.

I've made program flow-control macros which I show in that section of my website, and the assemblers I did it with did not allow assembler variable arrays, so I had to jurry-rig them, to make the structures nestable. It worked fine, but it's definitely not optimum. What I mean by assembler variable arrays is like EQUates that can be changed as many times as you want—C32 uses the SETL ("SET Label value") directive—but that you can go beyond individual equates and have arrays of them, and index into the arrays.

If you do everything everyone wants, it can become pretty daunting; so just take the suggestions into account and then do whatever you want or can.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 26, 2021 8:04 pm 
Offline

Joined: Mon Aug 23, 2021 9:01 pm
Posts: 10
BigDumbDinosaur wrote:
Any chance you could make it browser-agnostic? Lots of people don't use Microsoft stuff, and as for Chrome and the company that pushes it...


Unfortunately both Safari and Firefox are somewhat behind the curve at the moment, and my primary focus is to get the functionality first. There is nothing preventing you from using other browsers, but I cannot guarantee results without further testing. You are of course welcome to contribute to the effort ;)

BigDumbDinosaur wrote:
Quote:
...and full expression evaluation is supported (eg. #<(MY_VALUE+16*OTHER_VALUE & BITMASK) )

That syntax could be problematic. For example...

Code:
         LDA #<(MY_VALUE+16*OTHER_VALUE & BITMASK)

...is unambiguous (at least to a human reader), due to the use of immediate-mode addressing and the "take the LSB" greater-than symbol. On the other hand...

Code:
         LDA (MY_VALUE+16*OTHER_VALUE & BITMASK)

...will be interpreted as zero-page indirect addressing in any compliant 6502 assembler. You'd have to somehow differentiate between parentheses used to indicate indirection and parentheses used to establish expression evaluation.


The assembler would interpret that expression as zero page indirect addressing.

As it's a precedence expression parser, brackets are only needed if the precedence is not obvious. Otherwise preceding the expression with < (high byte) > (low byte) or ! (word value) will force an expression to be read as an immediate value, as would an 'empty' expression such as 0+ So:

Code:
         LDA >(MY_VALUE+16*OTHER_VALUE & BITMASK)


Establishes that this is expression evaluation rather than an indirect reference.

BigDumbDinosaur wrote:
In the Kowalski assembler, curly brackets ({}) are used to establish expression evaluation, thus preventing ambiguity.

Quote:
I've not (yet) included macro or conditional assembly directives, but would be interested to know which assemblers you all use, preferred syntax and 'must have' features that you use regularly?

I use the aforementioned Kowalski assembler, which thanks to extensive renovation by forum user 8BIT, supports the 65C816, as well as the NMOS 6502 and the WDC 65C02. It may be worth your while to try out that assembler to get a feel for features that you might wish to provide. Also, the assembler has a good macro language, which I find indispensable in my programming.

An essential feature of any assembler is the ability to generate a listing file during assembly. Here's an excerpt from a listing file as generated by the Kowalski assembler:

Code:
02838  00D08A  A3 05         todget   lda api_xrx,S         ;destination LSW
02839  00D08C  85 52                  sta kernptr1          ;set pointer LSW
02840  00D08E  A3 03                  lda api_yrx,S         ;destination MSW
02841  00D090  85 54                  sta kernptr2          ;set pointer MSW
02842  00D092  E2 30                  sep #m_setr
02843  00D094  A9 40                  lda #%01000000        ;suspend...
02844  00D096  04 0F                  tsb tdflag            ;shadow updates
02845  00D098  C2 20                  rep #m_seta
02846  00D09A  A0 04                  ldy #s_time_t-s_word
02847  ;
02848  00D09C  BD 16 01      .0000010 lda uxtimesr,x        ;get date & time &...
02849  00D09F  97 52                  sta [kernptr1],y      ;save it
02850           .rept s_word
02851  00D0A1  88                     dey
02852  00D0A2  88                     dey
02853  00D0A3  10 F7                  bpl .0000010
02854  ;
02855  00D0A5  E2 20         gettmcom sep #m_seta
02856  00D0A7  A9 40                  lda #%01000000        ;resume...
02857  00D0A9  14 0F                  trb tdflag            ;updates
02858  00D0AB  18                     clc                   ;no error
02859  00D0AC  60                     rts

The left-most numbers are line numbers. As this assembly was of 65C816 source code, addresses are 24-bit expressions. The .rept s_word pseudo-op repeats a code section s_word times (s_word is defined as 2). This listing style is informative and helps in debugging code.

Food for thought, I hope.[/color]


The assembler does produce listings (though the line numbers are implicit), and is designed to cope with 'code generating' constructs, such as macros and repeat functions. I'm not expecting to replace 'power users' assemblers of choice (not least because they'll usually be run from the command line as part of a build script), but want to make sure that it's possible to open up a browser and try out code without having to jump through too many hoops and understand the subtleties of obscure syntaxes.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 26, 2021 8:21 pm 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
Druzyek wrote:
...then switched away from Macroassembler AS when I ran into the 256 byte limit of strings generated in macros.

Did you ask on the mailing list if you could get this limit raised? I've found the author to be pretty responsive to things like this.

BigDumbDinosaur wrote:
An essential feature of any assembler is the ability to generate a listing file during assembly.

Right. I'd forgotten to mention anything about output files. Another thing I require is that the assembler generate a machine-readable symbol table so I can use the symbols in unit tests. (Developers without a unit test framework are highly likely to be using a debugger, in which case they too will find it convenient to be able to load symbols.)

(I should mention, though, that I'm just throwing these out as ideas. Not only do I need support for a dozen or so different assembly languages that I currently use and intend to use from time to time, but IDEs and other visual things generally don't work for me because they're usually very hard to integrate into a large, sophisticated build system. Consider, for example, as part of the build process calling external tools to build a disk image, booting that image up in an emulator and also finding the USB device that connects to real hardware and sending it down that as well if the software on the other end is responding appropriately to indicate it can receive and boot the image. But I now notice you've posted a message since I started saying that you're not aiming at this kind of thing.)

GARTHWILSON wrote:
It's good to have COMMENT...END_COMMENT directives so you can have a paragraph of description, and if you want to add or delete something and it changes the line lengths, you don't have to adjust them all by hand again as you would with semicolons.

Actually a lot of people have editors (e.g., Vim or Emacs) or external reformatting tools (such as `par`) that deal with that just fine; they'll even deal with things like hanging indents in bullet lists in comment blocks where each line starts with a comment character. If your editor can send buffer text to an external program and replace what was sent with the result, you may want to look at reformatting programs that can help you with this.

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


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 26, 2021 8:29 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
cjs wrote:
GARTHWILSON wrote:
It's good to have COMMENT...END_COMMENT directives so you can have a paragraph of description, and if you want to add or delete something and it changes the line lengths, you don't have to adjust them all by hand again as you would with semicolons.

Actually a lot of people have editors (e.g., Vim or Emacs) or external reformatting tools (such as `par`) that deal with that just fine; they'll even deal with things like hanging indents in bullet lists in comment blocks where each line starts with a comment character. If your editor can send buffer text to an external program and replace what was sent with the result, you may want to look at reformatting programs that can help you with this.

The MultiEdit editor I use now does allow fixing up the paragraph with your chosen margins, but some don't. It's nice to get rid of the semicolons 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.  You DEX twice before writing the first stack cell, so S0adr isn't
      used by stack.  X holds the actual ZP address of the top stack cell.  Top of
      both stacks is the stack cell closest to address 0.  Altho' the '816 can have
      the direct page anywhere in bank 0, it runs fastest if we leave the direct
      page on a page boundary, so we might as well leave it at ZP just like w/ 6502.
  END_COMMENT

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 26, 2021 9:29 pm 
Offline
User avatar

Joined: Mon May 12, 2014 6:18 pm
Posts: 365
Quote:
I'm not expecting to replace 'power users' assemblers of choice (not least because they'll usually be run from the command line as part of a build script), but want to make sure that it's possible to open up a browser and try out code without having to jump through too many hoops and understand the subtleties of obscure syntaxes.
That sounds like a pretty good goal. One idea would be to look at the macro systems in other assemblers and settle on implementing just the pieces you like. The x86 assembler NASM has a pretty good macro system you may want to check out. I think it would be one of the easier systems to implement also.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 26, 2021 9:30 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8504
Location: Midwestern USA
GARTHWILSON wrote:
It's good to have COMMENT...END_COMMENT directives so you can have a paragraph of description, and if you want to add or delete something and it changes the line lengths, you don't have to adjust them all by hand again as you would with semicolons.

Yes, that would be a very useful feature in any assembler. In some of my source code, I have written several paragraphs of commentary discussing how a particular function is carrying out its work, what it expects as input and what it emits as output. The below example would have greatly benefited from the COMMENT feature.

Code:
;mktime: CONVERT LOCAL BROKEN-DOWN TIME TO CALENDAR TIME
;
;   ————————————————————————————————————————————————————————————————————————
;   Calling syntax: per altzone   ;pointer to daylight saving time zone data
;                   per timezone  ;pointer to standard time zone data
;                   per time      ;pointer to calendar time field (2)
;                   per tm        ;pointer to broken-down time structure (1)
;                   jsr mktime
;
;   Exit registers: .A: entry value
;                   .B: entry value
;                   .X: entry value
;                   .Y: entry value
;                   DB: entry value
;                   DP: entry value
;                   PB: entry value
;                   SR: NVmxDIZC
;                       ||||||||
;                       |||||||+———> 0: okay
;                       |||||||      1: conversion error
;                       +++++++————> entry value
;
;   Notes: 1) tm must point to a broken-down date & time structure of type
;             tm, in which fields are as follows:
;
;                 Offset  Field     Description
;                 ——————————————————————————————
;                   $00   tm_sec    seconds
;                   $02   tm_min    minutes
;                   $04   tm_hour   hour
;                   $06   tm_mday   day-of-month
;                   $08   tm_mon    month
;                   $0A   tm_year   year
;                   $0C   tm_wday   day-of-week¹
;                   $0E   tm_yday   day-of-year¹
;                   $10   tm_isdst  DST flag
;                 ——————————————————————————————
;                 ¹Input values are ignored & will be replaced
;                  by data computed from the input date.
;
;             All fields are of size s_int.  Refer to the tm structure def-
;             inition in include/calendrics/tm.asm.
;
;          2) The value returned in time is the number of seconds that have
;             elapsed since the "epoch" (discussed below).  time must be of
;             size s_time_t, which is defined in include/calendrics/tm.asm.
;
;          3) time is assumed to be UTC, not local time.  See below informa-
;             tion for more details.
;
;          4) This function does not verify that the data in tm are valid.
;             An error exit will occur if an intermediate computation causes
;             an over- or underflow, or attempts division by zero.  Nonsens-
;             ical dates, such as Feb 30, or times, such as 61 minutes, may
;             produce unexpected results.
;   —-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-
;   mktime converts the broken-down time in the structure tm into the number
;   of seconds that have elapsed since the "epoch," which is defined as Sun-
;   day, October 1, 00:00:00 UTC, 1752.  The conversion is accurate for all
;   dates prior to January 1, 10000.

   ...etc...

Tuna wrote:
Unfortunately both Safari and Firefox are somewhat behind the curve at the moment...

Behind whose curve?

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


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 26, 2021 9:33 pm 
Offline

Joined: Mon Aug 23, 2021 9:01 pm
Posts: 10
GARTHWILSON wrote:
Hopefully it will keep doing passes until all the phase errors are taken care of. Normally two is enough; but I had a situation about 20 years ago where a chain of forward references required dozens of passes. Today's PCs are fast enough that it's not a problem.

It keeps on running passes until the code is stable, yes, though there is a limit to prevent bistable loops running forever.

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

GARTHWILSON wrote:
I'd suggest not requiring labels to start on the margin. Editors with a "condense" mode show, in that mode, only the lines that start with something on the margin, meaning you can make labels of only local interest not show in that mode. If the label is followed by a colon, it also makes it easier to find, as otherwise doing a search for the label may turn up a lot of references to the label before you find the label itself.

Labels don't have to start on the margin, and can end in ':'

GARTHWILSON wrote:
Quote:
Comments start with ;

Yes; but please don't require blank lines to start with a ; as it makes the code look messier. It's good to have COMMENT...END_COMMENT directives so you can have a paragraph of description, and if you want to add or delete something and it changes the line lengths, you don't have to adjust them all by hand again as you would with semicolons.

Blank lines can be blank, comments can start at any location. I can certainly add COMMENT..END_COMMENT, or C-style /** ...*/

GARTHWILSON wrote:
Quote:
I've not (yet) included macro or conditional assembly directives, but would be interested to know which assemblers you all use, preferred syntax and 'must have' features that you use regularly?

The two commercial assemblers I've used for 65xx are 2500AD and Cross-32 (C32 for short), both excellent macro assemblers. I like that C32 doesn't require dots in front of directives. I like that 2500AD allowed different numbers of macro input parameters, and then you could say in essence, "If there's a fourth parameter, do this with it;" and "If there's a fifth one, do the following;". Macros should be nestable, meaning one macro definition can invoke other macros, which in some cases can really shorten the definition.

I've made program flow-control macros which I show in that section of my website, and the assemblers I did it with did not allow assembler variable arrays, so I had to jurry-rig them, to make the structures nestable. It worked fine, but it's definitely not optimum. What I mean by assembler variable arrays is like EQUates that can be changed as many times as you want—C32 uses the SETL ("SET Label value") directive—but that you can go beyond individual equates and have arrays of them, and index into the arrays.

It is designed to support nestable contexts (ie macros in macros).

A syntax I've seen in other assemblers is that EQUates are constant, but values defined with SET can be redefined at any point by another SET.

I've not looked at a syntax for variables with an array type in an assembler - by that point, I'd usually be switching to C. There's no reason it couldn't be included though if there's a consistent standard.

GARTHWILSON wrote:
If you do everything everyone wants, it can become pretty daunting; so just take the suggestions into account and then do whatever you want or can.

Don't worry - it's a free tool amongst many other free tools, I'm not too worried about pleasing everyone. If your assembler suits your needs, then you have absolutely no incentive to switch.

On the other hand, if you share code and other people want to try it out it's a barrier if they can only assemble it by exactly replicating your tool chain - especially if it only works on a specific platform. My goal is to end up with a tool chain that can be run under a reasonably broad range of browsers (and possibly on the command line with Node), needs no additional installations and can cope with a fair variety of source code.

I appreciate that some people object to Chrome-compatible browsers, but these days Javascript is probably the easiest and most robust way to distribute a cross-platform tool, and once the code base is sufficiently stable ensuring it works with Firefox isn't too much of a challenge.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 26, 2021 9:45 pm 
Offline

Joined: Mon Aug 23, 2021 9:01 pm
Posts: 10
BigDumbDinosaur wrote:
Tuna wrote:
Unfortunately both Safari and Firefox are somewhat behind the curve at the moment...

Behind whose curve?[/color]


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.

Apple have a pretty slow release schedule, and Firefox is underfunded, so their developers are unable to deliver the consistency of the Javascript integration in Blink based browsers (i.e. Chrome, Edge, Opera).

Note that Chromium itself is free and open source - if you object to tracking and advertisements in browsers, Brave (https://brave.com) uses the Chromium engine to deliver a compatible browser free of corporate links.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 26, 2021 9:48 pm 
Offline

Joined: Mon Aug 23, 2021 9:01 pm
Posts: 10
Druzyek wrote:
That sounds like a pretty good goal. One idea would be to look at the macro systems in other assemblers and settle on implementing just the pieces you like. The x86 assembler NASM has a pretty good macro system you may want to check out. I think it would be one of the easier systems to implement also.


Perfect, thanks for the recommendation.


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

Joined: Thu May 28, 2009 9:46 pm
Posts: 8504
Location: Midwestern USA
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.

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


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 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: