{"size": 1486, "ext": "scrbl", "max_stars_repo_path": "cpsc411-doc/cpsc411/scribblings/2c-run-time.scrbl", "max_stars_repo_name": "cpsc411/cpsc411-pub", "max_stars_repo_stars_event_min_datetime": "2021-03-25T21:32:20.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-02T10:52:41.000Z", "max_issues_repo_path": "cpsc411-doc/cpsc411/scribblings/2c-run-time.scrbl", "max_issues_repo_name": "cpsc411/cpsc411-pub", "max_issues_repo_issues_event_min_datetime": "2021-01-21T09:18:04.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-29T19:56:07.000Z", "max_forks_repo_path": "cpsc411-doc/cpsc411/scribblings/2c-run-time.scrbl", "max_forks_repo_name": "cpsc411/cpsc411-pub", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": 15, "max_forks_count": null, "avg_line_length": 29.137254902, "max_line_length": 80, "alphanum_fraction": 0.7590847914}
#lang scribble/manual

@(require
  scribble/example
  (for-label
   cpsc411/2c-run-time
   racket/pretty
   (except-in racket/base compile)))

@(define eg (make-base-eval '(require cpsc411/2c-run-time)))

@title{2c Run-Time System}

@author[@author+email["William J. Bowman" "wjb@williamjbowman.com"]]
@defmodule[cpsc411/2c-run-time]

This library provides the run-time system for supporting the CPSC 411 languages
that can only produce two's complement integers.

@defproc[(wrap-x64-run-time (v string?)) string?]{
Wraps @racket[v], a string representing a sequence of x64 instructions in Intel
syntax, with the CPSC 411 run-time system.

This run-time system prints a two's complement integer to the standard output
port, as an ASCII string.

Implementation detail: currently, does nothing, as @racket[wrap-x64-boilerplate]
actually installs the run-time system, so this function cannot be used on its
own; @racket[wrap-x64-boilerplate] must be called immediately after.

Currently only supports Linux and macOS.

@examples[#:eval eg
(wrap-x64-run-time "mov rax, 5")
]
}

@defproc[(wrap-x64-boilerplate (e string?)) string?]{
Wraps @racket[e], a string representing a sequence of x64 instructions in Intel
syntax, with necessary boilerplate to compile via @tt{nasm}.

Implementation detail: currently, installs the run-time system as well.

Currently only supports Linux and macOS.

@examples[#:eval eg
(require racket/pretty)
(pretty-display (wrap-x64-boilerplate "mov rax, 5"))
]
}
