boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

00-hello.M1 (598B)


      1 ## P1 hello-world smoke fixture.
      2 ##
      3 ## Exercises the build pipeline (lint -> prune -> catm -> M0 -> ELF link ->
      4 ## hex2-0) against build/p1/aarch64/p1_aarch64.M1. Standalone program —
      5 ## does not drive the m1pp expander.
      6 ##
      7 ## P1 syscall ABI:
      8 ##   a0 = syscall number on entry, return value on exit
      9 ##   a1, a2, a3, t0, s0, s1 = syscall arguments 0..5
     10 
     11 :p1_main
     12     ## write(fd=1, buf=&msg, count=14)
     13     li_a0 sys_write
     14     li_a1 %1 %0
     15     la_a2 &msg
     16     li_a3 %14 %0
     17     syscall
     18 
     19     ## return 0 (backend :_start stub sys_exits with a0)
     20     li_a0 %0 %0
     21     ret
     22 
     23 :msg
     24 "Hello, World!
     25 "
     26 
     27 :ELF_end