{"size": 1248, "ext": "scrbl", "max_stars_repo_path": "cpsc411-doc/cpsc411/scribblings/ptr-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/ptr-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/ptr-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": 27.7333333333, "max_line_length": 79, "alphanum_fraction": 0.7483974359}
#lang scribble/manual

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

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

@title{Ptr Run-Time System}

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

This library provides the run-time system for supporting the CPSC 411 languages
that can print ptr-encoded data.

@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 the final return value, which must be a ptr encoded
data type, to the standard output port, as an ASCII string.

Currently only supports Linux and macOS.
@examples[#:eval eg
(require racket/pretty)
(pretty-display (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}.

Currently only supports Linux and macOS.

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