hex.fill_bytes¶
Fills “count[:w/4]” bytes of the pointed buffer with the value byte.
ptr,count are hex[:w/4]; value is a hex[:2]. All three are preserved.
Signature¶
def fill_bytes ptr, count, value @ loop, finish, wptr, cnt, end { ... }
Defined in hex/strings.fj — lines 89–103 (view on GitHub).
Complexity¶
Time:
count(w(@+5) + 28@+55)Space:
w(2.25@+44) + 35@+300
See the complexity glossary for what @, w, dw, dbit, n mean.
Requires init¶
The following must be initialised before this macro is invoked:
hex.init and stl.ptr_init (or stl.startup_and_init_all).
Source¶
Click to view the macro body
def fill_bytes ptr, count, value @ loop, finish, wptr, cnt, end {
.mov w/4, wptr, ptr
.mov w/4, cnt, count
loop:
.if0 w/4, cnt, finish
.write_byte_and_inc wptr, value
.dec w/4, cnt
;loop
finish:
;end
wptr: .vec w/4
cnt: .vec w/4
end:
}
Depends on¶
← Previous: hex.print_ptr_line
Next: hex.copy_bytes →