Live data from Hacker News

Show HN: Torque – A lightweight meta-assembler for any processor

benbridle.com

11–20 of 33 posts

Re: Show HN: Torque – A lightweight meta-assembler for any processor

#12
Reminds me of TDASM from the turn of the century: https://web.archive.org/web/20230906054935/http://www.pengui...

I remember there were a few other meta-assemblers I came across in the 80s-90s, so this is definitely not "unchartered territory", but it's good to see another one show up.

Of course, in the other direction there are meta-disassemblers used for analysis in tools like Ghidra.

Re: Show HN: Torque – A lightweight meta-assembler for any processor

#14
post #13

Need to address this point: "Assemblers tend to be poorly documented" I wish everything in programming was as good documented as assemblers and ISAs.

I should clarify, I was thinking of microcontroller toolchains when I wrote this. The documentation I've seen for Intel processors is solid.

Re: Show HN: Torque – A lightweight meta-assembler for any processor

#15
post #13

Need to address this point: "Assemblers tend to be poorly documented" I wish everything in programming was as good documented as assemblers and ISAs.

I should clarify, I was thinking of microcontroller toolchains when I wrote this. The documentation I've seen for Intel processors is solid.

Not to mention ARM64...

And 6502 ;-) (and probably most of the ancient ones)

Re: Show HN: Torque – A lightweight meta-assembler for any processor

#16

Very cool and I like the idea of a "meta-assembler." The most-recent version of flatassembler (fasm 2) is built with fasmg which is also a "meta-assembler" of sorts, in that it also doesn't directly support a specific instruction set and instead is a very powerful macro assembler. I'm keen to check out functionality overlaps between the two implementations. https://board.flatassembler.net/topic.php?t=19389 https://fl…

Oh neat! Thanks for the link, I hadn't heard of fasmg before. It looks like fasmg builds up from the byte level, so it would only work for architectures that use 8-bit words. Torque builds up from the bit level, so it can assemble code for architectures like in PIC microcontrollers, using word sizes of 12 or 14 bits. However, fasmg does allow a lot more control over the syntax of the language. The documentation shows…

I reached out to the author of fasmg WRT your post and circular dependency interest and he pointed me toward two posts that he wrote very specifically to explain what he believes is unique to fasm/fasmg and allows to handle circular dependencies of many kinds. [0] Types of multi-pass assembly, and [1] related pitfalls.

[0] https://board.flatassembler.net/topic.php?t=20249

[1] https://board.flatassembler.net/topic.php?t=21060

Re: Show HN: Torque – A lightweight meta-assembler for any processor

#17

Earlier quoted context omitted.

Oh neat! Thanks for the link, I hadn't heard of fasmg before. It looks like fasmg builds up from the byte level, so it would only work for architectures that use 8-bit words. Torque builds up from the bit level, so it can assemble code for architectures like in PIC microcontrollers, using word sizes of 12 or 14 bits. However, fasmg does allow a lot more control over the syntax of the language. The documentation shows…

I reached out to the author of fasmg WRT your post and circular dependency interest and he pointed me toward two posts that he wrote very specifically to explain what he believes is unique to fasm/fasmg and allows to handle circular dependencies of many kinds. [0] Types of multi-pass assembly, and [1] related pitfalls. [0] https://board.flatassembler.net/topic.php?t=20249 [1] https://board.flatassembler.net/topic.php…

Thank you so much! It looks like the issue I described is what he calls the 'oscillator problem' [0]. This is an absolute goldmine, I'm going to be reading for days.

[0] https://board.flatassembler.net/topic.php?p=178828#178828

Re: Show HN: Torque – A lightweight meta-assembler for any processor

#18
At first I thought it was useless: "but each ISA will still end up having different effective syntax because the underlying macro systems will not be designed the same".

But then I reread it and realised I was not paying attention to the usecase. It's about making it easy to write assemblers. So this isn't for your Arms and RISC-Vs it's for your random niche microcontrollers where the vendor-provided toolchain kinda sucks.

Seems cool!

I've experienced a couple of under-documented assemblers in my time. In neither case did this turn out to be that much of a problem in practice, but I guess I just don't write that much assembly.

Re: Show HN: Torque – A lightweight meta-assembler for any processor

#19

Very cool and I like the idea of a "meta-assembler." The most-recent version of flatassembler (fasm 2) is built with fasmg which is also a "meta-assembler" of sorts, in that it also doesn't directly support a specific instruction set and instead is a very powerful macro assembler. I'm keen to check out functionality overlaps between the two implementations. https://board.flatassembler.net/topic.php?t=19389 https://fl…

Oh neat! Thanks for the link, I hadn't heard of fasmg before. It looks like fasmg builds up from the byte level, so it would only work for architectures that use 8-bit words. Torque builds up from the bit level, so it can assemble code for architectures like in PIC microcontrollers, using word sizes of 12 or 14 bits. However, fasmg does allow a lot more control over the syntax of the language. The documentation shows…

Tomasz (of fasmg) added "one more quick thought" re: 8-bit word not being a limitation, he said that since fasm1 had macros for LZW compression [0] (from the assembler alone) and that this is even easier with fasmg the word length isn't a restricting factor with his design either. Cheers and thanks for sharing.

[0] https://board.flatassembler.net/topic.php?t=14612

Re: Show HN: Torque – A lightweight meta-assembler for any processor

#20
I'm reminded of a 2016 [talk][1] where Rob Pike describes the common-denominator assembly language that the Go compiler generates. Then that assembly is translated into machine-specific code via table lookups. See the 11 minute mark.

[1]: https://www.youtube.com/watch?v=KINIAgRpkDA

Post reply on HN