1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-12-04 11:49:58 +00:00
6502bench/docs/sgtutorial/suggestions.html

148 lines
6.4 KiB
HTML
Raw Normal View History

2021-08-03 21:48:40 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<!-- START: /incl-head.html -->
<!-- common head elements -->
<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"/>
<!-- END: /incl-head.html -->
<title>Suggestions - SourceGen Tutorial</title>
</head>
<body>
<!-- START: /incl-masthead.html -->
<div id="masthead">
<!--<div class="masthead-title" style="background-image: url('images/screenshot-mainwin.png');">-->
<div class="masthead-title">
6502bench
</div>
</div>
<!-- END: /incl-masthead.html -->
<!-- START: /incl-topnav.html active:#topnav-sgtutorial -->
<div id="topnav">
<!-- 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>
// 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>
</div>
<!-- END: /incl-topnav.html -->
<!-- START: incl-sidenav.html active:#sidenav-suggestions -->
<div id="sidenav">
<!-- 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>
<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 &amp; 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>
<li id="sidenav-digging-deeper"><a href="digging-deeper.html">Digging Deeper</a>
<ul>
<li id="sidenav-string-formatting"><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 &amp; Ends</a></li>
</ul></li>
<li id="sidenav-advanced-topics"><a href="advanced-topics.html">Advanced Topics</a>
<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></li>
<li id="sidenav-suggestions" class="active"><a href="suggestions.html">Suggestions</a></li>
</ul>
</div>
<!-- END: incl-sidenav.html -->
<div id="main">
<h2>A Few Suggestions</h2>
<p>The hardest step in a journey is often the first. Here are a few
suggestions to help you on your way.</p>
<ul>
<li>Start with a small project (&lt; 1KB). If you haven't
disassembled code before, this is the time to play with different
conventions, like whether to use MixedCase or underscore_separated
or SCREAMING_CAPS for labels.</li>
<li>Use the program thoroughly. Understand all of what it does.</li>
<li>Begin each project by separating code from data. Identify external
entry points, format tables of addresses, and find JSRs that are
followed by inline data. Write an extension script to handle the
inlines so you won't keep tripping over them. If parts of the program
are relocated to a different address, set the appropriate address
overrides. Progress will be easier once you get code, data, and junk
2021-08-09 23:17:58 +00:00
identified and arranged in memory.
<ul>
<li>Code start tags are rarely needed, and code end tags are almost never
needed. You shouldn't have to spend a lot of time manually tagging things.
If a piece of code isn't being found, it's usually best to figure out why
the code that calls it isn't being found, instead of trying to tag it and
forge ahead. It might be dead code that's never called, or it might be
called from a table that you can format to add code entry tags for
multiple addresses with a single operation.</li>
</ul></li>
2021-08-03 21:48:40 +00:00
<li>Start with easily identifiable pieces. If a chunk of code is reading
from the keyboard, you can make reasonable guesses about the purpose of
the code that interacts with it.
2021-08-09 23:17:58 +00:00
The start of the program is often the hardest place to begin, because it
2021-08-03 21:48:40 +00:00
usually just initializes a bunch of stuff you haven't identified.</li>
<li>Expect to figure out little pieces. Use what you learn from these
to figure out other little pieces. It's a jigsaw puzzle, not a book.</li>
<li>Don't get discouraged if there's a ton of code that you can't make
sense of. It won't at first. Keep chipping away.</li>
<li>Read <a href="https://6502disassembly.com/on-disassembly.html">On Disassembly</a>
for additional thoughts.</li>
</ul>
</div> <!-- #main -->
<div id="prevnext">
<a href="visualizations.html" class="btn-previous">&laquo; Previous</a>
</div>
<!-- START: /incl-footer.html -->
<div id="footer">
<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> -->
</div>
<!-- END: /incl-footer.html -->
</body>
</html>