Remix.run Logo
▲ raphlinus 5 hours ago

My symbolasm project[1] is exactly that: an assembler syntax designed to make programming more mentally tractable. I expect it to help for both human and LLM coders. Apologies for the spare repo, I haven't written good readmes yet.

In this syntax (though I'm not yet targeting x86_64) it would look something like a = round(fma(a, b, c)) where the variables have the appropriate vector type (and have been placed into registers with @zmm1 syntax when first assigned).

The design of the language is entirely by hand, as was the implementation when I started, but lately I have been using AI to speed implementation.

[1] https://github.com/raphlinus/symbolasm

▲Lerc 2 hours ago | parent | next [-]

When I made an AVR assembler, I had a play around with a few ideas.

My changes were less to do with instruction representation, and more related to macros and reusable code.

https://github.com/Lerc/AvrAsm

One example of some of the bits I added, is the macros at

https://gist.github.com/Lerc/ad96329670965dc023c5ae740b433ad...

This provides a blend of macros and snips to allow

    init:
      set_stack_pointer RAMEND
      load_let_values
      call Someroutine

    ...
    ...
    ...

    Someroutine:
      letb bits_x,62
      letb bits_y,56

      lds r16,bits_x
      lds r17,bits_y
    Etc.
So the letb macro puts the constant parameter into ROM and assigns a RAM symbol for the variable. The load_let_values macro copies the ROM values into the RAM locations (essentially dropping some of requirements for sections)

The load_let_values macro manages to copy values that are defined later in the program.

I'm not sure if this is a wise use of this feature, but it was a good tricky task to attempt to implement with it.

▲kibwen 4 hours ago | parent | prev [-]

Happy to see more people thinking about this, there's really no good reason for ASM syntax to be so dreadfully primitive and inaccessible to this day. Even something as trivially simple as namespacing instructions to indicate CPU extensions would be a welcome improvement.