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 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 πŸ’–πŸ«Ά