MCPcopy Create free account
hub / github.com/djhworld/simple-computer / runSetGeneralPurposeRegisters

Method runSetGeneralPurposeRegisters

cpu/cpu.go:920–938  ·  view source on GitHub ↗
(state bool)

Source from the content-addressed store, hash-verified

918}
919
920func (c *CPU) runSetGeneralPurposeRegisters(state bool) {
921 c.instructionDecoderSet2x4.Update(c.ir.Bit(14), c.ir.Bit(15))
922
923 // R0
924 c.gpRegSetANDGates[0].Update(state, c.registerBSet.Get(), c.instructionDecoderSet2x4.GetOutputWire(0))
925 updateSetStatus(&c.gpReg0, c.gpRegSetANDGates[0].Output())
926
927 // R1
928 c.gpRegSetANDGates[1].Update(state, c.registerBSet.Get(), c.instructionDecoderSet2x4.GetOutputWire(1))
929 updateSetStatus(&c.gpReg1, c.gpRegSetANDGates[1].Output())
930
931 // R2
932 c.gpRegSetANDGates[2].Update(state, c.registerBSet.Get(), c.instructionDecoderSet2x4.GetOutputWire(2))
933 updateSetStatus(&c.gpReg2, c.gpRegSetANDGates[2].Output())
934
935 // R3
936 c.gpRegSetANDGates[3].Update(state, c.registerBSet.Get(), c.instructionDecoderSet2x4.GetOutputWire(3))
937 updateSetStatus(&c.gpReg3, c.gpRegSetANDGates[3].Output())
938}
939
940func runUpdateOn(component Updatable) {
941 component.Update()

Callers 1

runSetMethod · 0.95

Calls 6

updateSetStatusFunction · 0.85
BitMethod · 0.80
UpdateMethod · 0.65
GetOutputWireMethod · 0.65
GetMethod · 0.45
OutputMethod · 0.45

Tested by

no test coverage detected