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

Method runSetOnTMP

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

Source from the content-addressed store, hash-verified

895}
896
897func (c *CPU) runSetOnTMP(state bool) {
898 c.tmpSetANDGate.Update(state, c.step4Gates[0].Output())
899 updateSetStatus(&c.tmp, c.tmpSetANDGate.Output())
900
901 // We will add a new memory bit called
902 // "Carry Temp" that goes between the Carry Flag and the enabler
903 // we just added above. It will be set in step 4, the same time that the TMP register gets
904 // set. Thus, the ALU instruction will have a carry input that cannot change during step 5.
905 c.carryTemp.Update(c.flagsBus.GetOutputWire(FLAGS_BUS_CARRY), c.tmpSetANDGate.Output())
906 c.carryANDGate.Update(c.carryTemp.Get(), c.step5Gates[0].Output())
907}
908
909func (c *CPU) runSetOnRegisterB() {
910 c.registerBSetORGate.Update(

Callers 1

runSetMethod · 0.95

Calls 5

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

Tested by

no test coverage detected