implement zeros; include "sys.m"; sys: Sys; include "draw.m"; zeros: module { init: fn(nil: ref Draw->Context, argv: list of string); }; init(nil: ref Draw->Context, argv: list of string) { sys = load Sys Sys->PATH; if(sys == nil) return; bs := 0; n := 0; if(len argv > 1) bs = int hd tl argv; else bs = 1; if (len argv > 2) n = int hd tl tl argv; else n = 1; if(bs == 0 || n == 0) { sys->fprint(sys->fildes(2), "usage: zeros blocksize [number]\n"); sys->raise("fail: usage"); } z := array[bs] of byte; for(i:=0;iwrite(sys->fildes(1), z, bs); }