diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-11-15 23:23:05 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-11-15 23:23:05 -0800 |
commit | 264aba4d929da6899af0672fcda7cc7a877099ec (patch) | |
tree | f5e3aa2b6e30f5c2335bcfbcabc51fe6327646b3 /html/mu_instructions.html | |
parent | 002f2609e91ed2e49c250202877290f58609a982 (diff) | |
download | mu-264aba4d929da6899af0672fcda7cc7a877099ec.tar.gz |
7249
Diffstat (limited to 'html/mu_instructions.html')
-rw-r--r-- | html/mu_instructions.html | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/html/mu_instructions.html b/html/mu_instructions.html index 2403bdff..2bbee1bf 100644 --- a/html/mu_instructions.html +++ b/html/mu_instructions.html @@ -341,11 +341,11 @@ var/reg: (addr T) <span class="SpecialChar"><-</span> address var2: T var/reg <span class="SpecialChar"><-</span> index arr/rega: (addr array T), idx/regi: int | if size-of(T) is <span class="Constant">4</span> or <span class="Constant">8</span> => <span class="Constant">"8d/copy-address *("</span> rega <span class="Constant">"+"</span> regi <span class="Constant">"<<"</span> log2(size-of(T)) <span class="Constant">"+4) "</span> reg <span class="Constant">"/r32"</span> -var/reg <span class="SpecialChar"><-</span> index arr: (array T sz), idx/regi: int +var/reg <span class="SpecialChar"><-</span> index arr: (array T len), idx/regi: int => <span class="Constant">"8d/copy-address *(ebp+"</span> regi <span class="Constant">"<<"</span> log2(size-of(T)) <span class="Constant">"+"</span> (arr.stack-offset + <span class="Constant">4</span>) <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> var/reg <span class="SpecialChar"><-</span> index arr/rega: (addr array T), n => <span class="Constant">"8d/copy-address *("</span> rega <span class="Constant">"+"</span> (n*size-of(T)+<span class="Constant">4</span>) <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> -var/reg <span class="SpecialChar"><-</span> index arr: (array T sz), n +var/reg <span class="SpecialChar"><-</span> index arr: (array T len), n => <span class="Constant">"8d/copy-address *(ebp+"</span> (arr.stack-offset+<span class="Constant">4</span>+n*size-of(T)) <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> var/reg: (offset T) <span class="SpecialChar"><-</span> compute-offset arr: (addr array T), idx/regi: int <span class="muComment"># arr can be in reg or mem</span> @@ -406,6 +406,11 @@ populate in: (addr handle array T), num <span class="muComment"># can be litera populate-stream in: (addr handle stream T), num <span class="muComment"># can be literal or variable on stack or register</span> => <span class="Constant">"(new-stream Heap "</span> size-of(T) <span class="Constant">" "</span> num <span class="Constant">" "</span> in <span class="Constant">")"</span> +<span class="muComment"># Some miscellaneous helpers to avoid error-prone size computations</span> + +clear x: (addr T) + => <span class="Constant">"(zero-out "</span> s <span class="Constant">" "</span> size-of(T) <span class="Constant">")"</span> + read-from-stream s: (addr stream T), out: (addr T) => <span class="Constant">"(read-from-stream "</span> s <span class="Constant">" "</span> out <span class="Constant">" "</span> size-of(T) <span class="Constant">")"</span> |