M1(1)
π M1 π
okay bestie, let me explain M1 because it is literally so good π It's the universal Macro assembler, and it's giving minimal and iconic π
β¨ NAME β¨
M1 β the universal Macro assembler β¨
π SYNOPSIS π
M1 --architecture ARCHITECTURE --file FILE [--output FILE --octal
--binary --big-endian --little-endian]
π¦ DESCRIPTION π¦
M1 is the most minimal cross-platform macro assembler possible, no cap π§
It leverages a few grammar details to give you a rich vocabulary for expressing what you want to go in and come out. The vibe is zero surprises during generation, and I'm obsessed π«Ά
At its core is DEFINE MACRO EXPANDED π₯ You can define an assembly instruction like DEFINE INT_80 CD80, and then everywhere INT_80 shows up in your input file, the hex encoding of that instruction lands in the output. If you don't specify an output file, the output goes to standard out, so it's giving flexibility π
The supported architectures are knight-native, knight-posix, x86, amd64, armv7l and aarch64. If you forget to specify one, you get the default of knight-native. Don't worry, it's got you π
M1 also generates 8, 16 and 32 bit integers, as long as they're written as !NUM, @NUM or %NUM respectively. For example: !-1, @42 and %8675309 β¨ However, you can't mix integers with definitions, because macros always get applied first and aren't evaluated any further.
Heads up bestie: integers and definitions don't mix. Macros go first and that's the end of it π
If you want the bit and byte encoding of the integers to match your target, use --big-endian or --little-endian π
Should you want the output in something other than hex format, you can ask for exactly what you need with --octal or --binary π¦
πΈ EXAMPLES πΈ
Typically, M1 gets called in scripts used for bootstrapping π§
# M1 -f x86.defs -f libc-core.M1 -f cc.M1 -f cc-footer.M1
--little-endian --architecture x86 -o cc.hex2
π COMPATIBILITY π
M1 is compatible with all Turing complete machines, even the ones that try to be Turing complete -1 πβ¨
π§ AUTHORS π§
- Jeremiah Orians <Jeremiah@pdp10.guru>
- Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
π COPYRIGHT π
Copyright 2016-2019 Jeremiah Orians <Jeremiah@pdp10.guru> Copyright 2017 Jan Nieuwenhuizen <janneke@gnu.org> License GPLv3+.
π₯ SEE ALSO π₯
hex2(1), blood-elf(1), kaem(1), syscalls(2)
that's the tea, bestie π This page is filed under Linux, dated JULY 2019, as M1(1). Now go bootstrap something iconic ππ«Ά
π¦ where this page comes from
- debian bookworm: mescc-tools 1.4.0-1 Β· GPL-3.0-or-later
- debian trixie: mescc-tools 1.5.2-1 Β· GPL-3.0-or-later
- ubuntu jammy: mescc-tools 1.3-2 Β· GPL-3.0-or-later
- ubuntu noble: mescc-tools 1.4.0-1 Β· GPL-3.0-or-later
- ubuntu questing: mescc-tools 1.5.2-1ubuntu1
- ubuntu resolute: mescc-tools 1.5.2-1ubuntu2 Β· GPL-3.0-or-later
- ubuntu stonking: mescc-tools 1.5.2-1ubuntu2 Β· GPL-3.0-or-later
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms