Hacker News new | past | comments | ask | show | jobs | submit login

Well, C still doesn't offer the same macro capabilities as 90's macro assemblers were capable of.

Thankfully in C++ we have constexpr for that.




Can you elaborate which capabilities to those of us interested to know?


Yes, here is the manual for MASM.

https://docs.microsoft.com/en-us/cpp/assembler/masm/directiv...

Basically already back in the Amiga/MS-DOS days, you could define:

- procedures and functions like higher level languages

- structures

- make use of looping constructs (repeat/while) and conditional logic (if/else)

- create hygienic labels for variables and jump targets

TASM and the FOSS clones, yasm and fasm do support similar macro capabilities.

On the Amiga side, Devpac was the goto Macro Assembler,

https://www.amigagamedev.com/Downloads/DevPac_v3.00.Manual.p...

Only the UNIX Assemblers have been traditionally quite poor in macro capabilities, as they have been mostly used as yet another stage for generating code from C compilers.

A good example how to take advantage of such macros is to implement a poor man's compiler, or the first stage of a bootstraped compiler.

Generate bytecodes that can be easily mapped into macros, and then just by having your macro library for the target platform you get the compiler very quickly up and running.


In the Amiga demo scene, I would dare say that ASM-One [1] was the default assembler.

[1] https://en.m.wikipedia.org/wiki/ASM-One_Macro_Assembler


AsmTwo[0] is a decent currently maintained fork of that.

[0]: http://coppershade.org/articles/Code/Tools/AsmTwo/


I was into portuguese demoscene Amiga/PC and never heard of it, then again it was back in the days when we exchanged floppies via the post.


> Thankfully in C++ we have constexpr for that.

The only C++ feature I'm thankful for is the option of not using it


I on the other hand appreciate that since 1993, C++ has allowed me avoid C as much as possible.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: