This commit is contained in:
Kartik Agaram 2020-12-30 09:37:50 -08:00
parent d0bc0d2673
commit 762107fdc2
188 changed files with 188 additions and 188 deletions

View File

@ -54,7 +54,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/000organization.cc'>https://github.com/akkartik/mu/blob/master/000organization.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/000organization.cc'>https://github.com/akkartik/mu/blob/main/000organization.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: You guessed right: the '000' prefix means you should start reading here.</span>
<span id="L2" class="LineNr"> 2 </span><span class="Comment">//:</span>

2
html/001help.cc.html generated
View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/001help.cc'>https://github.com/akkartik/mu/blob/master/001help.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/001help.cc'>https://github.com/akkartik/mu/blob/main/001help.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: Everything this project/binary supports.</span>
<span id="L2" class="LineNr"> 2 </span><span class="Comment">//: This should give you a sense for what to look forward to in later layers.</span>

2
html/002test.cc.html generated
View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/002test.cc'>https://github.com/akkartik/mu/blob/master/002test.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/002test.cc'>https://github.com/akkartik/mu/blob/main/002test.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: A simple test harness. To create new tests, define functions starting with</span>
<span id="L2" class="LineNr"> 2 </span><span class="Comment">//: 'test_'. To run all tests so defined, run:</span>

2
html/003trace.cc.html generated
View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/003trace.cc'>https://github.com/akkartik/mu/blob/master/003trace.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/003trace.cc'>https://github.com/akkartik/mu/blob/main/003trace.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: The goal of layers is to make programs more easy to understand and more</span>
<span id="L2" class="LineNr"> 2 </span><span class="Comment">//: malleable, easy to rewrite in radical ways without accidentally breaking</span>

View File

@ -52,7 +52,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/003trace.test.cc'>https://github.com/akkartik/mu/blob/master/003trace.test.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/003trace.test.cc'>https://github.com/akkartik/mu/blob/main/003trace.test.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Normal">void</span> <a href='003trace.test.cc.html#L1'>test_trace_check_compares</a><span class="Delimiter">()</span> <span class="Delimiter">{</span>
<span id="L2" class="LineNr"> 2 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span><span class="Constant">&quot;test layer&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo&quot;</span> &lt;&lt; end<span class="Delimiter">();</span>

2
html/010vm.cc.html generated
View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/010vm.cc'>https://github.com/akkartik/mu/blob/master/010vm.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/010vm.cc'>https://github.com/akkartik/mu/blob/main/010vm.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: Core data structures for simulating the SubX VM (subset of an x86 processor),</span>
<span id="L2" class="LineNr"> 2 </span><span class="Comment">//: either in tests or debug aids.</span>

2
html/011run.cc.html generated
View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/011run.cc'>https://github.com/akkartik/mu/blob/master/011run.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/011run.cc'>https://github.com/akkartik/mu/blob/main/011run.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: Running SubX programs on the VM.</span>
<span id="L2" class="LineNr"> 2 </span>

2
html/012elf.cc.html generated
View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/012elf.cc'>https://github.com/akkartik/mu/blob/master/012elf.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/012elf.cc'>https://github.com/akkartik/mu/blob/main/012elf.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: Loading SubX programs from ELF binaries.</span>
<span id="L2" class="LineNr"> 2 </span><span class="Comment">//: This will allow us to run them natively on a Linux kernel.</span>

View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/013direct_addressing.cc'>https://github.com/akkartik/mu/blob/master/013direct_addressing.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/013direct_addressing.cc'>https://github.com/akkartik/mu/blob/main/013direct_addressing.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: operating directly on a register</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/014indirect_addressing.cc'>https://github.com/akkartik/mu/blob/master/014indirect_addressing.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/014indirect_addressing.cc'>https://github.com/akkartik/mu/blob/main/014indirect_addressing.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: operating on memory at the address provided by some register</span>
<span id="L2" class="LineNr"> 2 </span><span class="Comment">//: we'll now start providing data in a separate segment</span>

View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/015immediate_addressing.cc'>https://github.com/akkartik/mu/blob/master/015immediate_addressing.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/015immediate_addressing.cc'>https://github.com/akkartik/mu/blob/main/015immediate_addressing.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: instructions that (immediately) contain an argument to act with</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -54,7 +54,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/016index_addressing.cc'>https://github.com/akkartik/mu/blob/master/016index_addressing.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/016index_addressing.cc'>https://github.com/akkartik/mu/blob/main/016index_addressing.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: operating on memory at the address provided by some register plus optional scale and offset</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/017jump_disp8.cc'>https://github.com/akkartik/mu/blob/master/017jump_disp8.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/017jump_disp8.cc'>https://github.com/akkartik/mu/blob/main/017jump_disp8.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: jump to 8-bit offset</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/018jump_disp32.cc'>https://github.com/akkartik/mu/blob/master/018jump_disp32.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/018jump_disp32.cc'>https://github.com/akkartik/mu/blob/main/018jump_disp32.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: jump to 32-bit offset</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/019functions.cc'>https://github.com/akkartik/mu/blob/master/019functions.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/019functions.cc'>https://github.com/akkartik/mu/blob/main/019functions.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="SalientComment">//:: call</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/020syscalls.cc'>https://github.com/akkartik/mu/blob/master/020syscalls.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/020syscalls.cc'>https://github.com/akkartik/mu/blob/main/020syscalls.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Delimiter">:(before &quot;End Initialize Op Names&quot;)</span>
<span id="L2" class="LineNr"> 2 </span><a href='001help.cc.html#L235'>put_new</a><span class="Delimiter">(</span><span class="SpecialChar"><a href='010vm.cc.html#L355'>Name</a></span><span class="Delimiter">,</span> <span class="Constant">&quot;cd&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;software interrupt (int)&quot;</span><span class="Delimiter">);</span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/021byte_addressing.cc'>https://github.com/akkartik/mu/blob/master/021byte_addressing.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/021byte_addressing.cc'>https://github.com/akkartik/mu/blob/main/021byte_addressing.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: SubX mostly deals with instructions operating on 32-bit operands, but we</span>
<span id="L2" class="LineNr"> 2 </span><span class="Comment">//: still need to deal with raw bytes for strings and so on.</span>

2
html/022div.cc.html generated
View File

@ -54,7 +54,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/022div.cc'>https://github.com/akkartik/mu/blob/master/022div.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/022div.cc'>https://github.com/akkartik/mu/blob/main/022div.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: helper for division operations: sign-extend EAX into EDX</span>
<span id="L2" class="LineNr"> 2 </span>

2
html/023float.cc.html generated
View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/023float.cc'>https://github.com/akkartik/mu/blob/master/023float.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/023float.cc'>https://github.com/akkartik/mu/blob/main/023float.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: floating-point operations</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/030translate.cc'>https://github.com/akkartik/mu/blob/master/030translate.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/030translate.cc'>https://github.com/akkartik/mu/blob/main/030translate.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: After that lengthy prelude to define an x86 emulator, we are now ready to</span>
<span id="L2" class="LineNr"> 2 </span><span class="Comment">//: start translating SubX notation.</span>

View File

@ -53,7 +53,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/031transforms.cc'>https://github.com/akkartik/mu/blob/master/031transforms.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/031transforms.cc'>https://github.com/akkartik/mu/blob/main/031transforms.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Delimiter">:(before &quot;End Types&quot;)</span>
<span id="L2" class="LineNr"> 2 </span><span class="Normal">typedef</span> <span class="Normal">void</span> <span class="Delimiter">(</span>*transform_fn<span class="Delimiter">)(</span>program&amp;<span class="Delimiter">);</span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/032operands.cc'>https://github.com/akkartik/mu/blob/master/032operands.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/032operands.cc'>https://github.com/akkartik/mu/blob/main/032operands.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: Metadata for fields of an x86 instruction.</span>
<span id="L2" class="LineNr"> 2 </span><span class="Comment">//:</span>

View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/033check_operands.cc'>https://github.com/akkartik/mu/blob/master/033check_operands.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/033check_operands.cc'>https://github.com/akkartik/mu/blob/main/033check_operands.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: Since we're tagging arguments with their types, let's start checking these</span>
<span id="L2" class="LineNr"> 2 </span><span class="Comment">//: argument types for each instruction.</span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/034check_operand_bounds.cc'>https://github.com/akkartik/mu/blob/master/034check_operand_bounds.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/034check_operand_bounds.cc'>https://github.com/akkartik/mu/blob/main/034check_operand_bounds.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="SalientComment">//:: Check that the different arguments of an instruction aren't too large for their bitfields.</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -54,7 +54,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/035compute_segment_address.cc'>https://github.com/akkartik/mu/blob/master/035compute_segment_address.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/035compute_segment_address.cc'>https://github.com/akkartik/mu/blob/main/035compute_segment_address.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: ELF binaries have finicky rules about the precise alignment each segment</span>
<span id="L2" class="LineNr"> 2 </span><span class="Comment">//: should start at. They depend on the amount of code in a program.</span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/036labels.cc'>https://github.com/akkartik/mu/blob/master/036labels.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/036labels.cc'>https://github.com/akkartik/mu/blob/main/036labels.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: Labels are defined by ending names with a ':'. This layer will compute</span>
<span id="L2" class="LineNr"> 2 </span><span class="Comment">//: displacements for labels, and compute the offset for instructions using them.</span>

View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/037global_variables.cc'>https://github.com/akkartik/mu/blob/master/037global_variables.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/037global_variables.cc'>https://github.com/akkartik/mu/blob/main/037global_variables.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: Global variables.</span>
<span id="L2" class="LineNr"> 2 </span><span class="Comment">//:</span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/038literal_strings.cc'>https://github.com/akkartik/mu/blob/master/038literal_strings.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/038literal_strings.cc'>https://github.com/akkartik/mu/blob/main/038literal_strings.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: Allow instructions to mention literals directly.</span>
<span id="L2" class="LineNr"> 2 </span><span class="Comment">//:</span>

2
html/039debug.cc.html generated
View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/039debug.cc'>https://github.com/akkartik/mu/blob/master/039debug.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/039debug.cc'>https://github.com/akkartik/mu/blob/main/039debug.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="SalientComment">//:: Some helpers for debugging.</span>
<span id="L2" class="LineNr"> 2 </span>

2
html/040tests.cc.html generated
View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/040tests.cc'>https://github.com/akkartik/mu/blob/master/040tests.cc</a>
<a href='https://github.com/akkartik/mu/blob/main/040tests.cc'>https://github.com/akkartik/mu/blob/main/040tests.cc</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="Comment">//: Automatically aggregate functions starting with 'test-' into a test suite</span>
<span id="L2" class="LineNr"> 2 </span><span class="Comment">//: called 'run-tests'. Running this function will run all tests.</span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/101_write.subx'>https://github.com/akkartik/mu/blob/master/101_write.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/101_write.subx'>https://github.com/akkartik/mu/blob/main/101_write.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># _write: write to a file descriptor (fd)</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/102test.subx'>https://github.com/akkartik/mu/blob/master/102test.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/102test.subx'>https://github.com/akkartik/mu/blob/main/102test.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Rudimentary test harness</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -58,7 +58,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/103kernel-string-equal.subx'>https://github.com/akkartik/mu/blob/master/103kernel-string-equal.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/103kernel-string-equal.subx'>https://github.com/akkartik/mu/blob/main/103kernel-string-equal.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Checking null-terminated strings.</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment">#</span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/104new-segment.subx'>https://github.com/akkartik/mu/blob/master/104new-segment.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/104new-segment.subx'>https://github.com/akkartik/mu/blob/main/104new-segment.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Create a new segment (pool of memory for allocating chunks from) in the form</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># of an *allocation descriptor* that can be passed to the memory allocator</span>

View File

@ -58,7 +58,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/105string-equal.subx'>https://github.com/akkartik/mu/blob/master/105string-equal.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/105string-equal.subx'>https://github.com/akkartik/mu/blob/main/105string-equal.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Comparing 'regular' size-prefixed strings.</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/106stream.subx'>https://github.com/akkartik/mu/blob/master/106stream.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/106stream.subx'>https://github.com/akkartik/mu/blob/main/106stream.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># streams: data structure for operating on arrays in a stateful manner</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment">#</span>

View File

@ -59,7 +59,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/107trace.subx'>https://github.com/akkartik/mu/blob/master/107trace.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/107trace.subx'>https://github.com/akkartik/mu/blob/main/107trace.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># primitives for emitting traces to a 'trace' stream, and for tests to make assertions on its contents</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment">#</span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/108write.subx'>https://github.com/akkartik/mu/blob/master/108write.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/108write.subx'>https://github.com/akkartik/mu/blob/main/108write.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># write: like _write, but also support in-memory streams in addition to file</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># descriptors.</span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/109stream-equal.subx'>https://github.com/akkartik/mu/blob/master/109stream-equal.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/109stream-equal.subx'>https://github.com/akkartik/mu/blob/main/109stream-equal.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># some primitives for checking stream contents</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/110stop.subx'>https://github.com/akkartik/mu/blob/master/110stop.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/110stop.subx'>https://github.com/akkartik/mu/blob/main/110stop.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># stop: dependency-injected wrapper around the exit() syscall</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment">#</span>

View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/111read.subx'>https://github.com/akkartik/mu/blob/master/111read.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/111read.subx'>https://github.com/akkartik/mu/blob/main/111read.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># read: analogously to write, support reading from in-memory streams in</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># addition to file descriptors.</span>

View File

@ -58,7 +58,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/112read-byte.subx'>https://github.com/akkartik/mu/blob/master/112read-byte.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/112read-byte.subx'>https://github.com/akkartik/mu/blob/main/112read-byte.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># read-byte-buffered: one higher-level abstraction atop 'read'.</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment">#</span>

View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/113write-stream.subx'>https://github.com/akkartik/mu/blob/master/113write-stream.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/113write-stream.subx'>https://github.com/akkartik/mu/blob/main/113write-stream.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># write-stream: like write, but write streams rather than strings</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/114error.subx'>https://github.com/akkartik/mu/blob/master/114error.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/114error.subx'>https://github.com/akkartik/mu/blob/main/114error.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Print an error message and exit.</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -58,7 +58,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/115write-byte.subx'>https://github.com/akkartik/mu/blob/master/115write-byte.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/115write-byte.subx'>https://github.com/akkartik/mu/blob/main/115write-byte.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># write-byte-buffered: add a single byte to a buffered-file.</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># flush: write out any buffered writes to disk.</span>

View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/116write-buffered.subx'>https://github.com/akkartik/mu/blob/master/116write-buffered.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/116write-buffered.subx'>https://github.com/akkartik/mu/blob/main/116write-buffered.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># write-buffered: like 'write', but for a buffered-file</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/117write-int-hex.subx'>https://github.com/akkartik/mu/blob/master/117write-int-hex.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/117write-int-hex.subx'>https://github.com/akkartik/mu/blob/main/117write-int-hex.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Write out the (hex) textual representation of numbers.</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/118parse-hex-int.subx'>https://github.com/akkartik/mu/blob/master/118parse-hex-int.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/118parse-hex-int.subx'>https://github.com/akkartik/mu/blob/main/118parse-hex-int.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># some utilities for converting numbers from hex</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># lowercase letters only for now</span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/119error-byte.subx'>https://github.com/akkartik/mu/blob/master/119error-byte.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/119error-byte.subx'>https://github.com/akkartik/mu/blob/main/119error-byte.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Print an error message followed by the text representation of a byte. Then exit.</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/120allocate.subx'>https://github.com/akkartik/mu/blob/master/120allocate.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/120allocate.subx'>https://github.com/akkartik/mu/blob/main/120allocate.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Helper to dynamically allocate memory on the heap.</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment">#</span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/121new-stream.subx'>https://github.com/akkartik/mu/blob/master/121new-stream.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/121new-stream.subx'>https://github.com/akkartik/mu/blob/main/121new-stream.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Helper to allocate a stream on the heap.</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/122read-line.subx'>https://github.com/akkartik/mu/blob/master/122read-line.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/122read-line.subx'>https://github.com/akkartik/mu/blob/main/122read-line.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span>== code
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># instruction effective address register displacement immediate</span>

View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/123slice.subx'>https://github.com/akkartik/mu/blob/master/123slice.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/123slice.subx'>https://github.com/akkartik/mu/blob/main/123slice.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># new data structure: a slice is an open interval of addresses [start, end)</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># that includes 'start' but not 'end'</span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/124next-token.subx'>https://github.com/akkartik/mu/blob/master/124next-token.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/124next-token.subx'>https://github.com/akkartik/mu/blob/main/124next-token.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Some tokenization primitives.</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/125write-stream-data.subx'>https://github.com/akkartik/mu/blob/master/125write-stream-data.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/125write-stream-data.subx'>https://github.com/akkartik/mu/blob/main/125write-stream-data.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span>== code
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># instruction effective address register displacement immediate</span>

View File

@ -59,7 +59,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/126write-int-decimal.subx'>https://github.com/akkartik/mu/blob/master/126write-int-decimal.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/126write-int-decimal.subx'>https://github.com/akkartik/mu/blob/main/126write-int-decimal.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Helper to print an int32 in decimal.</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/127next-word.subx'>https://github.com/akkartik/mu/blob/master/127next-word.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/127next-word.subx'>https://github.com/akkartik/mu/blob/main/127next-word.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Tokenize by whitespace.</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/128subx-words.subx'>https://github.com/akkartik/mu/blob/master/128subx-words.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/128subx-words.subx'>https://github.com/akkartik/mu/blob/main/128subx-words.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Helpers for parsing SubX words, with their rules for hex, labels and metadata.</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/129emit-hex.subx'>https://github.com/akkartik/mu/blob/master/129emit-hex.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/129emit-hex.subx'>https://github.com/akkartik/mu/blob/main/129emit-hex.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span>== code
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># instruction effective address register displacement immediate</span>

View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/130emit.subx'>https://github.com/akkartik/mu/blob/master/130emit.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/130emit.subx'>https://github.com/akkartik/mu/blob/main/130emit.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span>== code
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># instruction effective address register displacement immediate</span>

View File

@ -57,7 +57,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/131table.subx'>https://github.com/akkartik/mu/blob/master/131table.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/131table.subx'>https://github.com/akkartik/mu/blob/main/131table.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># A table is a stream of (key, value) rows.</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment">#</span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/132slurp.subx'>https://github.com/akkartik/mu/blob/master/132slurp.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/132slurp.subx'>https://github.com/akkartik/mu/blob/main/132slurp.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span>== code
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># instruction effective address register displacement immediate</span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/133subx-widths.subx'>https://github.com/akkartik/mu/blob/master/133subx-widths.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/133subx-widths.subx'>https://github.com/akkartik/mu/blob/main/133subx-widths.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Helpers to compute widths of SubX arguments based on their metadata.</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># /imm8 =&gt; 1 byte,</span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/134emit-hex-array.subx'>https://github.com/akkartik/mu/blob/master/134emit-hex-array.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/134emit-hex-array.subx'>https://github.com/akkartik/mu/blob/main/134emit-hex-array.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span>== code
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># instruction effective address register displacement immediate</span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/135next-word-or-string.subx'>https://github.com/akkartik/mu/blob/master/135next-word-or-string.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/135next-word-or-string.subx'>https://github.com/akkartik/mu/blob/main/135next-word-or-string.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span>== code
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># instruction effective address register displacement immediate</span>

View File

@ -51,7 +51,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/201register-names.subx'>https://github.com/akkartik/mu/blob/master/201register-names.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/201register-names.subx'>https://github.com/akkartik/mu/blob/main/201register-names.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span>== data
<span id="L2" class="LineNr"> 2 </span><span class="SpecialChar">Registers</span>: <span class="subxComment"># (addr stream {(handle array byte), int})</span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/202write-int.subx'>https://github.com/akkartik/mu/blob/master/202write-int.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/202write-int.subx'>https://github.com/akkartik/mu/blob/main/202write-int.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># write-int: add (the binary representation of) a single int to a stream</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/203stack.subx'>https://github.com/akkartik/mu/blob/master/203stack.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/203stack.subx'>https://github.com/akkartik/mu/blob/main/203stack.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># A stack looks like this:</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># top: int</span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/301array-equal.subx'>https://github.com/akkartik/mu/blob/master/301array-equal.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/301array-equal.subx'>https://github.com/akkartik/mu/blob/main/301array-equal.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Comparing arrays of numbers.</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -53,7 +53,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/302stack_allocate.subx'>https://github.com/akkartik/mu/blob/master/302stack_allocate.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/302stack_allocate.subx'>https://github.com/akkartik/mu/blob/main/302stack_allocate.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># A function which pushes n zeros on the stack.</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># Really only intended to be called from code generated by mu.subx (for array</span>

View File

@ -52,7 +52,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/303kernel-string.subx'>https://github.com/akkartik/mu/blob/master/303kernel-string.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/303kernel-string.subx'>https://github.com/akkartik/mu/blob/main/303kernel-string.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># We can't really do much with null-terminated kernel strings, and we don't</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># want to. Let's turn them into regular length-prefixed strings at the first</span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/304screen.subx'>https://github.com/akkartik/mu/blob/master/304screen.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/304screen.subx'>https://github.com/akkartik/mu/blob/main/304screen.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Primitives for screen control.</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># Require Linux and a modern terminal.</span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/305keyboard.subx'>https://github.com/akkartik/mu/blob/master/305keyboard.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/305keyboard.subx'>https://github.com/akkartik/mu/blob/main/305keyboard.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Primitives for keyboard control.</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># Require Linux and a modern terminal.</span>

View File

@ -53,7 +53,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/306files.subx'>https://github.com/akkartik/mu/blob/master/306files.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/306files.subx'>https://github.com/akkartik/mu/blob/main/306files.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Methods for constructing buffered-file objects.</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment">#</span>

View File

@ -52,7 +52,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/307size.subx'>https://github.com/akkartik/mu/blob/master/307size.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/307size.subx'>https://github.com/akkartik/mu/blob/main/307size.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Size of an array in bytes.</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -52,7 +52,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/308allocate-array.subx'>https://github.com/akkartik/mu/blob/master/308allocate-array.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/308allocate-array.subx'>https://github.com/akkartik/mu/blob/main/308allocate-array.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># 2-arg version of allocate-array.</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># Really only intended to be called from code generated by mu.subx.</span>

View File

@ -53,7 +53,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/309stream.subx'>https://github.com/akkartik/mu/blob/master/309stream.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/309stream.subx'>https://github.com/akkartik/mu/blob/main/309stream.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Some unsafe methods not intended to be used directly in SubX, only through</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># Mu after proper type-checking.</span>

View File

@ -54,7 +54,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/310copy-bytes.subx'>https://github.com/akkartik/mu/blob/master/310copy-bytes.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/310copy-bytes.subx'>https://github.com/akkartik/mu/blob/main/310copy-bytes.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Some helpers for copying non-overlapping regions of memory.</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># Really only intended to be called from code generated by mu.subx.</span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/311decimal-int.subx'>https://github.com/akkartik/mu/blob/master/311decimal-int.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/311decimal-int.subx'>https://github.com/akkartik/mu/blob/main/311decimal-int.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Helpers for decimal ints.</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -53,7 +53,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/312copy.subx'>https://github.com/akkartik/mu/blob/master/312copy.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/312copy.subx'>https://github.com/akkartik/mu/blob/main/312copy.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span>== code
<span id="L2" class="LineNr"> 2 </span>

View File

@ -54,7 +54,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/313index-bounds-check.subx'>https://github.com/akkartik/mu/blob/master/313index-bounds-check.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/313index-bounds-check.subx'>https://github.com/akkartik/mu/blob/main/313index-bounds-check.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Helper to check an array's bounds, and to abort if they're violated.</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># Really only intended to be called from code generated by mu.subx.</span>

View File

@ -52,7 +52,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/314divide.subx'>https://github.com/akkartik/mu/blob/master/314divide.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/314divide.subx'>https://github.com/akkartik/mu/blob/main/314divide.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span>== code
<span id="L2" class="LineNr"> 2 </span>

View File

@ -52,7 +52,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/315slice.subx'>https://github.com/akkartik/mu/blob/master/315slice.subx</a>
<a href='https://github.com/akkartik/mu/blob/main/315slice.subx'>https://github.com/akkartik/mu/blob/main/315slice.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span>== code
<span id="L2" class="LineNr"> 2 </span>

2
html/400.mu.html generated
View File

@ -51,7 +51,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/400.mu'>https://github.com/akkartik/mu/blob/master/400.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/400.mu'>https://github.com/akkartik/mu/blob/main/400.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># The 4xx series is for primitives implemented in Mu.</span>
<span id="L2" class="LineNr"> 2 </span>

2
html/401test.mu.html generated
View File

@ -54,7 +54,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/401test.mu'>https://github.com/akkartik/mu/blob/master/401test.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/401test.mu'>https://github.com/akkartik/mu/blob/main/401test.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Some helpers for Mu tests.</span>
<span id="L2" class="LineNr"> 2 </span>

2
html/402time.mu.html generated
View File

@ -54,7 +54,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/402time.mu'>https://github.com/akkartik/mu/blob/master/402time.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/402time.mu'>https://github.com/akkartik/mu/blob/main/402time.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="PreProc">type</span> <a href='402time.mu.html#L1'>timespec</a> <span class="Delimiter">{</span>
<span id="L2" class="LineNr"> 2 </span> tv_sec: int

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/403unicode.mu'>https://github.com/akkartik/mu/blob/master/403unicode.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/403unicode.mu'>https://github.com/akkartik/mu/blob/main/403unicode.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Helpers for Unicode.</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>

View File

@ -54,7 +54,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/404stream.mu'>https://github.com/akkartik/mu/blob/master/404stream.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/404stream.mu'>https://github.com/akkartik/mu/blob/main/404stream.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Tests for Mu's stream primitives.</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/405screen.mu'>https://github.com/akkartik/mu/blob/master/405screen.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/405screen.mu'>https://github.com/akkartik/mu/blob/main/405screen.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Wrappers for real screen primitives that can be passed a fake screen.</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment"># The tests here have been painstakingly validated against a real terminal</span>

2
html/406int32.mu.html generated
View File

@ -54,7 +54,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/406int32.mu'>https://github.com/akkartik/mu/blob/master/406int32.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/406int32.mu'>https://github.com/akkartik/mu/blob/main/406int32.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Some slow but convenient helpers</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -54,7 +54,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/407print-int32-decimal-right-justified.mu'>https://github.com/akkartik/mu/blob/master/407print-int32-decimal-right-justified.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/407print-int32-decimal-right-justified.mu'>https://github.com/akkartik/mu/blob/main/407print-int32-decimal-right-justified.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># print 'n' with enough leading spaces to be right-justified in 'width'</span>
<span id="L2" class="LineNr"> 2 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='407print-int32-decimal-right-justified.mu.html#L2'>print-int32-decimal-right-justified</a></span> <a href='405screen.mu.html#L9'>screen</a>: (addr <a href='405screen.mu.html#L9'>screen</a>), n: int, _width: int <span class="Delimiter">{</span>

2
html/408float.mu.html generated
View File

@ -54,7 +54,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/408float.mu'>https://github.com/akkartik/mu/blob/master/408float.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/408float.mu'>https://github.com/akkartik/mu/blob/main/408float.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Some quick-n-dirty ways to create floats.</span>
<span id="L2" class="LineNr"> 2 </span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/409print-float-hex.mu'>https://github.com/akkartik/mu/blob/master/409print-float-hex.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/409print-float-hex.mu'>https://github.com/akkartik/mu/blob/main/409print-float-hex.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># quick-n-dirty way to print out floats in hex</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment"># <a href="https://www.exploringbinary.com/hexadecimal-floating-point-constants">https://www.exploringbinary.com/hexadecimal-floating-point-constants</a></span>

2
html/410file.mu.html generated
View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/410file.mu'>https://github.com/akkartik/mu/blob/master/410file.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/410file.mu'>https://github.com/akkartik/mu/blob/main/410file.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='410file.mu.html#L1'>read-lines</a></span> in: (addr buffered-file), out: (addr handle array (handle array byte)) <span class="Delimiter">{</span>
<span id="L2" class="LineNr"> 2 </span> <span class="PreProc">var</span> stream: (stream (handle array byte) <span class="Constant">0x10</span>)

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/411string.mu'>https://github.com/akkartik/mu/blob/master/411string.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/411string.mu'>https://github.com/akkartik/mu/blob/main/411string.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># read up to 'len' graphemes after skipping the first 'start' ones</span>
<span id="L2" class="LineNr"> 2 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='411string.mu.html#L2'>substring</a></span> in: (addr array byte), start: int, len: int, out-ah: (addr handle array byte) <span class="Delimiter">{</span>

View File

@ -56,7 +56,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/412print-float-decimal.mu'>https://github.com/akkartik/mu/blob/master/412print-float-decimal.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/412print-float-decimal.mu'>https://github.com/akkartik/mu/blob/main/412print-float-decimal.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># print out floats in decimal</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment"># <a href="https://research.swtch.com/ftoa">https://research.swtch.com/ftoa</a></span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/apps/advent2020/1a.mu'>https://github.com/akkartik/mu/blob/master/apps/advent2020/1a.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/advent2020/1a.mu'>https://github.com/akkartik/mu/blob/main/apps/advent2020/1a.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># <a href="https://adventofcode.com/2020/day/1">https://adventofcode.com/2020/day/1</a></span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/apps/advent2020/1b.mu'>https://github.com/akkartik/mu/blob/master/apps/advent2020/1b.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/advent2020/1b.mu'>https://github.com/akkartik/mu/blob/main/apps/advent2020/1b.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># <a href="https://adventofcode.com/2020/day/1">https://adventofcode.com/2020/day/1</a></span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>

View File

@ -54,7 +54,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/apps/advent2020/2a.mu'>https://github.com/akkartik/mu/blob/master/apps/advent2020/2a.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/advent2020/2a.mu'>https://github.com/akkartik/mu/blob/main/apps/advent2020/2a.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># <a href="https://adventofcode.com/2020/day/2">https://adventofcode.com/2020/day/2</a></span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>

View File

@ -55,7 +55,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/apps/advent2020/2b.mu'>https://github.com/akkartik/mu/blob/master/apps/advent2020/2b.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/advent2020/2b.mu'>https://github.com/akkartik/mu/blob/main/apps/advent2020/2b.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># <a href="https://adventofcode.com/2020/day/2">https://adventofcode.com/2020/day/2</a></span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>

Some files were not shown because too many files have changed in this diff Show More