Example #1
0
File: registers.go Project: 8l/e8
// WriteReg writes an integer register with value v.
// Writing to $0 will have no effect,
// writing to $31 will be automatically aligned.
func (rs *Registers) WriteReg(a uint8, v uint32) {
	if a == 0 {
		// do nothing
	} else if a == inst.RegPC {
		rs.ints[inst.RegPC] = align.A32(v)
	} else {
		rs.ints[a] = v
	}
}
Example #2
0
File: align.go Project: 8l/e8
func offset32(offset uint32) uint32 {
	return align.A32(maskOffset(offset))
}