boot2

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

033-bv-copy-bang.scm (391B)


      1 ; 5-arg bytevector-copy! — writes src[start..end) into dst at dst-start.
      2 (define dst (make-bytevector 5 0))
      3 (define src (make-bytevector 5 9))
      4 (bytevector-u8-set! src 1 1)
      5 (bytevector-u8-set! src 2 2)
      6 (bytevector-u8-set! src 3 3)
      7 (bytevector-copy! dst 0 src 1 4)
      8 (sys-exit (+ (bytevector-u8-ref dst 0)
      9              (+ (bytevector-u8-ref dst 1)
     10                 (bytevector-u8-ref dst 2))))