Difference between revisions of "Template:LSL Hex/Write"
Jump to navigation
Jump to search
Chaser Zaks (talk | contribs) (Replace deprecated ParserFunctions "#pad" with built-in "Magic word" "padleft") |
|||
(54 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
{{#vardefine: | {{#if: | ||
{{#vardefine:mask|{{#ifexpr:{{{1|0}}}>=0|0123456789ABCDEF|FEDCBA9876543210}}}} | |||
{{#vardefine:len| {{#ifexpr:{{{1|0}}}>=0|0|{{#ifexpr:{{{1|0}}}>=-2147483648|8|16}}}}}} | |||
{{#vardefine:in| {{#expr: {{#ifexpr:{{{1|0}}}<0|-1 -}} {{{1|0}}}}}}} | |||
{{#vardefine:out| {{#ifexpr:{{#var:in}} = 0 and not {{#var:len}}|0}}}} | |||
{{#vardefine:t|{{#expr:{{#var:in}} mod 16}}}} | |||
{{#vardefine:out|{{#ifexpr:{{#var:in}} >= 1 or {{#var:len}} > 0|{{#sub:{{#var:mask}}|{{#var:t}}|1}}}}{{#var:out}}}} | |||
{{#vardefine:in|{{#expr:({{#var:in}} - {{#var:t}})/ 16}}}} | |||
{{#vardefine:t|{{#expr:{{#var:in}} mod 16}}}} | |||
{{#vardefine:out|{{#ifexpr:{{#var:in}} >= 1 or {{#var:len}} > 1|{{#sub:{{#var:mask}}|{{#var:t}}|1}}}}{{#var:out}}}} | |||
{{#vardefine:in|{{#expr:({{#var:in}} - {{#var:t}})/ 16}}}} | |||
{{#vardefine:t|{{#expr:{{#var:in}} mod 16}}}} | |||
{{#vardefine:out|{{#ifexpr:{{#var:in}} >= 1 or {{#var:len}} > 2|{{#sub:{{#var:mask}}|{{#var:t}}|1}}}}{{#var:out}}}} | |||
{{#vardefine:in|{{#expr:({{#var:in}} - {{#var:t}})/ 16}}}} | |||
{{#vardefine:t|{{#expr:{{#var:in}} mod 16}}}} | |||
{{#vardefine:out|{{#ifexpr:{{#var:in}} >= 1 or {{#var:len}} > 3|{{#sub:{{#var:mask}}|{{#var:t}}|1}}}}{{#var:out}}}} | |||
{{#vardefine:in|{{#expr:({{#var:in}} - {{#var:t}})/ 16}}}} | |||
{{#vardefine:t|{{#expr:{{#var:in}} mod 16}}}} | |||
{{#vardefine:out|{{#ifexpr:{{#var:in}} >= 1 or {{#var:len}} > 4|{{#sub:{{#var:mask}}|{{#var:t}}|1}}}}{{#var:out}}}} | |||
{{#vardefine:in|{{#expr:({{#var:in}} - {{#var:t}})/ 16}}}} | |||
{{#vardefine:t|{{#expr:{{#var:in}} mod 16}}}} | |||
{{#vardefine:out|{{#ifexpr:{{#var:in}} >= 1 or {{#var:len}} > 5|{{#sub:{{#var:mask}}|{{#var:t}}|1}}}}{{#var:out}}}} | |||
{{#vardefine:in|{{#expr:({{#var:in}} - {{#var:t}})/ 16}}}} | |||
{{#vardefine:t|{{#expr:{{#var:in}} mod 16}}}} | |||
{{#vardefine:out|{{#ifexpr:{{#var:in}} >= 1 or {{#var:len}} > 6|{{#sub:{{#var:mask}}|{{#var:t}}|1}}}}{{#var:out}}}} | |||
{{#vardefine:in|{{#expr:({{#var:in}} - {{#var:t}})/ 16}}}} | |||
{{#vardefine:t|{{#expr:{{#var:in}} mod 16}}}} | |||
{{#vardefine:out|{{#ifexpr:{{#var:in}} >= 1 or {{#var:len}} > 7|{{#sub:{{#var:mask}}|{{#var:t}}|1}}}}{{#var:out}}}} | |||
{{#vardefine:in|{{#expr:({{#var:in}} - {{#var:t}})/ 16}}}} | |||
{{#vardefine:t|{{#expr:{{#var:in}} mod 16}}}} | |||
{{#vardefine:out|{{#ifexpr:{{#var:in}} >= 1 or {{#var:len}} > 8|{{#sub:{{#var:mask}}|{{#var:t}}|1}}}}{{#var:out}}}} | |||
{{#vardefine:in|{{#expr:({{#var:in}} - {{#var:t}})/ 16}}}} | |||
{{#vardefine:t|{{#expr:{{#var:in}} mod 16}}}} | |||
{{#vardefine:out|{{#ifexpr:{{#var:in}} >= 1 or {{#var:len}} > 9|{{#sub:{{#var:mask}}|{{#var:t}}|1}}}}{{#var:out}}}} | |||
{{#vardefine:in|{{#expr:({{#var:in}} - {{#var:t}})/ 16}}}} | |||
{{#vardefine:t|{{#expr:{{#var:in}} mod 16}}}} | |||
{{#vardefine:out|{{#ifexpr:{{#var:in}} >= 1 or {{#var:len}} > 10|{{#sub:{{#var:mask}}|{{#var:t}}|1}}}}{{#var:out}}}} | |||
{{#vardefine:in|{{#expr:({{#var:in}} - {{#var:t}})/ 16}}}} | |||
{{#vardefine:t|{{#expr:{{#var:in}} mod 16}}}} | |||
{{#vardefine:out|{{#ifexpr:{{#var:in}} >= 1 or {{#var:len}} > 11|{{#sub:{{#var:mask}}|{{#var:t}}|1}}}}{{#var:out}}}} | |||
{{#vardefine:in|{{#expr:({{#var:in}} - {{#var:t}})/ 16}}}} | |||
{{#vardefine:t|{{#expr:{{#var:in}} mod 16}}}} | |||
{{#vardefine:out|{{#ifexpr:{{#var:in}} >= 1 or {{#var:len}} > 12|{{#sub:{{#var:mask}}|{{#var:t}}|1}}}}{{#var:out}}}} | |||
{{#vardefine:in|{{#expr:({{#var:in}} - {{#var:t}})/ 16}}}} | |||
{{#vardefine:t|{{#expr:{{#var:in}} mod 16}}}} | |||
{{#vardefine:out|{{#ifexpr:{{#var:in}} >= 1 or {{#var:len}} > 13|{{#sub:{{#var:mask}}|{{#var:t}}|1}}}}{{#var:out}}}} | |||
{{#vardefine:in|{{#expr:({{#var:in}} - {{#var:t}})/ 16}}}} | |||
{{#vardefine:t|{{#expr:{{#var:in}} mod 16}}}} | |||
{{#vardefine:out|{{#ifexpr:{{#var:in}} >= 1 or {{#var:len}} > 14|{{#sub:{{#var:mask}}|{{#var:t}}|1}}}}{{#var:out}}}} | |||
{{#vardefine:in|{{#expr:({{#var:in}} - {{#var:t}})/ 16}}}} | |||
{{#vardefine:t|{{#expr:{{#var:in}} mod 16}}}} | |||
{{#vardefine:out|{{#ifexpr:{{#var:in}} >= 1 or {{#var:len}} > 15|{{#sub:{{#var:mask}}|{{#var:t}}|1}}}}{{#var:out}}}} | |||
{{#vardefine:in|{{#expr:({{#var:in}} - {{#var:t}})/ 16}}}} | |||
}}{{padleft:{{#var:out}}|0{{{chars|1}}}|0}}<noinclude> | |||
{| | {| | ||
|<pre>{{LSL_Hex/Write|1843}}</pre> | |<pre>{{LSL_Hex/Write|1843}}</pre> | ||
Line 8: | Line 79: | ||
|{{LSL_Hex/Write|-1}} | |{{LSL_Hex/Write|-1}} | ||
|} | |} | ||
{| | |||
|<pre>{{LSL_Hex/Write|-2}}</pre> | |||
|{{LSL_Hex/Write|-2}} | |||
|} | |||
{| | |||
|<pre>{{LSL_Hex/Write|-43}}</pre> | |||
|{{LSL_Hex/Write|-43}} | |||
|} | |||
{| | |||
|<pre>{{LSL_Hex/Write|-63}}</pre> | |||
|{{LSL_Hex/Write|-63}} | |||
|} | |||
</noinclude> | </noinclude> |
Latest revision as of 02:00, 20 August 2023
0
{{LSL_Hex/Write|1843}} |
733 |
{{LSL_Hex/Write|-1}} |
FFFFFFFF |
{{LSL_Hex/Write|-2}} |
FFFFFFFE |
{{LSL_Hex/Write|-43}} |
FFFFFFD5 |
{{LSL_Hex/Write|-63}} |
FFFFFFC1 |