(offset uint16, values []uint16)
| 57 | } |
| 58 | |
| 59 | func (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 | |
| 73 | func (c *SimpleComputer) loadToRAM(addr uint16, value uint16) { |
| 74 | c.putValueInRAM(addr, value) |