mirror of
https://github.com/fadden/6502bench.git
synced 2026-04-21 10:16:42 +00:00
Execute scripts
This change applies the substitution scripts on the HTML files, replacing away the jQuery load() calls with the actual file contents, and setting the correct URLs to the prev/next buttons.
This commit is contained in:
@@ -1,121 +1,169 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"
|
||||
integrity="sha384-vtXRMe3mGCbOeY7l30aIg8H9p3GdeSe4IFlP6G8JMa7o7lXvnz3GFKzPxzJdPfGK" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
|
||||
<link rel="stylesheet" href="/main.css"/>
|
||||
|
||||
<title>String Formatting - SourceGen Tutorial</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="masthead">
|
||||
<!-- START: /masthead-incl.html -->
|
||||
<script>$("#masthead").load("/masthead-incl.html");</script>
|
||||
<!-- END: /masthead-incl.html -->
|
||||
</div>
|
||||
|
||||
<div id="topnav">
|
||||
<!-- START: /topnav-incl.html active:#topnav-sgtutorial -->
|
||||
<script>
|
||||
// Load global topnav content, and mark current page active.
|
||||
$("#topnav").load("/topnav-incl.html", function() {
|
||||
$("#topnav-sgtutorial").addClass("active");
|
||||
});
|
||||
</script>
|
||||
<!-- END: /topnav-incl.html -->
|
||||
</div>
|
||||
|
||||
<div id="sidenav">
|
||||
<!-- START: sidenav-incl.html active:#sidenav-string-formatting -->
|
||||
<script>
|
||||
// Load local sidenav content, and mark current page active.
|
||||
$("#sidenav").load("sidenav-incl.html", function() {
|
||||
$("#sidenav-string-formatting").addClass("active");
|
||||
});
|
||||
</script>
|
||||
<!-- END: sidenav-incl.html -->
|
||||
</div>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h2>String Formatting</h2>
|
||||
|
||||
<div class="grid-container">
|
||||
<div class="grid-item-text">
|
||||
<p>Programs can encode strings, such as human-readable text or
|
||||
filenames, in a variety of ways. Assemblers generally support one
|
||||
or more of these. SourceGen allows you to choose from a number of
|
||||
different formats, and automatically generates appropriate assembler
|
||||
directives.</p>
|
||||
<p>The most popular formats are null-terminated (string data followed
|
||||
by $00), length-delimited (first byte or two holds the string length),
|
||||
and dextral character inverted (the high bit on the last byte is
|
||||
flipped). Sometimes strings are stored in reverse, so the output
|
||||
routine can decrement a register to zero.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-container">
|
||||
<div class="grid-item-image">
|
||||
<img src="images/t2-str-null-term-start.png" alt="t2-str-null-term-start"/>
|
||||
</div>
|
||||
<div class="grid-item-text">
|
||||
<p>Looking at the Tutorial2 code, there are four strings starting
|
||||
at address $2004, each of which is followed by $00. These look like
|
||||
null-terminated strings, so let's make it official.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-container">
|
||||
<div class="grid-item-image">
|
||||
<img src="images/t2-str-null-term-bad.png" alt="t2-str-null-term-bad"/>
|
||||
</div>
|
||||
<div class="grid-item-text">
|
||||
<p>First, let's do it wrong. Click on the line with
|
||||
address $2004 to select it. Hold the shift key down, then double-click
|
||||
on the operand field of the line with address $2031 (i.e. double-click on
|
||||
the words "<samp>last string</samp>").</p>
|
||||
<p>The Edit Data Operand dialog opens, but the null-terminated strings
|
||||
option is not available. This is because we didn't include the null byte
|
||||
on the last string. To be recognized as one of the "special" string types,
|
||||
every selected string must match the expected pattern.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-container">
|
||||
<div class="grid-item-image">
|
||||
<img src="images/t2-str-null-term-good.png" alt="t2-str-null-term-good"/>
|
||||
</div>
|
||||
<div class="grid-item-text">
|
||||
<p>Cancel out of the dialog. Hold the shift key down, and double-click
|
||||
on the operand on line $203C (<code>$00</code>).
|
||||
With all 57 bytes selected,
|
||||
you should now see "<samp>Null-terminated strings (4)</samp>" as an available
|
||||
option (make sure the Character Encoding pop-up is set to
|
||||
"<samp>Low or High ASCII</samp>"). Click on that, then click <samp>OK</samp>.
|
||||
The strings are now shown as <samp>.ZSTR</samp> operands.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!-- #main -->
|
||||
|
||||
<div id="prevnext">
|
||||
<a href="#" class="btn-previous">« Previous</a>
|
||||
<a href="#" class="btn-next">Next »</a>
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
<!-- START: /footer-incl.html -->
|
||||
<script>$("#footer").load("/footer-incl.html");</script>
|
||||
<!-- END: /footer-incl.html -->
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"
|
||||
integrity="sha384-vtXRMe3mGCbOeY7l30aIg8H9p3GdeSe4IFlP6G8JMa7o7lXvnz3GFKzPxzJdPfGK" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
|
||||
<link rel="stylesheet" href="/main.css"/>
|
||||
|
||||
<title>String Formatting - SourceGen Tutorial</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="masthead">
|
||||
<!-- START: /masthead-incl.html -->
|
||||
<!--<div class="masthead-title" style="background-image: url('images/screenshot-mainwin.png');">-->
|
||||
<div class="masthead-title">
|
||||
6502bench
|
||||
</div>
|
||||
<!-- END: /masthead-incl.html -->
|
||||
</div>
|
||||
|
||||
<div id="topnav">
|
||||
<!-- START: /topnav-incl.html active:#topnav-sgtutorial -->
|
||||
<!-- top navigation bar contents -->
|
||||
<nav>
|
||||
<a id="topnav-home" href="/">HOME</a>
|
||||
<a id="topnav-sgtutorial" class="active" href="/sgtutorial">SourceGen Tutorial</a>
|
||||
<a id="topnav-menuicon" href="javascript:void(0);" class="icon" onclick="toggleSidenav()">
|
||||
<i class="fa fa-bars"></i>
|
||||
</a>
|
||||
</nav>
|
||||
<script>
|
||||
// If page has no sidenav, don't show the sidenav toggle button.
|
||||
if (document.getElementById("sidenav") == undefined) {
|
||||
$("#topnav-menuicon").hide();
|
||||
}
|
||||
|
||||
// Sidenav toggle function.
|
||||
//
|
||||
// Use a jQuery function to toggle the sidenav bar. The initial state
|
||||
// is undefined / inherited, so it will pop in and out as the screen
|
||||
// resizes around the "large" breakpoint.
|
||||
function toggleSidenav() {
|
||||
$("#sidenav").toggle("fast");
|
||||
}
|
||||
</script>
|
||||
<!-- END: /topnav-incl.html -->
|
||||
</div>
|
||||
|
||||
<div id="sidenav">
|
||||
<!-- START: sidenav-incl.html active:#sidenav-string-formatting -->
|
||||
<!-- side navigation bar contents -->
|
||||
<ul>
|
||||
<li id="sidenav-index"><a href="./">Introduction</a></li>
|
||||
<li id="sidenav-about-disasm"><a href="about-disasm.html">About Disassembly</a></li>
|
||||
<li id="sidenav-using-sourcegen"><a href="using-sourcegen.html">Using SourceGen</a></li>
|
||||
<ul>
|
||||
<li id="sidenav-moving-around"><a href="moving-around.html">Moving Around</a></li>
|
||||
<li id="sidenav-simple-edits"><a href="simple-edits.html">Simple Edits</a></li>
|
||||
<li id="sidenav-labels-symbols"><a href="labels-symbols.html">Labels & Symbols</a></li>
|
||||
<li id="sidenav-editing-data"><a href="editing-data.html">Editing Data Operands</a></li>
|
||||
<li id="sidenav-generating-code"><a href="generating-code.html">Generating Code</a></li>
|
||||
</ul>
|
||||
<li id="sidenav-digging-deeper"><a href="digging-deeper.html">Digging Deeper</a></li>
|
||||
<ul>
|
||||
<li id="sidenav-string-formatting" class="active"><a href="string-formatting.html">String Formatting</a></li>
|
||||
<li id="sidenav-local-variables"><a href="local-variables.html">Local Variables</a></li>
|
||||
<li id="sidenav-inline-data"><a href="inline-data.html">Inline Data</a></li>
|
||||
<li id="sidenav-odds-ends"><a href="odds-ends.html">Odds & Ends</a></li>
|
||||
</ul>
|
||||
<li id="sidenav-advanced-topics"><a href="advanced-topics.html">Advanced Topics</a></li>
|
||||
<ul>
|
||||
<li id="sidenav-address-tables"><a href="address-tables.html">Address Tables</a></li>
|
||||
<li id="sidenav-extension-scripts"><a href="extension-scripts.html">Extension Scripts</a></li>
|
||||
<li id="sidenav-visualizations"><a href="visualizations.html">Visualizations</a></li>
|
||||
</ul>
|
||||
</ul>
|
||||
<!-- END: sidenav-incl.html -->
|
||||
</div>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h2>String Formatting</h2>
|
||||
|
||||
<div class="grid-container">
|
||||
<div class="grid-item-text">
|
||||
<p>Programs can encode strings, such as human-readable text or
|
||||
filenames, in a variety of ways. Assemblers generally support one
|
||||
or more of these. SourceGen allows you to choose from a number of
|
||||
different formats, and automatically generates appropriate assembler
|
||||
directives.</p>
|
||||
<p>The most popular formats are null-terminated (string data followed
|
||||
by $00), length-delimited (first byte or two holds the string length),
|
||||
and dextral character inverted (the high bit on the last byte is
|
||||
flipped). Sometimes strings are stored in reverse, so the output
|
||||
routine can decrement a register to zero.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-container">
|
||||
<div class="grid-item-image">
|
||||
<img src="images/t2-str-null-term-start.png" alt="t2-str-null-term-start"/>
|
||||
</div>
|
||||
<div class="grid-item-text">
|
||||
<p>Looking at the Tutorial2 code, there are four strings starting
|
||||
at address $2004, each of which is followed by $00. These look like
|
||||
null-terminated strings, so let's make it official.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-container">
|
||||
<div class="grid-item-image">
|
||||
<img src="images/t2-str-null-term-bad.png" alt="t2-str-null-term-bad"/>
|
||||
</div>
|
||||
<div class="grid-item-text">
|
||||
<p>First, let's do it wrong. Click on the line with
|
||||
address $2004 to select it. Hold the shift key down, then double-click
|
||||
on the operand field of the line with address $2031 (i.e. double-click on
|
||||
the words "<samp>last string</samp>").</p>
|
||||
<p>The Edit Data Operand dialog opens, but the null-terminated strings
|
||||
option is not available. This is because we didn't include the null byte
|
||||
on the last string. To be recognized as one of the "special" string types,
|
||||
every selected string must match the expected pattern.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-container">
|
||||
<div class="grid-item-image">
|
||||
<img src="images/t2-str-null-term-good.png" alt="t2-str-null-term-good"/>
|
||||
</div>
|
||||
<div class="grid-item-text">
|
||||
<p>Cancel out of the dialog. Hold the shift key down, and double-click
|
||||
on the operand on line $203C (<code>$00</code>).
|
||||
With all 57 bytes selected,
|
||||
you should now see "<samp>Null-terminated strings (4)</samp>" as an available
|
||||
option (make sure the Character Encoding pop-up is set to
|
||||
"<samp>Low or High ASCII</samp>"). Click on that, then click <samp>OK</samp>.
|
||||
The strings are now shown as <samp>.ZSTR</samp> operands.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!-- #main -->
|
||||
|
||||
<div id="prevnext">
|
||||
<a href="digging-deeper.html" class="btn-previous">« Previous</a>
|
||||
<a href="local-variables.html" class="btn-next">Next »</a>
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
<!-- START: /footer-incl.html -->
|
||||
<hr/>
|
||||
<p>Copyright 2021 faddenSoft</p>
|
||||
<!-- <p id="screen-size"></p>
|
||||
<script>
|
||||
var w = window.innerWidth;
|
||||
var h = window.innerHeight;
|
||||
var x = document.getElementById("screen-size");
|
||||
x.innerHTML = "DEBUG: initial window size " + w + "x" + h;
|
||||
</script> -->
|
||||
<!-- END: /footer-incl.html -->
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user