M2-Planet.1 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. .\"Made with Love
  2. .TH M2-Planet 1 "JULY 2019" Linux "User Manuals"
  3. .SH NAME
  4. M2-Planet \- The PLAtform NEutral Transpiler (Or just terrible C compiler)
  5. .SH SYNOPSIS
  6. .na
  7. M2-Planet --architecture ARCHITECTURE --file FILE [--output FILE] [--debug]
  8. .SH DESCRIPTION
  9. M2 is the most minimal C compiler that can be bootstrapped from Hex
  10. .br
  11. At it's core is the minimal subset of the C language required
  12. to make a more powerful C compiler. (with a few extras for convience)
  13. .br
  14. Those core primitives being: if (with continue), while (with
  15. break), asm, structs (with -> support) gotos (with labels) and return.
  16. With do and for loops, arrays and function pointers as nice extras
  17. .br
  18. The supported ARCHITECTURES are as follows: knight-native,
  19. knight-posix, x86, amd64, armv7l, aarch64.
  20. (with planned ports to z80 and 6502)
  21. If you fail to specify an architecture, the default of knight-native
  22. will be used.
  23. .br
  24. As M2-Planet's libc is literally only a half-dozen lines of assembly
  25. you will likely need to import libc primitives when building or
  26. having previously built them seperately.
  27. You can find examples for such primitives in:
  28. test/common_x86/functions/
  29. test/common_amd64/functions/
  30. test/common_armv7l/functions/
  31. test/common_aarch64/functions/
  32. test/common_knight/functions/
  33. with the default libc implementations and elf-headers in the
  34. parent directories correspondingly.
  35. .br
  36. .SH EXAMPLES
  37. Typically, M2-Planet will be called in scripts used in bootstrapping
  38. .br
  39. # M2-Planet --architecture x86 -f return.c -o return.M1
  40. .br
  41. Then to convert the assembled output into a working binary,
  42. M1 and hex2 are used to convert the assembly output of M2-Planet;
  43. with blood-elf generating dwarf stubs if additional debug info is
  44. desired.
  45. .br
  46. # M1 -f test/common_x86/x86_defs.M1 -f test/common_x86/libc-core.M1 \
  47. -f return.M1 --LittleEndian --architecture x86 -o return.hex2
  48. # hex2 -f test/common_x86/ELF-i386.hex2 -f return.hex2 --LittleEndian \
  49. --architecture x86 --BaseAddress 0x8048000 -o example --exec_enable
  50. .br
  51. .SH COMPATIBILITY
  52. M2-Planet is compatible with all Turing complete machines;
  53. even the ones that try to be Turing complete -1
  54. .SH AUTHORS
  55. Jeremiah Orians <Jeremiah@pdp10.guru>
  56. .br
  57. Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  58. .SH COPYRIGHT
  59. Copyright 2016-2019 Jeremiah Orians <Jeremiah@pdp10.guru>
  60. .br
  61. Copyright 2017 Jan Nieuwenhuizen <janneke@gnu.org>
  62. .br
  63. License GPLv3+.
  64. .SH "SEE ALSO"
  65. M1(1), hex2(1), blood-elf(1), kaem(1), syscalls(2)