hex.outputΒΆ
output 4 bits from hex (lsb first)
SignatureΒΆ
def output hex @ switch, print_0, print_2, print_4, print_6, print_8, print_a, print_c, print_e, end < stl.IO { ... }
Defined in hex/output.fj β lines 9β57 (view on GitHub).
ComplexityΒΆ
Time:
@Space:
@+26
See the complexity glossary for what @, w, dw, dbit, n mean.
SourceΒΆ
Click to view the macro body
def output hex @ switch, print_0, print_2, print_4, print_6, print_8, print_a, print_c, print_e, end < stl.IO {
wflip hex+w, switch, hex
pad 16
switch:
stl.IO+0;print_0 // 0
stl.IO+1;print_0 // 1
stl.IO+0;print_2 // 2
stl.IO+1;print_2 // 3
stl.IO+0;print_4 // 4
stl.IO+1;print_4 // 5
stl.IO+0;print_6 // 6
stl.IO+1;print_6 // 7
stl.IO+0;print_8 // 8
stl.IO+1;print_8 // 9
stl.IO+0;print_a // a
stl.IO+1;print_a // b
stl.IO+0;print_c // c
stl.IO+1;print_c // d
stl.IO+0;print_e // e
stl.IO+1;print_e // f
print_0:
stl.IO+0;
stl.IO+0;
stl.IO+0;end
print_2:
stl.IO+1;print_0+1*dw
print_4:
stl.IO+0;
stl.IO+1;print_0+2*dw
print_6:
stl.IO+1;print_4+1*dw
print_8:
stl.IO+0;
stl.IO+0;
stl.IO+1;end
print_a:
stl.IO+1;print_8+1*dw
print_c:
stl.IO+0;
stl.IO+1;print_8+2*dw
print_e:
stl.IO+1;print_c+1*dw
end:
wflip hex+w, switch
}
Used byΒΆ
Example usesΒΆ
hex.printinhex/output.fj
Next: hex.print/1 β