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

Function setBus

components/register_test.go:167–176  ·  view source on GitHub ↗
(b *Bus, value uint16)

Source from the content-addressed store, hash-verified

165}
166
167func setBus(b *Bus, value uint16) {
168 for i := arch.BUS_WIDTH - 1; i >= 0; i-- {
169 r := (value & (1 << uint16(i)))
170 if r != 0 {
171 b.SetInputWire(i, true)
172 } else {
173 b.SetInputWire(i, false)
174 }
175 }
176}
177
178func checkBus(b *Bus, expected uint16) bool {
179 var result uint16

Calls 1

SetInputWireMethod · 0.65

Tested by

no test coverage detected