MCPcopy Index your code
hub / github.com/djhworld/simple-computer / LoadToRAM

Method LoadToRAM

computer/computer.go:59–71  ·  view source on GitHub ↗
(offset uint16, values []uint16)

Source from the content-addressed store, hash-verified

57}
58
59func (c *SimpleComputer) LoadToRAM(offset uint16, values []uint16) {
60 if offset < 0x0500 {
61 panic("0x0000 - 0x04FF is a reserved memory area")
62 }
63 if offset > 0xFEFF {
64 panic("0xFEFF - 0xFFFF is a reserved memory area")
65 }
66
67 log.Printf("Loading %d words to RAM at offset 0x%X", len(values), offset)
68 for i := 0; i < len(values); i++ {
69 c.loadToRAM(offset+uint16(i), values[i])
70 }
71}
72
73func (c *SimpleComputer) loadToRAM(addr uint16, value uint16) {
74 c.putValueInRAM(addr, value)

Callers 1

runFunction · 0.80

Calls 1

loadToRAMMethod · 0.95

Tested by

no test coverage detected