ZealOS/docs/Doc/Asm.DD.html
TomAwezome 1b75d91002 Fix Mount AHCI Port selection.
Add arg to SATARep to specify drive types to show.
Add checks in AHCIPortInit to verify port signatures, add helper method to get signatures from port.
2021-08-02 16:40:05 -04:00

78 lines
6 KiB
HTML
Executable file

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
<meta name="generator" content="ZealOS V0.13">
<style type="text/css">
body {background-color:#fef1f0;}
.cF0{color:#000000;background-color:#fef1f0;}
.cF1{color:#0148a4;background-color:#fef1f0;}
.cF2{color:#3b7901;background-color:#fef1f0;}
.cF3{color:#057c7e;background-color:#fef1f0;}
.cF4{color:#bb2020;background-color:#fef1f0;}
.cF5{color:#9e42ae;background-color:#fef1f0;}
.cF6{color:#b57901;background-color:#fef1f0;}
.cF7{color:#b2b6af;background-color:#fef1f0;}
.cF8{color:#555753;background-color:#fef1f0;}
.cF9{color:#678fbb;background-color:#fef1f0;}
.cFA{color:#82bc49;background-color:#fef1f0;}
.cFB{color:#0097a2;background-color:#fef1f0;}
.cFC{color:#e26a6a;background-color:#fef1f0;}
.cFD{color:#c671bc;background-color:#fef1f0;}
.cFE{color:#c7ab00;background-color:#fef1f0;}
.cFF{color:#fef1f0;background-color:#fef1f0;}
</style>
</head>
<body>
<pre style="font-family:monospace;font-size:12pt">
<a name="l1"></a><span class=cF5> Assembler</span><span class=cF0>
<a name="l2"></a>
<a name="l3"></a>See </span><a href="https://zeal-operating-system.github.io/ZealOS/Compiler/OpCodes.DD.html#l1"><span class=cF4>::/Compiler/OpCodes.DD</span></a><span class=cF0> for opcodes. They're not standard. Some invalid insts are not flagged and some valid insts are not
<a name="l4"></a>implemented. 16-bit asm support is limited.
<a name="l5"></a>
<a name="l6"></a>Here are example instruction formats:
<a name="l7"></a> </span><span class=cF1>ADD</span><span class=cF0> </span><span class=cFC>RAX</span><span class=cF0>, </span><span class=cF9>I64</span><span class=cF0> </span><span class=cFC>FS</span><span class=cF0>:DISP[</span><span class=cFC>RSI</span><span class=cF0> + </span><span class=cFC>RDI</span><span class=cF0> * </span><span class=cFE>8</span><span class=cF0>]
<a name="l8"></a> </span><span class=cF1>ADD</span><span class=cF0> </span><span class=cFC>RAX</span><span class=cF0>, </span><span class=cF9>I64</span><span class=cF0> [DISP]
<a name="l9"></a>
<a name="l10"></a></span><span class=cF2>$</span><span class=cF0> Current compiler output pos (instruction ptr). Even works in CosmiC expressions.
<a name="l11"></a>
<a name="l12"></a></span><span class=cF2>$</span><span class=cF0> works in </span><span class=cF2>class</span><span class=cF0>es.
<a name="l13"></a> </span><span class=cF2>class MyFun
<a name="l14"></a> {
<a name="l15"></a> $ = -16;
<a name="l16"></a> I64 local1;
<a name="l17"></a> I64 local2;
<a name="l18"></a> $ = $ + 256;
<a name="l19"></a> I64 crazy;
<a name="l20"></a> };</span><span class=cF0>
<a name="l21"></a>
<a name="l22"></a></span><span class=cF4>LABEL</span><span class=cF2>::
<a name="l23"></a></span><span class=cF0> Defines an exported global label.
<a name="l24"></a>
<a name="l25"></a></span><span class=cF4>LABEL</span><span class=cF2>:
<a name="l26"></a></span><span class=cF0> Defines an non-exported global label.
<a name="l27"></a>
<a name="l28"></a></span><span class=cF2>@@</span><span class=cF4>LABEL</span><span class=cF2>:
<a name="l29"></a></span><span class=cF0> Defines a local label with scope valid between two global labels.
<a name="l30"></a>
<a name="l31"></a></span><span class=cF2>DU8</span><span class=cF0>, </span><span class=cF2>DU16</span><span class=cF0>, </span><span class=cF2>DU32</span><span class=cF0>, </span><span class=cF2>DU64</span><span class=cF0>
<a name="l32"></a> Define BYTE, WORD, DWORD or QWORD. Can be used with </span><span class=cF2>DUP()</span><span class=cF0> and ASCII strings. For your convenience, the ASCII strings do
<a name="l33"></a>not have terminating zeros. Define cmds must end with a semicolon.
<a name="l34"></a>
<a name="l35"></a></span><span class=cF2>USE16</span><span class=cF0>, </span><span class=cF2>USE32</span><span class=cF0>, </span><span class=cF2>USE64</span><span class=cF0>
<a name="l36"></a>
<a name="l37"></a></span><span class=cF2>IMPORT</span><span class=cF0> </span><span class=cF4>sym1name</span><span class=cF0>, </span><span class=cF4>sym2name</span><span class=cF0>;
<a name="l38"></a>
<a name="l39"></a></span><span class=cF2>LIST</span><span class=cF0>, </span><span class=cF2>NOLIST</span><span class=cF0>
<a name="l40"></a>
<a name="l41"></a></span><span class=cF2>ALIGN</span><span class=cF0> </span><span class=cF4>num</span><span class=cF0>, </span><span class=cF4>fill_byte</span><span class=cF0>
<a name="l42"></a> Align to </span><span class=cF4>num</span><span class=cF0> boundary and fill with </span><span class=cF4>fill_byte</span><span class=cF0>.
<a name="l43"></a>
<a name="l44"></a></span><span class=cF2>ORG</span><span class=cF0> </span><span class=cF4>num</span><span class=cF0>
<a name="l45"></a> Set code addr for JIT or set module </span><a href="https://zeal-operating-system.github.io/ZealOS/Kernel/KLoad.CC.html#l208"><span class=cF4>Load</span></a><span class=cF0>() addr -- has 16-byte </span><a href="https://zeal-operating-system.github.io/ZealOS/Kernel/KernelA.HH.html#l452"><span class=cF4>CBinFile</span></a><span class=cF0> header and patch table trailing.
<a name="l46"></a>
<a name="l47"></a></span><span class=cF2>BINFILE</span><span class=cF4> &quot;FileName.BIN&quot;</span><span class=cF0>;
<a name="l48"></a>
<a name="l49"></a>See </span><a href="https://zeal-operating-system.github.io/ZealOS/Doc/GuideLines.DD.html#l129"><span class=cF4>Assembly Language</span></a><span class=cF0>, </span><a href="https://zeal-operating-system.github.io/ZealOS/Demo/Asm/AsmAndC1.CC.html#l1"><span class=cF4>::/Demo/Asm/AsmAndC1.CC</span></a><span class=cF0>, </span><a href="https://zeal-operating-system.github.io/ZealOS/Demo/Asm/AsmAndC2.CC.html#l1"><span class=cF4>::/Demo/Asm/AsmAndC2.CC</span></a><span class=cF0> and </span><a href="https://zeal-operating-system.github.io/ZealOS/Demo/Asm/AsmAndC3.CC.html#l1"><span class=cF4>::/Demo/Asm/AsmAndC3.CC</span></a><span class=cF0>.
</span></pre></body>
</html>