Esempio n. 1
0
func (opt optPrintByte) run(in bitio.BitReader, out bitio.BitWriter, ctx *context) (l *line, err error) {
	n0 := ctx.bVar.Uint64(uint64(opt.p))
	for i := uint64(0); i < 8; i++ {
		if n0&1<<i == 0 {
			_, err = varVal(uint64(opt.p) + i).value(ctx)
			if err != nil {
				return
			}
		}
	}

	b := byte(ctx.memory.Uint64(uint64(opt.p)))

	ctx.jump = b&1 == 1

	return opt.l, bitio.WriteByte(out, b)
}
Esempio n. 2
0
func (opt optPrintByteConst) run(in bitio.BitReader, out bitio.BitWriter, ctx *context) (l *line, err error) {
	return opt.l, bitio.WriteByte(out, opt.b)
}