Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

first commit!

  • Loading branch information...
commit 02317d9bad2000c168fff914fda16a979ef19eef 0 parents
@yutopp authored
846 LICENSE_1_0.txt
@@ -0,0 +1,846 @@
+
+
+
+<!DOCTYPE html>
+<html>
+ <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# githubog: http://ogp.me/ns/fb/githubog#">
+ <meta charset='utf-8'>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <title>Rart/LICENSE_1_0.txt at master · yutopp/Rart</title>
+ <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub" />
+ <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub" />
+ <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
+
+
+
+
+ <meta content="authenticity_token" name="csrf-param" />
+<meta content="3ztO3VbhqPZB63w7XOtR1kkn5uj+plRsgrYazLBpiEg=" name="csrf-token" />
+
+ <link href="https://a248.e.akamai.net/assets.github.com/stylesheets/bundles/github-28c5222e349e8368a32d88dcc4734c5f5b7787eb.css" media="screen" rel="stylesheet" type="text/css" />
+ <link href="https://a248.e.akamai.net/assets.github.com/stylesheets/bundles/github2-30d147fc8dd43beb5d7ea3321dd28b6aedc0969b.css" media="screen" rel="stylesheet" type="text/css" />
+
+
+ <script src="https://a248.e.akamai.net/assets.github.com/javascripts/bundles/jquery-78fea2420d2e2924cb02acf5821d5cba5bc639d1.js" type="text/javascript"></script>
+ <script src="https://a248.e.akamai.net/assets.github.com/javascripts/bundles/github-c0cb0b08a47dd52fd5538b06b656ac248f3eff0d.js" type="text/javascript"></script>
+
+
+ <link rel='permalink' href='/yutopp/Rart/blob/55bcbf1bcd91edda9960e54fb860c50d87509f6b/LICENSE_1_0.txt'>
+ <meta property="og:title" content="Rart"/>
+ <meta property="og:type" content="githubog:gitrepository"/>
+ <meta property="og:url" content="https://github.com/yutopp/Rart"/>
+ <meta property="og:image" content="https://a248.e.akamai.net/assets.github.com/images/gravatars/gravatar-140.png?1329920549"/>
+ <meta property="og:site_name" content="GitHub"/>
+ <meta property="og:description" content="Rart hosted on GitHub"/>
+
+ <meta name="description" content="Rart hosted on GitHub" />
+ <link href="https://github.com/yutopp/Rart/commits/master.atom" rel="alternate" title="Recent Commits to Rart:master" type="application/atom+xml" />
+
+ </head>
+
+
+ <body class="logged_in page-blob windows vis-public env-production " data-blob-contribs-enabled="yes">
+ <div id="wrapper">
+
+
+
+
+
+ <div id="header" class="true clearfix">
+ <div class="container clearfix">
+ <a class="site-logo" href="https://github.com/">
+ <!--[if IE]>
+ <img alt="GitHub" class="github-logo" src="https://a248.e.akamai.net/assets.github.com/images/modules/header/logov7.png?1329920549" />
+ <img alt="GitHub" class="github-logo-hover" src="https://a248.e.akamai.net/assets.github.com/images/modules/header/logov7-hover.png?1329920549" />
+ <![endif]-->
+ <img alt="GitHub" class="github-logo-4x" height="30" src="https://a248.e.akamai.net/assets.github.com/images/modules/header/logov7@4x.png?1329920549" />
+ <img alt="GitHub" class="github-logo-4x-hover" height="30" src="https://a248.e.akamai.net/assets.github.com/images/modules/header/logov7@4x-hover.png?1329920549" />
+ </a>
+
+
+ <div class="topsearch ">
+<form accept-charset="UTF-8" action="/search" id="top_search_form" method="get"><input name="utf8" type="hidden" value="&#x2713;" /> <a href="/search" class="advanced-search tooltipped downwards" title="Advanced Search"><span class="mini-icon advanced-search"></span></a>
+ <div class="search placeholder-field js-placeholder-field">
+ <label class="placeholder" for="global-search-field">Search…</label>
+ <input type="text" class="search my_repos_autocompleter" id="global-search-field" name="q" results="5" spellcheck="false" autocomplete="off" data-autocomplete="my-repos-autocomplete">
+ <div id="my-repos-autocomplete" class="autocomplete-results">
+ <ul class="js-navigation-container"></ul>
+ </div>
+ <input type="submit" value="Search" class="button">
+ <span class="mini-icon search-input"></span>
+ </div>
+ <input type="hidden" name="type" value="Everything" />
+ <input type="hidden" name="repo" value="" />
+ <input type="hidden" name="langOverride" value="" />
+ <input type="hidden" name="start_value" value="1" />
+</form> <ul class="top-nav">
+ <li class="explore"><a href="https://github.com/explore">Explore</a></li>
+ <li><a href="https://gist.github.com">Gist</a></li>
+ <li><a href="/blog">Blog</a></li>
+ <li><a href="http://help.github.com">Help</a></li>
+ </ul>
+ </div>
+
+
+
+
+
+ <div id="userbox">
+ <div id="user">
+ <a href="https://github.com/yutopp"><img height="20" src="https://secure.gravatar.com/avatar/969ea38736d6f7bf73117445414e8240?s=140&amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png" width="20" /></a>
+ <a href="https://github.com/yutopp" class="name">yutopp</a>
+ </div>
+ <ul id="user-links">
+ <li>
+ <a href="/inbox/notifications" id="notifications" class="tooltipped downwards" title="Notifications">
+ <span class="mini-icon notifications"></span>
+ </a>
+ </li>
+ <li><a href="/settings/profile" id="settings" class="tooltipped downwards" title="Account Settings"><span class="mini-icon account-settings"></span></a></li>
+ <li>
+ <a href="/logout" data-method="post" id="logout" class="tooltipped downwards" title="Log Out"><span class="mini-icon logout"></span></a>
+ </li>
+ </ul>
+ </div>
+
+
+
+
+ </div>
+ </div>
+
+
+
+ <div class="site hfeed" itemscope itemtype="http://schema.org/WebPage">
+ <div class="container hentry">
+ <div class="pagehead repohead instapaper_ignore readability-menu">
+ <div class="title-actions-bar">
+
+
+
+
+ <ul class="pagehead-actions">
+
+ <li class="for-owner"><a href="/yutopp/Rart/admin" class="minibutton btn-admin "><span><span class="icon"></span>Admin</span></a></li>
+
+ <li class="js-toggler-container watch-button-container on">
+ <a href="/yutopp/Rart/toggle_watch" class="minibutton btn-watch watch-button js-toggler-target" data-method="post" data-remote="true" rel="nofollow"><span><span class="icon"></span>Watch</span></a>
+ <a href="/yutopp/Rart/toggle_watch" class="minibutton btn-watch unwatch-button js-toggler-target" data-method="post" data-remote="true" rel="nofollow"><span><span class="icon"></span>Unwatch</span></a>
+ </li>
+
+ <li><a href="/yutopp/Rart/fork" class="minibutton btn-fork fork-button" data-method="post" rel="nofollow"><span><span class="icon"></span>Fork</span></a></li>
+
+ <li class="nspr">
+ <a href="/yutopp/Rart/pull/new/master" class="minibutton btn-pull-request "><span><span class="icon"></span>Pull Request</span></a>
+ </li>
+
+
+ <li class="repostats">
+ <ul class="repo-stats">
+ <li class="watchers watching">
+ <a href="/yutopp/Rart/watchers" title="Watchers — You're Watching" class="tooltipped downwards">
+ 1
+ </a>
+ </li>
+ <li class="forks">
+ <a href="/yutopp/Rart/network" title="Forks - You have a fork" class="tooltipped downwards">
+ 1
+ </a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+
+ <h1 itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="entry-title">
+ <span class="mini-icon public-repo"></span>
+ <span class="author vcard">
+<a href="/yutopp" class="url fn" itemprop="url" rel="author"> <span itemprop="title">yutopp</span>
+ </a></span> /
+ <strong><a href="/yutopp/Rart" class="js-current-repository">Rart</a></strong>
+ </h1>
+ </div>
+
+
+
+ <ul class="tabs">
+ <li><a href="/yutopp/Rart" class="selected" highlight="repo_sourcerepo_downloadsrepo_commitsrepo_tagsrepo_branches">Code</a></li>
+ <li><a href="/yutopp/Rart/network" highlight="repo_network">Network</a>
+ <li><a href="/yutopp/Rart/pulls" highlight="repo_pulls">Pull Requests <span class='counter'>0</span></a></li>
+
+ <li><a href="/yutopp/Rart/issues" highlight="repo_issues">Issues <span class='counter'>0</span></a></li>
+
+ <li><a href="/yutopp/Rart/wiki" highlight="repo_wiki">Wiki <span class='counter'>0</span></a></li>
+
+ <li><a href="/yutopp/Rart/graphs" highlight="repo_graphsrepo_contributors">Stats &amp; Graphs</a></li>
+
+ </ul>
+
+
+<div class="frame frame-center tree-finder" style="display:none"
+ data-tree-list-url="/yutopp/Rart/tree-list/55bcbf1bcd91edda9960e54fb860c50d87509f6b"
+ data-blob-url-prefix="/yutopp/Rart/blob/55bcbf1bcd91edda9960e54fb860c50d87509f6b"
+ >
+
+ <div class="breadcrumb">
+ <span class="bold"><a href="/yutopp/Rart">Rart</a></span> /
+ <input class="tree-finder-input js-navigation-enable" type="text" name="query" autocomplete="off" spellcheck="false">
+ </div>
+
+ <div class="octotip">
+ <p>
+ <a href="/yutopp/Rart/dismiss-tree-finder-help" class="dismiss js-dismiss-tree-list-help" title="Hide this notice forever" rel="nofollow">Dismiss</a>
+ <span class="bold">Octotip:</span> You've activated the <em>file finder</em>
+ by pressing <span class="kbd">t</span> Start typing to filter the
+ file list. Use <span class="kbd badmono">↑</span> and
+ <span class="kbd badmono">↓</span> to navigate,
+ <span class="kbd">enter</span> to view files.
+ </p>
+ </div>
+
+ <table class="tree-browser" cellpadding="0" cellspacing="0">
+ <tr class="js-header"><th>&nbsp;</th><th>name</th></tr>
+ <tr class="js-no-results no-results" style="display: none">
+ <th colspan="2">No matching files</th>
+ </tr>
+ <tbody class="js-results-list js-navigation-container">
+ </tbody>
+ </table>
+</div>
+
+<div id="jump-to-line" style="display:none">
+ <h2>Jump to Line</h2>
+ <form accept-charset="UTF-8">
+ <input name="utf8" type="hidden" value="&#x2713;" />
+ <input class="textfield" type="text">
+ <div class="full-button">
+ <button type="submit" class="classy">
+ <span>Go</span>
+ </button>
+ </div>
+ </form>
+</div>
+
+
+<div class="subnav-bar">
+
+ <ul class="actions subnav">
+ <li><a href="/yutopp/Rart/tags" class="blank" highlight="repo_tags">Tags <span class="counter">0</span></a></li>
+ <li><a href="/yutopp/Rart/downloads" class="blank downloads-blank" highlight="repo_downloads">Downloads <span class="counter">0</span></a></li>
+
+ </ul>
+
+ <ul class="scope">
+ <li class="switcher">
+
+ <div class="context-menu-container js-menu-container">
+ <a href="#"
+ class="minibutton bigger switcher js-menu-target js-commitish-button btn-branch repo-tree"
+ data-master-branch="master"
+ data-ref="master">
+ <span><span class="icon"></span><i>branch:</i> master</span>
+ </a>
+
+ <div class="context-pane commitish-context js-menu-content">
+ <a href="javascript:;" class="close js-menu-close"></a>
+ <div class="context-title">Switch Branches/Tags</div>
+ <div class="context-body pane-selector commitish-selector js-filterable-commitishes">
+ <div class="filterbar">
+ <div class="placeholder-field js-placeholder-field">
+ <label class="placeholder" for="context-commitish-filter-field" data-placeholder-mode="sticky">Filter branches/tags</label>
+ <input type="text" id="context-commitish-filter-field" class="commitish-filter" />
+ </div>
+
+ <ul class="tabs">
+ <li><a href="#" data-filter="branches" class="selected">Branches</a></li>
+ <li><a href="#" data-filter="tags">Tags</a></li>
+ </ul>
+ </div>
+
+ <div class="commitish-item branch-commitish selector-item">
+ <h4>
+ <a href="/yutopp/Rart/blob/master/LICENSE_1_0.txt" data-name="master" rel="nofollow">master</a>
+ </h4>
+ </div>
+
+
+ <div class="no-results" style="display:none">Nothing to show</div>
+ </div>
+ </div><!-- /.commitish-context-context -->
+ </div>
+
+ </li>
+ </ul>
+
+ <ul class="subnav with-scope">
+
+ <li><a href="/yutopp/Rart" class="selected" highlight="repo_source">Files</a></li>
+ <li><a href="/yutopp/Rart/commits/master" highlight="repo_commits">Commits</a></li>
+ <li><a href="/yutopp/Rart/branches" class="" highlight="repo_branches" rel="nofollow">Branches <span class="counter">1</span></a></li>
+ </ul>
+
+</div>
+
+
+
+
+
+
+
+
+ </div><!-- /.repohead -->
+
+
+
+
+
+
+
+<!-- block_view_fragment_key: views7/v8/blob:v21:0bc00e753450c43c7e414e8598c86a80 -->
+ <div id="slider">
+
+ <div class="breadcrumb" data-path="LICENSE_1_0.txt/">
+ <b itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/yutopp/Rart/tree/55bcbf1bcd91edda9960e54fb860c50d87509f6b" class="js-rewrite-sha" itemprop="url"><span itemprop="title">Rart</span></a></b> / <strong class="final-path">LICENSE_1_0.txt</strong> <span class="js-clippy mini-icon clippy " data-clipboard-text="LICENSE_1_0.txt" data-copied-hint="copied!" data-copy-hint="copy to clipboard"></span>
+ </div>
+
+
+ <div class="commit file-history-tease" data-path="LICENSE_1_0.txt/">
+ <img class="main-avatar" height="24" src="https://secure.gravatar.com/avatar/969ea38736d6f7bf73117445414e8240?s=140&amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png" width="24" />
+ <span class="author"><a href="/yutopp">yutopp</a></span>
+ <time class="js-relative-date" datetime="2012-02-03T11:38:52-08:00" title="2012-02-03 11:38:52">February 03, 2012</time>
+ <div class="commit-title">
+ <a href="/yutopp/Rart/commit/55bcbf1bcd91edda9960e54fb860c50d87509f6b" class="message">First</a>
+ </div>
+
+ <div class="participation">
+ <p class="quickstat"><a href="#blob_contributors_box" rel="facebox"><strong>1</strong> contributor</a></p>
+
+ </div>
+ <div id="blob_contributors_box" style="display:none">
+ <h2>Users on GitHub who have contributed to this file</h2>
+ <ul class="facebox-user-list">
+ <li>
+ <img height="24" src="https://secure.gravatar.com/avatar/969ea38736d6f7bf73117445414e8240?s=140&amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png" width="24" />
+ <a href="/yutopp">yutopp</a>
+ </li>
+ </ul>
+ </div>
+ </div>
+
+ <div class="frames">
+ <div class="frame frame-center" data-path="LICENSE_1_0.txt/" data-permalink-url="/yutopp/Rart/blob/55bcbf1bcd91edda9960e54fb860c50d87509f6b/LICENSE_1_0.txt" data-title="Rart/LICENSE_1_0.txt at master · yutopp/Rart · GitHub" data-type="blob">
+
+ <div id="files" class="bubble">
+ <div class="file">
+ <div class="meta">
+ <div class="info">
+ <span class="icon"><b class="mini-icon text-file"></b></span>
+ <span class="mode" title="File Mode">100644</span>
+ <span>24 lines (20 sloc)</span>
+ <span>1.338 kb</span>
+ </div>
+ <ul class="button-group actions">
+ <li>
+ <a class="grouped-button file-edit-link minibutton bigger lighter js-rewrite-sha" href="/yutopp/Rart/edit/55bcbf1bcd91edda9960e54fb860c50d87509f6b/LICENSE_1_0.txt" data-method="post" rel="nofollow"><span>Edit this file</span></a>
+ </li>
+
+ <li>
+ <a href="/yutopp/Rart/raw/master/LICENSE_1_0.txt" class="minibutton btn-raw grouped-button bigger lighter" id="raw-url"><span><span class="icon"></span>Raw</span></a>
+ </li>
+ <li>
+ <a href="/yutopp/Rart/blame/master/LICENSE_1_0.txt" class="minibutton btn-blame grouped-button bigger lighter"><span><span class="icon"></span>Blame</span></a>
+ </li>
+ <li>
+ <a href="/yutopp/Rart/commits/master/LICENSE_1_0.txt" class="minibutton btn-history grouped-button bigger lighter" rel="nofollow"><span><span class="icon"></span>History</span></a>
+ </li>
+ </ul>
+ </div>
+ <div class="data type-text">
+ <table cellpadding="0" cellspacing="0" class="lines">
+ <tr>
+ <td>
+ <pre class="line_numbers"><span id="L1" rel="#L1">1</span>
+<span id="L2" rel="#L2">2</span>
+<span id="L3" rel="#L3">3</span>
+<span id="L4" rel="#L4">4</span>
+<span id="L5" rel="#L5">5</span>
+<span id="L6" rel="#L6">6</span>
+<span id="L7" rel="#L7">7</span>
+<span id="L8" rel="#L8">8</span>
+<span id="L9" rel="#L9">9</span>
+<span id="L10" rel="#L10">10</span>
+<span id="L11" rel="#L11">11</span>
+<span id="L12" rel="#L12">12</span>
+<span id="L13" rel="#L13">13</span>
+<span id="L14" rel="#L14">14</span>
+<span id="L15" rel="#L15">15</span>
+<span id="L16" rel="#L16">16</span>
+<span id="L17" rel="#L17">17</span>
+<span id="L18" rel="#L18">18</span>
+<span id="L19" rel="#L19">19</span>
+<span id="L20" rel="#L20">20</span>
+<span id="L21" rel="#L21">21</span>
+<span id="L22" rel="#L22">22</span>
+<span id="L23" rel="#L23">23</span>
+</pre>
+ </td>
+ <td width="100%">
+ <div class="highlight"><pre><div class='line' id='LC1'>Boost Software License - Version 1.0 - August 17th, 2003</div><div class='line' id='LC2'><br/></div><div class='line' id='LC3'>Permission is hereby granted, free of charge, to any person or organization</div><div class='line' id='LC4'>obtaining a copy of the software and accompanying documentation covered by</div><div class='line' id='LC5'>this license (the &quot;Software&quot;) to use, reproduce, display, distribute,</div><div class='line' id='LC6'>execute, and transmit the Software, and to prepare derivative works of the</div><div class='line' id='LC7'>Software, and to permit third-parties to whom the Software is furnished to</div><div class='line' id='LC8'>do so, all subject to the following:</div><div class='line' id='LC9'><br/></div><div class='line' id='LC10'>The copyright notices in the Software and this entire statement, including</div><div class='line' id='LC11'>the above license grant, this restriction and the following disclaimer,</div><div class='line' id='LC12'>must be included in all copies of the Software, in whole or in part, and</div><div class='line' id='LC13'>all derivative works of the Software, unless such copies or derivative</div><div class='line' id='LC14'>works are solely in the form of machine-executable object code generated by</div><div class='line' id='LC15'>a source language processor.</div><div class='line' id='LC16'><br/></div><div class='line' id='LC17'>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</div><div class='line' id='LC18'>IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</div><div class='line' id='LC19'>FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT</div><div class='line' id='LC20'>SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE</div><div class='line' id='LC21'>FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,</div><div class='line' id='LC22'>ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</div><div class='line' id='LC23'>DEALINGS IN THE SOFTWARE.</div></pre></div>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+
+ </div>
+
+<div class="frame frame-loading large-loading-area" style="display:none;" data-tree-list-url="/yutopp/Rart/tree-list/55bcbf1bcd91edda9960e54fb860c50d87509f6b" data-blob-url-prefix="/yutopp/Rart/blob/55bcbf1bcd91edda9960e54fb860c50d87509f6b">
+ <img src="https://a248.e.akamai.net/assets.github.com/images/spinners/octocat-spinner-64.gif?1329920549" height="64" width="64">
+</div>
+
+ </div>
+ <div class="context-overlay"></div>
+ </div>
+
+ <div id="footer-push"></div><!-- hack for sticky footer -->
+ </div><!-- end of wrapper - hack for sticky footer -->
+
+ <!-- footer -->
+ <div id="footer" >
+
+ <div class="upper_footer">
+ <div class="container clearfix">
+
+ <!--[if IE]><h4 id="blacktocat_ie">GitHub Links</h4><![endif]-->
+ <![if !IE]><h4 id="blacktocat">GitHub Links</h4><![endif]>
+
+ <ul class="footer_nav">
+ <h4>GitHub</h4>
+ <li><a href="https://github.com/about">About</a></li>
+ <li><a href="https://github.com/blog">Blog</a></li>
+ <li><a href="https://github.com/features">Features</a></li>
+ <li><a href="https://github.com/contact">Contact &amp; Support</a></li>
+ <li><a href="https://github.com/training">Training</a></li>
+ <li><a href="http://enterprise.github.com/">GitHub Enterprise</a></li>
+ <li><a href="http://status.github.com/">Site Status</a></li>
+ </ul>
+
+ <ul class="footer_nav">
+ <h4>Tools</h4>
+ <li><a href="http://get.gaug.es/">Gauges: Analyze web traffic</a></li>
+ <li><a href="http://speakerdeck.com">Speaker Deck: Presentations</a></li>
+ <li><a href="https://gist.github.com">Gist: Code snippets</a></li>
+ <li><a href="http://mac.github.com/">GitHub for Mac</a></li>
+ <li><a href="http://mobile.github.com/">Issues for iPhone</a></li>
+ <li><a href="http://jobs.github.com/">Job Board</a></li>
+ </ul>
+
+ <ul class="footer_nav">
+ <h4>Extras</h4>
+ <li><a href="http://shop.github.com/">GitHub Shop</a></li>
+ <li><a href="http://octodex.github.com/">The Octodex</a></li>
+ </ul>
+
+ <ul class="footer_nav">
+ <h4>Documentation</h4>
+ <li><a href="http://help.github.com/">GitHub Help</a></li>
+ <li><a href="http://developer.github.com/">Developer API</a></li>
+ <li><a href="http://github.github.com/github-flavored-markdown/">GitHub Flavored Markdown</a></li>
+ <li><a href="http://pages.github.com/">GitHub Pages</a></li>
+ </ul>
+
+ </div><!-- /.site -->
+ </div><!-- /.upper_footer -->
+
+<div class="lower_footer">
+ <div class="container clearfix">
+ <!--[if IE]><div id="legal_ie"><![endif]-->
+ <![if !IE]><div id="legal"><![endif]>
+ <ul>
+ <li><a href="https://github.com/site/terms">Terms of Service</a></li>
+ <li><a href="https://github.com/site/privacy">Privacy</a></li>
+ <li><a href="https://github.com/security">Security</a></li>
+ </ul>
+
+ <p>&copy; 2012 <span title="0.07515s from fe15.rs.github.com">GitHub</span> Inc. All rights reserved.</p>
+ </div><!-- /#legal or /#legal_ie-->
+
+ <div class="sponsor">
+ <a href="http://www.rackspace.com" class="logo">
+ <img alt="Dedicated Server" height="36" src="https://a248.e.akamai.net/assets.github.com/images/modules/footer/rackspaces_logo.png?1329920549" width="38" />
+ </a>
+ Powered by the <a href="http://www.rackspace.com ">Dedicated
+ Servers</a> and<br/> <a href="http://www.rackspacecloud.com">Cloud
+ Computing</a> of Rackspace Hosting<span>&reg;</span>
+ </div>
+ </div><!-- /.site -->
+</div><!-- /.lower_footer -->
+
+ </div><!-- /#footer -->
+
+
+
+<div id="keyboard_shortcuts_pane" class="instapaper_ignore readability-extra" style="display:none">
+ <h2>Keyboard Shortcuts <small><a href="#" class="js-see-all-keyboard-shortcuts">(see all)</a></small></h2>
+
+ <div class="columns threecols">
+ <div class="column first">
+ <h3>Site wide shortcuts</h3>
+ <dl class="keyboard-mappings">
+ <dt>s</dt>
+ <dd>Focus site search</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>?</dt>
+ <dd>Bring up this help dialog</dd>
+ </dl>
+ </div><!-- /.column.first -->
+
+ <div class="column middle" style='display:none'>
+ <h3>Commit list</h3>
+ <dl class="keyboard-mappings">
+ <dt>j</dt>
+ <dd>Move selection down</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>k</dt>
+ <dd>Move selection up</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>c <em>or</em> o <em>or</em> enter</dt>
+ <dd>Open commit</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>y</dt>
+ <dd>Expand URL to its canonical form</dd>
+ </dl>
+ </div><!-- /.column.first -->
+
+ <div class="column last" style='display:none'>
+ <h3>Pull request list</h3>
+ <dl class="keyboard-mappings">
+ <dt>j</dt>
+ <dd>Move selection down</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>k</dt>
+ <dd>Move selection up</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>o <em>or</em> enter</dt>
+ <dd>Open issue</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt><span class="platform-mac">⌘</span><span class="platform-other">ctrl</span> <em>+</em> enter</dt>
+ <dd>Submit comment</dd>
+ </dl>
+ </div><!-- /.columns.last -->
+
+ </div><!-- /.columns.equacols -->
+
+ <div style='display:none'>
+ <div class="rule"></div>
+
+ <h3>Issues</h3>
+
+ <div class="columns threecols">
+ <div class="column first">
+ <dl class="keyboard-mappings">
+ <dt>j</dt>
+ <dd>Move selection down</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>k</dt>
+ <dd>Move selection up</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>x</dt>
+ <dd>Toggle selection</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>o <em>or</em> enter</dt>
+ <dd>Open issue</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt><span class="platform-mac">⌘</span><span class="platform-other">ctrl</span> <em>+</em> enter</dt>
+ <dd>Submit comment</dd>
+ </dl>
+ </div><!-- /.column.first -->
+ <div class="column middle">
+ <dl class="keyboard-mappings">
+ <dt>I</dt>
+ <dd>Mark selection as read</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>U</dt>
+ <dd>Mark selection as unread</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>y</dt>
+ <dd>Remove selection from view</dd>
+ </dl>
+ </div><!-- /.column.middle -->
+ <div class="column last">
+ <dl class="keyboard-mappings">
+ <dt>c</dt>
+ <dd>Create issue</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>l</dt>
+ <dd>Create label</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>i</dt>
+ <dd>Back to inbox</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>u</dt>
+ <dd>Back to issues</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>/</dt>
+ <dd>Focus issues search</dd>
+ </dl>
+ </div>
+ </div>
+ </div>
+
+ <div style='display:none'>
+ <div class="rule"></div>
+
+ <h3>Issues Dashboard</h3>
+
+ <div class="columns threecols">
+ <div class="column first">
+ <dl class="keyboard-mappings">
+ <dt>j</dt>
+ <dd>Move selection down</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>k</dt>
+ <dd>Move selection up</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>o <em>or</em> enter</dt>
+ <dd>Open issue</dd>
+ </dl>
+ </div><!-- /.column.first -->
+ </div>
+ </div>
+
+ <div style='display:none'>
+ <div class="rule"></div>
+
+ <h3>Network Graph</h3>
+ <div class="columns equacols">
+ <div class="column first">
+ <dl class="keyboard-mappings">
+ <dt><span class="badmono">←</span> <em>or</em> h</dt>
+ <dd>Scroll left</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt><span class="badmono">→</span> <em>or</em> l</dt>
+ <dd>Scroll right</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt><span class="badmono">↑</span> <em>or</em> k</dt>
+ <dd>Scroll up</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt><span class="badmono">↓</span> <em>or</em> j</dt>
+ <dd>Scroll down</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>t</dt>
+ <dd>Toggle visibility of head labels</dd>
+ </dl>
+ </div><!-- /.column.first -->
+ <div class="column last">
+ <dl class="keyboard-mappings">
+ <dt>shift <span class="badmono">←</span> <em>or</em> shift h</dt>
+ <dd>Scroll all the way left</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>shift <span class="badmono">→</span> <em>or</em> shift l</dt>
+ <dd>Scroll all the way right</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>shift <span class="badmono">↑</span> <em>or</em> shift k</dt>
+ <dd>Scroll all the way up</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>shift <span class="badmono">↓</span> <em>or</em> shift j</dt>
+ <dd>Scroll all the way down</dd>
+ </dl>
+ </div><!-- /.column.last -->
+ </div>
+ </div>
+
+ <div >
+ <div class="rule"></div>
+ <div class="columns threecols">
+ <div class="column first" >
+ <h3>Source Code Browsing</h3>
+ <dl class="keyboard-mappings">
+ <dt>t</dt>
+ <dd>Activates the file finder</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>l</dt>
+ <dd>Jump to line</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>w</dt>
+ <dd>Switch branch/tag</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>y</dt>
+ <dd>Expand URL to its canonical form</dd>
+ </dl>
+ </div>
+ </div>
+ </div>
+
+ <div style='display:none'>
+ <div class="rule"></div>
+ <div class="columns threecols">
+ <div class="column first">
+ <h3>Browsing Commits</h3>
+ <dl class="keyboard-mappings">
+ <dt><span class="platform-mac">⌘</span><span class="platform-other">ctrl</span> <em>+</em> enter</dt>
+ <dd>Submit comment</dd>
+ </dl>
+ <dl class="keyboard-mappings">
+ <dt>escape</dt>
+ <dd>Close form</dd>
+ </dl>
+ </div>
+ </div>
+ </div>
+</div>
+
+ <div id="markdown-help" class="instapaper_ignore readability-extra">
+ <h2>Markdown Cheat Sheet</h2>
+
+ <div class="cheatsheet-content">
+
+ <div class="mod">
+ <div class="col">
+ <h3>Format Text</h3>
+ <p>Headers</p>
+ <pre>
+# This is an &lt;h1&gt; tag
+## This is an &lt;h2&gt; tag
+###### This is an &lt;h6&gt; tag</pre>
+ <p>Text styles</p>
+ <pre>
+*This text will be italic*
+_This will also be italic_
+**This text will be bold**
+__This will also be bold__
+
+*You **can** combine them*
+</pre>
+ </div>
+ <div class="col">
+ <h3>Lists</h3>
+ <p>Unordered</p>
+ <pre>
+* Item 1
+* Item 2
+ * Item 2a
+ * Item 2b</pre>
+ <p>Ordered</p>
+ <pre>
+1. Item 1
+2. Item 2
+3. Item 3
+ * Item 3a
+ * Item 3b</pre>
+ </div>
+ <div class="col">
+ <h3>Miscellaneous</h3>
+ <p>Images</p>
+ <pre>
+![GitHub Logo](/images/logo.png)
+Format: ![Alt Text](url)
+</pre>
+ <p>Links</p>
+ <pre>
+http://github.com - automatic!
+[GitHub](http://github.com)</pre>
+<p>Blockquotes</p>
+ <pre>
+As Kanye West said:
+
+> We're living the future so
+> the present is our past.
+</pre>
+ </div>
+ </div>
+ <div class="rule"></div>
+
+ <h3>Code Examples in Markdown</h3>
+ <div class="col">
+ <p>Syntax highlighting with <a href="http://github.github.com/github-flavored-markdown/" title="GitHub Flavored Markdown" target="_blank">GFM</a></p>
+ <pre>
+```javascript
+function fancyAlert(arg) {
+ if(arg) {
+ $.facebox({div:'#foo'})
+ }
+}
+```</pre>
+ </div>
+ <div class="col">
+ <p>Or, indent your code 4 spaces</p>
+ <pre>
+Here is a Python code example
+without syntax highlighting:
+
+ def foo:
+ if not bar:
+ return true</pre>
+ </div>
+ <div class="col">
+ <p>Inline code for comments</p>
+ <pre>
+I think you should use an
+`&lt;addr&gt;` element here instead.</pre>
+ </div>
+ </div>
+
+ </div>
+</div>
+
+
+ <div class="ajax-error-message">
+ <p><span class="icon"></span> Something went wrong with that request. Please try again. <a href="javascript:;" class="ajax-error-dismiss">Dismiss</a></p>
+ </div>
+
+ <div id="logo-popup">
+ <h2>Looking for the GitHub logo?</h2>
+ <ul>
+ <li>
+ <h4>GitHub Logo</h4>
+ <a href="http://github-media-downloads.s3.amazonaws.com/GitHub_Logos.zip"><img alt="Github_logo" src="https://a248.e.akamai.net/assets.github.com/images/modules/about_page/github_logo.png?1329920549" /></a>
+ <a href="http://github-media-downloads.s3.amazonaws.com/GitHub_Logos.zip" class="minibutton btn-download download"><span><span class="icon"></span>Download</span></a>
+ </li>
+ <li>
+ <h4>The Octocat</h4>
+ <a href="http://github-media-downloads.s3.amazonaws.com/Octocats.zip"><img alt="Octocat" src="https://a248.e.akamai.net/assets.github.com/images/modules/about_page/octocat.png?1329920549" /></a>
+ <a href="http://github-media-downloads.s3.amazonaws.com/Octocats.zip" class="minibutton btn-download download"><span><span class="icon"></span>Download</span></a>
+ </li>
+ </ul>
+ </div>
+
+
+
+
+ <span id='server_response_time' data-time='0.07739' data-host='fe15'></span>
+ </body>
+</html>
+
31 README
@@ -0,0 +1,31 @@
+--------------------------------
+--* Yuto's tekitou libraries *--
+--------------------------------
+�Ă��Ƃ��ȃ��C�u�����̎����ł��B
+
+
++++ Contents +++
+- msvc_project
+ Contain MSVC10 project files.
+
+- ytl
+ - assembler
+ This library can generate machine code.
+ (It's under construction... Please give me advice!)
+
+
++++ The future plans +++
+- Expansion of the assembler library
+- Add Samples
+- Add the GC library
+
+
++++ Author +++
+@yutopp
+
+
++++ License +++
+Copyright yutopp 2012.
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
20 msvc_project/ytl/ytl.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual C++ Express 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytl", "ytl.vcxproj", "{25902D79-D968-416B-8BEF-CCFC76F8E9B0}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {25902D79-D968-416B-8BEF-CCFC76F8E9B0}.Debug|Win32.ActiveCfg = Debug|Win32
+ {25902D79-D968-416B-8BEF-CCFC76F8E9B0}.Debug|Win32.Build.0 = Debug|Win32
+ {25902D79-D968-416B-8BEF-CCFC76F8E9B0}.Release|Win32.ActiveCfg = Release|Win32
+ {25902D79-D968-416B-8BEF-CCFC76F8E9B0}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
79 msvc_project/ytl/ytl.vcxproj
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{25902D79-D968-416B-8BEF-CCFC76F8E9B0}</ProjectGuid>
+ <RootNamespace>ytl</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup />
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\ytl\assembler.hpp" />
+ <ClInclude Include="..\..\ytl\assembler\arch.hpp" />
+ <ClInclude Include="..\..\ytl\assembler\arch\ia_32.hpp" />
+ <ClInclude Include="..\..\ytl\assembler\arch\ia_32\address.hpp" />
+ <ClInclude Include="..\..\ytl\assembler\arch\ia_32\aliginment.hpp" />
+ <ClInclude Include="..\..\ytl\assembler\arch\ia_32\data_types.hpp" />
+ <ClInclude Include="..\..\ytl\assembler\arch\ia_32\generator.hpp" />
+ <ClInclude Include="..\..\ytl\assembler\arch\ia_32\registers.hpp" />
+ <ClInclude Include="..\..\ytl\assembler\code_stub.hpp" />
+ <ClInclude Include="..\..\ytl\assembler\config.hpp" />
+ <ClInclude Include="..\..\ytl\assembler\detail\little_endian_writer.hpp" />
+ <ClInclude Include="..\..\ytl\assembler\writer.hpp" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
59 msvc_project/ytl/ytl.vcxproj.filters
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="ヘッダー ファイル">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="ヘッダー ファイル\assembler">
+ <UniqueIdentifier>{c22201e9-8b92-4876-86e5-7193934c7855}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="ヘッダー ファイル\assembler\detail">
+ <UniqueIdentifier>{6c3ccc41-216e-49d0-87fc-f471d5774cb0}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="ヘッダー ファイル\assembler\arch">
+ <UniqueIdentifier>{8b0d167f-29dd-4a02-8db2-0e57b174a120}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="ヘッダー ファイル\assembler\arch\ia_32">
+ <UniqueIdentifier>{ee077899-0027-4527-ae44-dbbe1caa0e42}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\ytl\assembler\arch.hpp">
+ <Filter>ヘッダー ファイル\assembler</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\ytl\assembler\code_stub.hpp">
+ <Filter>ヘッダー ファイル\assembler</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\ytl\assembler\config.hpp">
+ <Filter>ヘッダー ファイル\assembler</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\ytl\assembler\writer.hpp">
+ <Filter>ヘッダー ファイル\assembler</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\ytl\assembler.hpp">
+ <Filter>ヘッダー ファイル</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\ytl\assembler\detail\little_endian_writer.hpp">
+ <Filter>ヘッダー ファイル\assembler\detail</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\ytl\assembler\arch\ia_32.hpp">
+ <Filter>ヘッダー ファイル\assembler\arch</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\ytl\assembler\arch\ia_32\address.hpp">
+ <Filter>ヘッダー ファイル\assembler\arch\ia_32</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\ytl\assembler\arch\ia_32\aliginment.hpp">
+ <Filter>ヘッダー ファイル\assembler\arch\ia_32</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\ytl\assembler\arch\ia_32\data_types.hpp">
+ <Filter>ヘッダー ファイル\assembler\arch\ia_32</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\ytl\assembler\arch\ia_32\generator.hpp">
+ <Filter>ヘッダー ファイル\assembler\arch\ia_32</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\ytl\assembler\arch\ia_32\registers.hpp">
+ <Filter>ヘッダー ファイル\assembler\arch\ia_32</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
3  msvc_project/ytl/ytl.vcxproj.user
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project>
2  ytl/assembler.hpp
@@ -0,0 +1,2 @@
+#include "assembler/arch.hpp"
+#include "assembler/code_stub.hpp"
1  ytl/assembler/arch.hpp
@@ -0,0 +1 @@
+#include "arch/ia_32.hpp"
3  ytl/assembler/arch/ia_32.hpp
@@ -0,0 +1,3 @@
+#include "../config.hpp"
+
+#include "ia_32/generator.hpp"
263 ytl/assembler/arch/ia_32/address.hpp
@@ -0,0 +1,263 @@
+#ifndef YTL_ASSEMBLER_IA32_ADDRESS_HPP
+#define YTL_ASSEMBLER_IA32_ADDRESS_HPP
+
+#include "../../config.hpp"
+
+#include "data_types.hpp"
+#include "registers.hpp"
+
+#include <boost/variant.hpp>
+
+namespace ytd
+{
+ namespace assembler
+ {
+ namespace ia_32
+ {
+ /*
+ displacement value
+ */
+ template<typename ValueT>
+ struct disp_value
+ {
+ typedef ValueT value_type;
+
+ explicit disp_value( value_type disp )
+ : reg_( registers::detail::id<32>( 4 ) /* 0b100 : [--][--] SIB */ )
+ , value_( disp ) {}
+
+ disp_value( registers::detail::id<32> reg, value_type disp )
+ : reg_( reg )
+ , value_( disp ) {}
+
+ registers::detail::id<32> reg_; // memorize target register
+ value_type value_;
+ };
+
+ typedef disp_value<byte_value> disp8_value; // 8bit displacement
+ typedef disp_value<dword_value> disp32_value; // 32bit displacement
+
+ /*
+ */
+ struct sib_value
+ {
+ sib_value(
+ byte_t ss,
+ registers::detail::id<32> index,
+ registers::detail::id<32> base = registers::detail::id<32>( 4 ) /* 0b100 : none */
+ )
+ : ss_( ss )
+ , index_( index )
+ , base_( base ) {}
+
+ byte_t ss_;
+ registers::detail::id<32> index_, base_;
+ };
+
+ /*
+ */
+ template<typename ValueT>
+ struct sib_disp_value
+ {
+ typedef ValueT value_type;
+
+ explicit sib_disp_value( sib_value const& sib, value_type disp )
+ : sib_( sib )
+ , disp_( disp ) {}
+
+ sib_value sib_;
+ value_type disp_;
+ };
+ typedef sib_disp_value<byte_value> sib_disp8_value; // sib & 8bit displacement
+ typedef sib_disp_value<dword_value> sib_disp32_value; // sib & 32bit displacement
+
+
+ namespace registers
+ {
+ /*
+ disp scales : REG +- disp
+ */
+ disp8_value operator+( registers::detail::id<32> const& reg, byte_value disp )
+ {
+ return disp8_value( reg, disp );
+ }
+ disp8_value operator-( registers::detail::id<32> const& reg, byte_value disp )
+ {
+ return disp8_value( reg, byte_value( ~disp.value_ + 1 ) );
+ }
+
+ disp32_value operator+( registers::detail::id<32> const& reg, int disp )
+ {
+ return disp32_value( reg, disp );
+ }
+ disp32_value operator-( registers::detail::id<32> const& reg, int disp )
+ {
+ return disp32_value( reg, ~disp + 1 ); // buggy?
+ }
+
+ /*
+ sib disp scales : BASE + REG * n +- disp
+ */
+ sib_disp8_value operator+( sib_value const& sib, byte_value disp )
+ {
+ return sib_disp8_value( sib, disp );
+ }
+ sib_disp8_value operator-( sib_value const& sib, byte_value disp )
+ {
+ return sib_disp8_value( sib, byte_value( ~disp.value_ + 1 ) );
+ }
+
+ sib_disp32_value operator+( sib_value const& sib, int disp )
+ {
+ return sib_disp32_value( sib, disp );
+ }
+ sib_disp32_value operator-( sib_value const& sib, int disp )
+ {
+ return sib_disp32_value( sib, ~disp + 1 ); // buggy?
+ }
+
+ /*
+ SIB scales
+ */
+ sib_value operator*( registers::detail::id<32> const& reg, int scale ) // REG * n
+ {
+ assert( scale == 0 || scale == 1 || scale == 2 || scale == 4 );
+
+ return sib_value( scale==0 ? 0 : scale==1 ? 1 : scale==2 ? 2 : scale==4 ? 3 : throw/*unreachable*/, reg );
+ }
+
+ sib_value operator+( registers::detail::id<32> const& base, sib_value const& sib ) // BASE + REG * n
+ {
+ return sib_value( sib.ss_, sib.index_, base );
+ }
+ } // namespace registers
+
+ /*
+ */
+ struct mod_rm
+ {
+ mod_rm( byte_t mod, byte_t rm )
+ : mod_( mod )
+ , rm_( rm )
+ {}
+
+ template<unsigned int N>
+ mod_rm( registers::detail::id<N> reg ) // implicit
+ : mod_( 3/*0b11*/ )
+ , rm_( reg )
+ {}
+
+ byte_t mod_, rm_; //reg or opcode field id determined later.
+ };
+
+
+ template<typename DispT>
+ struct mod_rm_disp
+ : public mod_rm
+ {
+ typedef typename DispT::value_type value_type;
+
+ mod_rm_disp( byte_t mod, DispT const& disp )
+ : mod_rm( mod, disp.reg_ )
+ , disp_( disp.value_ )
+ {}
+
+
+ mod_rm_disp( byte_t mod, byte_t rm, value_type disp_value )
+ : mod_rm( mod, rm )
+ , disp_( disp_value )
+ {}
+
+ value_type disp_;
+ };
+ typedef mod_rm_disp<disp8_value> mod_rm_disp8;
+ typedef mod_rm_disp<disp32_value> mod_rm_disp32;
+
+
+ struct mod_rm_sib
+ : public mod_rm
+ {
+ mod_rm_sib( byte_t mod, byte_t rm, sib_value const& sib )
+ : mod_rm( mod, rm )
+ , sib_( sib )
+ {}
+
+ sib_value sib_;
+ };
+
+
+ template<typename DispT>
+ struct mod_rm_sib_disp
+ : public mod_rm
+ {
+ typedef sib_disp_value<typename DispT::value_type> value_type;
+
+ mod_rm_sib_disp( byte_t mod, byte_t rm, value_type const& disp_value )
+ : mod_rm( mod, rm )
+ , sib_disp_( disp_value )
+ {}
+
+ value_type sib_disp_;
+ };
+ typedef mod_rm_sib_disp<disp8_value> mod_rm_sib_disp8;
+ typedef mod_rm_sib_disp<disp32_value> mod_rm_sib_disp32;
+
+
+ typedef boost::variant<
+ mod_rm, // only mod_rm field
+ mod_rm_disp8, // mod_rm & disp(1Byte) field
+ mod_rm_disp32, // mod_rm & disp(4Byte) field
+ mod_rm_sib,
+ mod_rm_sib_disp8,
+ mod_rm_sib_disp32
+ > addressing;
+
+
+ /*
+ */
+ typedef detail::value_wrapper<addressing, byte_t> r_m8;
+ typedef detail::value_wrapper<addressing, word_t> r_m16;
+ typedef detail::value_wrapper<addressing, dword_t> r_m32;
+
+ struct r_m32_implicit
+ : public detail::value_wrapper<addressing, dword_t>
+ {
+ r_m32_implicit( r_m32 value ) // implicit
+ : value_wrapper( value ) {}
+
+ r_m32_implicit( addressing value ) // implicit
+ : value_wrapper( value ) {}
+
+ r_m32_implicit( registers::detail::id<32> reg ) // implicit
+ : value_wrapper( mod_rm( reg ) ) {}
+ };
+
+
+ namespace detail
+ {
+ inline byte_t make_mod_rm( byte_t const mod, byte_t const op_code, byte_t const rm )
+ {
+ return ( mod << 6 & 0xc0 ) | ( op_code << 3 & 0x38 ) | ( rm & 0x07 );
+ }
+
+ inline byte_t make_mod_rm( byte_t const op_code, byte_t const rm )
+ {
+ return make_mod_rm( 3, op_code, rm );
+ }
+
+ inline byte_t make_mod_rm( mod_rm const& mod_rm_value, registers::detail::id<32> const& reg )
+ {
+ return make_mod_rm( mod_rm_value.mod_, reg, mod_rm_value.rm_ );
+ }
+
+ inline byte_t make_sib( byte_t const ss, registers::detail::id<32> const index, registers::detail::id<32> const& base )
+ {
+ return ( ss << 6 & 0xc0 ) | ( index << 3 & 0x38 ) | ( base & 0x07 );
+ }
+ } // namespace detail
+
+ } // namespace ia_32
+ } // namespace assembler
+} // namespace ytd
+
+#endif /*YTL_ASSEMBLER_IA32_ADDRESS_HPP*/
123 ytl/assembler/arch/ia_32/aliginment.hpp
@@ -0,0 +1,123 @@
+#ifndef YTL_ASSEMBLER_IA32_ALIGINMENT_HPP
+#define YTL_ASSEMBLER_IA32_ALIGINMENT_HPP
+
+#include "../../config.hpp"
+
+#include "registers.hpp"
+#include "data_types.hpp"
+#include "address.hpp"
+
+namespace ytd
+{
+ namespace assembler
+ {
+ namespace ia_32
+ {
+ /*
+ alignment annotation
+ */
+ namespace alignment
+ {
+ /*
+ 32bit pointer annotation
+ */
+ static const struct pointer_mod_rm_annotation
+ {
+ // Mod 0b00
+ r_m32 operator[]( registers::detail::id<32> reg ) const
+ {
+ assert( reg != registers::esp && reg != registers::ebp );
+ return r_m32( mod_rm( 0, reg ) );
+ }
+ r_m32 operator[]( dword_value disp ) const
+ {
+ return r_m32( mod_rm_disp32( 0, 5/*0b101*/, disp ) );
+ }
+ r_m32 operator[]( sib_value const& sib ) const
+ {
+ return r_m32( mod_rm_sib( 0, 4/*0b100*/, sib ) );
+ }
+
+ // Mod 0b01
+ r_m32 operator[]( disp8_value const& disp ) const
+ {
+ assert( disp.reg_ != registers::esp );
+ return r_m32( mod_rm_disp8( 1/*0b01*/, disp ) );
+ }
+ r_m32 operator[]( sib_disp8_value const& sib_disp ) const
+ {
+ assert( sib_disp.sib_.base_ != registers::ebp && sib_disp.sib_.index_ != registers::esp );
+ return r_m32( mod_rm_sib_disp8( 1/*0b01*/, 4/*0b100*/, sib_disp ) );
+ }
+
+ // Mod 0b10
+ r_m32 operator[]( disp32_value const& disp ) const
+ {
+ assert( disp.reg_ != registers::esp );
+ return r_m32( mod_rm_disp32( 2/*0b10*/, disp ) );
+ }
+
+ r_m32 operator[]( sib_disp32_value const& sib_disp ) const
+ {
+ assert( sib_disp.sib_.base_ != registers::ebp && sib_disp.sib_.index_ != registers::esp );
+ return r_m32( mod_rm_sib_disp32( 2/*0b10*/, 4/*0b100*/, sib_disp ) );
+ }
+
+ // Mod 0b11
+ // -> see address.hpp class mod_rm's implicit ctor
+ } ptr;
+
+ /*
+ */
+ static const struct byte_value_annotation
+ {
+ byte_value operator[]( byte_t value ) const
+ {
+ return byte_value( value );
+ }
+
+ template<typename T>
+ r_m8 operator[]( detail::value_wrapper<addressing, T> const& r_mN ) const
+ {
+ return r_m8( r_mN.value_ );
+ }
+ } byte;
+
+ /*
+ */
+ static const struct word_value_annotation
+ {
+ word_value operator[]( word_t value ) const
+ {
+ return word_value( value );
+ }
+
+ template<typename T>
+ r_m16 operator[]( detail::value_wrapper<addressing, T> const& r_mN ) const
+ {
+ return r_m16( r_mN.value_ );
+ }
+ } word;
+
+ /*
+ */
+ static const struct dword_value_annotation
+ {
+ dword_value operator[]( dword_t value ) const
+ {
+ return dword_value( value );
+ }
+
+ template<typename T>
+ r_m32 operator[]( detail::value_wrapper<addressing, T> const& r_mN ) const
+ {
+ return r_m32( r_mN.value_ );
+ }
+ } dword;
+
+ } // namespace alignment
+ } // namespace ia_32
+ } // namespace assembler
+} // namespace ytd
+
+#endif /*YTL_ASSEMBLER_IA32_ALIGINMENT_HPP*/
50 ytl/assembler/arch/ia_32/data_types.hpp
@@ -0,0 +1,50 @@
+#ifndef YTL_ASSEMBLER_IA32_DATA_TYPE_HPP
+#define YTL_ASSEMBLER_IA32_DATA_TYPE_HPP
+
+#include "../../config.hpp"
+
+namespace ytd
+{
+ namespace assembler
+ {
+ namespace ia_32
+ {
+ namespace detail
+ {
+ template<typename T, typename U = void>
+ struct value_wrapper
+ {
+ typedef T value_type;
+
+ explicit value_wrapper( value_type value )
+ : value_( value ) {}
+
+ operator value_type() const { return value_; }
+
+ value_type value_;
+ };
+ } // namespace detail
+
+
+ /*
+ 8bit/16bit/32bit value wrappers
+ */
+ typedef detail::value_wrapper<byte_t> byte_value;
+ typedef detail::value_wrapper<word_t> word_value;
+ struct dword_value
+ : public detail::value_wrapper<dword_t>
+ {
+ dword_value( dword_t value ) // implicit
+ : value_wrapper( value ) {}
+
+ dword_value( byte_value value ) // implicit
+ : value_wrapper( value.value_ ) {}
+ dword_value( word_value value ) // implicit
+ : value_wrapper( value.value_ ) {}
+ };
+
+ } // namespace ia_32
+ } // namespace assembler
+} // namespace ytd
+
+#endif /*YTL_ASSEMBLER_IA32_DATA_TYPE_HPP*/
482 ytl/assembler/arch/ia_32/generator.hpp
@@ -0,0 +1,482 @@
+#ifndef YTL_ASSEMBLER_IA32_GENERATOR_HPP
+#define YTL_ASSEMBLER_IA32_GENERATOR_HPP
+
+#include "../../config.hpp"
+#include "../../writer.hpp"
+
+#include "registers.hpp"
+#include "data_types.hpp"
+#include "aliginment.hpp"
+#include "address.hpp"
+
+#include <cassert>
+#include <memory>
+
+#include <iostream>
+
+#define TYPICAL_OPERATOR( \
+ name, \
+ op8accimm8, \
+ op16_32accimm16_32, \
+ op_code, \
+ oprm8imm8, \
+ oprm16_32imm16_32, \
+ oprm16_32imm8, \
+ oprm8r8, \
+ oprm16_32r16_32, \
+ opr8rm8, \
+ opr16_32rm16_32 \
+ ) \
+ /* name AL, imm8 */ \
+ void name( registers::detail::id<8> dst, dword_value src ) \
+ { \
+ if ( dst == registers::al ) { \
+ db( op8accimm8 ); \
+ db( src ); \
+ } else { \
+ name( r_m8( mod_rm( dst ) ), byte_value( src ) ); \
+ } \
+ } \
+ /* name AX, imm16 */ \
+ void name( registers::detail::id<16> dst, dword_value src ) \
+ { \
+ if ( dst == registers::ax ) { \
+ db( op16_32accimm16_32 ); \
+ dw( src ); \
+ } else { \
+ name( r_m16( mod_rm( dst ) ), byte_value( src ) ); \
+ } \
+ } \
+ /* name EAX, imm32 */ \
+ void name( registers::detail::id<32> dst, dword_value src ) \
+ { \
+ if ( dst == registers::eax ) { \
+ db( op16_32accimm16_32 ); \
+ dd( src ); \
+ } else { \
+ name( r_m32( mod_rm( dst ) ), src ); \
+ } \
+ } \
+ /* name r/m8, imm8 */ \
+ void name( r_m8 dst, byte_value src ) \
+ { \
+ db( oprm8imm8 ); \
+ dmod_rm_sib_disp( dst, op_code ); \
+ db( src ); \
+ } \
+ /* name r/m16, imm16 */ \
+ void name( r_m16 dst, word_value src ) \
+ { \
+ db( oprm16_32imm16_32 ); \
+ dmod_rm_sib_disp( dst, op_code ); \
+ dw( src ); \
+ } \
+ /* name r/m32, imm32 */ \
+ void name( r_m32 dst, dword_value src ) \
+ { \
+ db( oprm16_32imm16_32 ); \
+ dmod_rm_sib_disp( dst, op_code ); \
+ dd( src ); \
+ } \
+ /* name r/m16, imm8 */ \
+ void name( r_m16 dst, byte_value src ) \
+ { \
+ db( oprm16_32imm8 ); \
+ dmod_rm_sib_disp( dst, 0 ); \
+ db( src ); \
+ } \
+ /* name r/m32, imm8 */ \
+ void name( r_m32 dst, byte_value src ) \
+ { \
+ db( oprm16_32imm8 ); \
+ dmod_rm_sib_disp( dst, 0 ); \
+ db( src ); \
+ } \
+ /* name r/m8, r8 */ \
+ void name( r_m8 dst, registers::detail::id<8> src ) \
+ { \
+ db( oprm8r8 ); \
+ dmod_rm_sib_disp( dst, src ); \
+ } \
+ /* name r/m16, r16 */ \
+ void name( r_m16 dst, registers::detail::id<16> src ) \
+ { \
+ db( oprm16_32r16_32 ); \
+ dmod_rm_sib_disp( dst, src ); \
+ } \
+ /* name r/m32, r32 */ \
+ void name( r_m32_implicit dst, registers::detail::id<32> src ) \
+ { \
+ db( oprm16_32r16_32 ); \
+ dmod_rm_sib_disp( dst, src ); \
+ } \
+ /* name r8, r/m8 */ \
+ void name( registers::detail::id<8> dst, r_m8 src ) \
+ { \
+ db( opr8rm8 ); \
+ dmod_rm_sib_disp( src, dst ); \
+ } \
+ /* name r16, r/m16 */ \
+ void name( registers::detail::id<16> dst, r_m16 src ) \
+ { \
+ db( opr16_32rm16_32 ); \
+ dmod_rm_sib_disp( src ,dst ); \
+ } \
+ /* name r32, r/m32 */ \
+ void name( registers::detail::id<32> dst, r_m32 src ) \
+ { \
+ db( opr16_32rm16_32 ); \
+ dmod_rm_sib_disp( src, dst ); \
+ }
+
+
+namespace ytd
+{
+ namespace assembler
+ {
+ namespace ia_32
+ {
+ template<typename Buffer, typename Writter = assembler::detail::little_endian_writer>
+ class generator
+ {
+ typedef generator self_type;
+
+ typedef Buffer buffer_type;
+ typedef Writter writter_type;
+
+ public:
+ /*
+ */
+ generator( buffer_type& buffer )
+ : index_( 0u )
+ , buffer_( buffer )
+ {}
+
+
+ /*
+ */
+ buffer_type const& get_buffer() const
+ {
+ return buffer_;
+ }
+
+ // --------------------------------------------
+ void db( byte_t v ) { write( v ); }
+ void dw( word_t v ) { write( v ); }
+ void dd( dword_t v ){ write( v ); }
+
+ // Mnemonic --------------------------------------------
+
+ // -- A --
+
+ // AAA
+ void aaa()
+ {
+ db( 0x37 );
+ }
+
+
+ // AAD
+ void aad()
+ {
+ db( 0xd5 );
+ db( 0x0a );
+ }
+ /*// AAD ib
+ void aad( byte_value dst )
+ {
+ db( 0xd5 );
+ db( dst );
+ }*/
+
+
+ // AAM
+ void aam()
+ {
+ db( 0xd4 );
+ db( 0x0a );
+ }
+ /*// AAM ib
+ void aam( byte_value dst )
+ {
+ db( 0xD4 );
+ db( dst );
+ }*/
+
+
+ // AAS
+ void aas()
+ {
+ db( 0x3f );
+ }
+
+
+ // ADD
+ TYPICAL_OPERATOR( add, 0x04, 0x05, 0, 0x80, 0x81, 0x83, 0x00, 0x01, 0x02, 0x03 );
+
+ // -- B --
+ // -- C --
+ // -- D --
+ // -- E --
+ // -- F --
+ // -- G --
+ // -- H --
+ // -- I --
+ // -- J --
+ // -- K --
+ // -- L --
+ // -- M --
+ void mov( r_m8 dst, registers::detail::id<8> src )
+ {}
+
+ void mov( r_m16 dst, registers::detail::id<16> src )
+ {}
+
+ void mov( r_m32_implicit dst, registers::detail::id<32> src )
+ {
+ db( 0x89 );
+ dmod_rm_sib_disp( dst, src );
+ }
+
+ void mov( registers::detail::id<8> dst, r_m8 src )
+ {}
+
+ void mov( registers::detail::id<16> dst, r_m16 src )
+ {}
+
+ void mov( registers::detail::id<32> dst, r_m32 src )
+ {
+ db( 0x8B );
+ dmod_rm_sib_disp( src, dst );
+ }
+
+ void mov( registers::detail::id<8> dst, byte_value src )
+ {
+ db( 0xb0 + dst );
+ dd( src );
+ }
+ void mov( registers::detail::id<16> dst, word_value src )
+ {
+ db( 0xb8 + dst );
+ dd( src );
+ }
+ void mov( registers::detail::id<32> dst, dword_value src )
+ {
+ db( 0xb8 + dst );
+ dd( src );
+ }
+
+ // -- N --
+ void not( registers::detail::id<32> reg ) {
+ }
+
+ // -- O --
+
+ //
+ // -- P --
+ //
+
+ //
+ void pop( registers::detail::id<32> reg )
+ {
+ db( 0x58 + reg );
+ }
+
+ // PUSH
+ void push( registers::detail::id<16> reg )
+ {
+ db( 0x50 + reg );
+ }
+
+ void push( registers::detail::id<32> reg )
+ {
+ db( 0x50 + reg );
+ }
+
+ void push( byte_value value )
+ {
+ db( 0x6a );
+ db( value );
+ }
+
+ void push( word_value value )
+ {
+ db( 0x68 );
+ dw( value );
+ }
+
+ void push( dword_value value )
+ {
+ db( 0x68 );
+ dw( value );
+ }
+
+ // -- Q --
+ // -- R --
+ void ret()
+ {
+ db( 0xc3 );
+ }
+
+ // -- S --
+
+ // SUB
+ void sub( registers::detail::id<8> dst, dword_value src )
+ {
+ if ( dst == registers::al ) {
+ db( 0x2c );
+ db( byte_value( src ) );
+
+ } else {
+ sub( r_m8( mod_rm( dst ) ), byte_value( src ) );
+ }
+ }
+
+ void sub( registers::detail::id<16> dst, dword_value src )
+ {
+ if ( dst == registers::ax ) {
+ db( 0x2d );
+ dw( word_value( src ) );
+
+ } else {
+ sub( r_m16( mod_rm( dst ) ), word_value( src ) );
+ }
+ }
+
+ void sub( registers::detail::id<32> dst, dword_value src )
+ {
+ if ( dst == registers::eax ) {
+ db( 0x2d );
+ dd( src );
+
+ } else {
+ sub( r_m32( mod_rm( dst ) ), src );
+ }
+ }
+
+ void sub( r_m8 dst, byte_value src )
+ {
+ db( 0x80 );
+ dmod_rm_sib_disp( dst, 5 );
+ db( src );
+ }
+
+ void sub( r_m16 dst, word_value src )
+ {
+ db( 0x81 );
+ dmod_rm_sib_disp( dst, 5 );
+ dw( src );
+ }
+
+ void sub( r_m32 dst, dword_value src )
+ {
+ db( 0x81 );
+ dmod_rm_sib_disp( dst, 5 );
+ dd( src );
+ }
+
+ void sub( registers::detail::id<16> dst, byte_value src )
+ {
+ db( 0x83 );
+ db( make_mod_rm( 5, dst ) );
+ db( src );
+ }
+
+ void sub( registers::detail::id<32> dst, byte_value src )
+ {
+ db( 0x83 );
+ db( make_mod_rm( 0/*unused*/, 5, dst ) );
+ db( src );
+ }
+
+ // -- T --
+ // -- U --
+ // -- V --
+ // -- W --
+ // -- X --
+ // -- Y --
+ // -- Z --
+
+
+
+ private:
+ template<typename T>
+ void write( T const& value )
+ {
+ typename writter_type::write( &buffer_[0] + index_, std::addressof( value ) );
+ index_ += sizeof( value );
+ }
+
+ template<typename T>
+ class mod_rm_sib_disp_visitor
+ : public boost::static_visitor<void>
+ {
+ public:
+ mod_rm_sib_disp_visitor( byte_t reg_op, T* generator_ptr )
+ : reg_op_( reg_op )
+ , generator_ptr_( generator_ptr )
+ {}
+
+ void operator()( mod_rm const& v ) const
+ {
+ generator_ptr_->db( detail::make_mod_rm( v.mod_, reg_op_, v.rm_ ) );
+ }
+
+ void operator()( mod_rm_disp8 const& v ) const
+ {
+ generator_ptr_->db( detail::make_mod_rm( v.mod_, reg_op_, v.rm_ ) );
+ generator_ptr_->db( v.disp_ );
+ }
+
+ void operator()( mod_rm_disp32 const& v ) const
+ {
+ generator_ptr_->db( detail::make_mod_rm( v.mod_, reg_op_, v.rm_ ) );
+ generator_ptr_->dd( v.disp_ );
+ }
+
+ void operator()( mod_rm_sib const& v ) const
+ {
+ generator_ptr_->db( detail::make_mod_rm( v.mod_, reg_op_, v.rm_ ) );
+ generator_ptr_->db( detail::make_sib( v.sib_.ss_, v.sib_.index_, v.sib_.base_ ) );
+ }
+
+ void operator()( mod_rm_sib_disp8 const& v ) const
+ {
+ generator_ptr_->db( detail::make_mod_rm( v.mod_, reg_op_, v.rm_ ) );
+ generator_ptr_->db( detail::make_sib( v.sib_disp_.sib_.ss_, v.sib_disp_.sib_.index_, v.sib_disp_.sib_.base_ ) );
+ generator_ptr_->db( v.sib_disp_.disp_ );
+ }
+
+ void operator()( mod_rm_sib_disp32 const& v ) const
+ {
+ generator_ptr_->db( detail::make_mod_rm( v.mod_, reg_op_, v.rm_ ) );
+ generator_ptr_->db( detail::make_sib( v.sib_disp_.sib_.ss_, v.sib_disp_.sib_.index_, v.sib_disp_.sib_.base_ ) );
+ generator_ptr_->dd( v.sib_disp_.disp_ );
+ }
+
+ private:
+ byte_t reg_op_;
+ T* generator_ptr_;
+ };
+ template<typename T, unsigned int N>
+ void dmod_rm_sib_disp( T const& data, registers::detail::id<N> reg )
+ {
+ boost::apply_visitor( mod_rm_sib_disp_visitor<self_type>( reg, this ), data.value_ );
+ }
+ template<typename T>
+ void dmod_rm_sib_disp( T const& data, byte_t op_code )
+ {
+ boost::apply_visitor( mod_rm_sib_disp_visitor<self_type>( op_code, this ), data.value_ );
+ }
+
+ std::size_t index_;
+ buffer_type& buffer_;
+ };
+
+ } // namespece ia_32
+ } // namespace assembler
+} // namespace ytd
+
+#undef TYPICAL_OPERATOR
+
+#endif /*YTL_ASSEMBLER_IA32_GENERATOR_HPP*/
73 ytl/assembler/arch/ia_32/registers.hpp
@@ -0,0 +1,73 @@
+#ifndef YTL_ASSEMBLER_IA32_REGISTERS_HPP
+#define YTL_ASSEMBLER_IA32_REGISTERS_HPP
+
+#include "../../config.hpp"
+
+namespace ytd
+{
+ namespace assembler
+ {
+ namespace ia_32
+ {
+ namespace registers
+ {
+ namespace detail
+ {
+ template<unsigned int N>
+ class id
+ {
+ public:
+ id() {} // todo : make indetermine state.
+
+ explicit id( byte_t v )
+ : v_( v ) {}
+
+ operator byte_t() const { return v_; }
+
+ private:
+ byte_t v_;
+ };
+ } // namespace detail
+
+
+ // 8bit register
+ static const detail::id<8>
+ al( 0 ),
+ cl( 1 ),
+ dl( 2 ),
+ bl( 3 ),
+ ah( 4 ),
+ ch( 5 ),
+ dh( 6 ),
+ bh( 7 );
+
+
+ // 16bit register
+ static const detail::id<16>
+ ax( 0 ),
+ cx( 1 ),
+ dx( 2 ),
+ bx( 3 ),
+ sp( 4 ),
+ bp( 5 ),
+ si( 6 ),
+ di( 7 );
+
+
+ // 32bit register
+ static const detail::id<32>
+ eax( 0 ),
+ ecx( 1 ),
+ edx( 2 ),
+ ebx( 3 ),
+ esp( 4 ),
+ ebp( 5 ),
+ esi( 6 ),
+ edi( 7 );
+
+ } // namespace registers
+ } // namespece ia_32
+ } // namespace assembler
+} // namespace ytd
+
+#endif /*YTL_ASSEMBLER_IA32_REGISTERS_HPP*/
106 ytl/assembler/code_stub.hpp
@@ -0,0 +1,106 @@
+#ifndef YTL_ASSEMBLER_CODE_STUB_HPP
+#define YTL_ASSEMBLER_CODE_STUB_HPP
+
+#include "config.hpp"
+
+#include <cstddef>
+#include <cstring>
+#include <vector>
+#include <exception>
+
+namespace ytd
+{
+ namespace assembler
+ {
+ namespace detail
+ {
+ namespace windows
+ {
+ #include <windows.h>
+ //#define win_min min
+ //#define win_max max
+ #undef min
+ #undef max
+ #undef far
+ }
+
+ template<typename T>
+ class runnable_buffer_allocator
+ {
+ public:
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef T* pointer;
+ typedef T const* const_pointer;
+ typedef T& reference;
+ typedef T const& const_reference;
+ typedef T value_type;
+
+ /*
+ */
+ template<typename U>
+ struct rebind
+ {
+ typedef runnable_buffer_allocator<U> other;
+ };
+
+ /*
+ */
+ runnable_buffer_allocator() throw() {}
+ runnable_buffer_allocator( runnable_buffer_allocator const& ) throw() {}
+ template<typename U>
+ runnable_buffer_allocator( runnable_buffer_allocator<U>& ) throw() {}
+ ~runnable_buffer_allocator() throw() {}
+
+ /*
+ */
+ pointer allocate( size_type num, void const* hint = 0 )
+ {
+ pointer const p = reinterpret_cast<pointer>(
+ windows::VirtualAlloc( NULL, num * sizeof(T), MEM_COMMIT, PAGE_EXECUTE_READWRITE )
+ );
+ if ( p == NULL )
+ throw std::bad_alloc();
+
+ return p;
+ }
+
+ void construct( pointer p, T const& value )
+ {
+ new( reinterpret_cast<void*>( p ) ) T( value );
+ }
+
+ void deallocate( pointer p, size_type num )
+ {
+ windows::VirtualFree( p, 0, MEM_RELEASE );
+ }
+
+ void destroy(pointer p)
+ {
+ p->~T();
+ }
+
+ pointer address( reference value ) const
+ {
+ return &value;
+ }
+ const_pointer address( const_reference value ) const
+ {
+ return &value;
+ }
+
+ size_type max_size() const throw()
+ {
+ return std::numeric_limits<size_t>::max() / sizeof(T);
+ }
+ };
+
+ } // namespace detail
+
+ //
+ typedef std::vector<byte_t, detail::runnable_buffer_allocator<byte_t>> code_stub;
+
+ } // namespace assembeler
+} // namespace ytd
+
+#endif /*YTL_ASSEMBLER_CODE_STUB_HPP*/
18 ytl/assembler/config.hpp
@@ -0,0 +1,18 @@
+#ifndef YTL_ASSEMBLER_CONFIG_HPP
+#define YTL_ASSEMBLER_CONFIG_HPP
+
+#include <cstddef>
+#include <cstring>
+
+namespace ytd
+{
+ namespace assembler
+ {
+ typedef unsigned char byte_t;
+ typedef unsigned short word_t;
+ typedef unsigned int dword_t;
+
+ } // namespace assembler
+} // namespace ytd
+
+#endif /*YTL_ASSEMBLER_CONFIG_HPP*/
62 ytl/assembler/detail/little_endian_writer.hpp
@@ -0,0 +1,62 @@
+#ifndef YTL_ASSEMBLER_DETAIL_LITTLE_ENDIAN_WRITER_HPP
+#define YTL_ASSEMBLER_DETAIL_LITTLE_ENDIAN_WRITER_HPP
+
+#include "../config.hpp"
+
+namespace ytd
+{
+ namespace assembler
+ {
+ namespace detail
+ {
+ /*
+ */
+ template<std::size_t N>
+ struct little_endian_writer_impl;
+
+ /*
+ */
+ struct little_endian_writer
+ {
+ template<typename T>
+ static void write( byte_t* const pointer, T const* const value )
+ {
+ little_endian_writer_impl<sizeof(T)>::write( pointer, value );
+ }
+ };
+
+
+ /*
+ */
+ template<>
+ struct little_endian_writer_impl<1>
+ {
+ static void write( byte_t* const pointer, void const* const value )
+ {
+ std::memcpy( pointer, value, 1 );
+ }
+ };
+
+ template<>
+ struct little_endian_writer_impl<2>
+ {
+ static void write( byte_t* const pointer, void const* const value )
+ {
+ std::memcpy( pointer, value, 2 );
+ }
+ };
+
+ template<>
+ struct little_endian_writer_impl<4>
+ {
+ static void write( byte_t* const pointer, void const* const value )
+ {
+ std::memcpy( pointer, value, 4 );
+ }
+ };
+
+ } // namespace detail
+ } // namespace assembler
+} // namespace ytd
+
+#endif /*YTL_ASSEMBLER_DETAIL_LITTLE_ENDIAN_WRITER_HPP*/
1  ytl/assembler/writer.hpp
@@ -0,0 +1 @@
+#include "detail/little_endian_writer.hpp"
Please sign in to comment.
Something went wrong with that request. Please try again.