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

Function TestST

cpu/cpu_test.go:237–258  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

235}
236
237func TestST(t *testing.T) {
238 ClearMem()
239 testST(0x0010, [4]uint16{0x00A0, 0x0001, 0x0001, 0x0001}, 0x00A0, 0x00A0, t)
240 testST(0x0011, [4]uint16{0x00A1, 0x0029, 0x0001, 0x0001}, 0x00A1, 0x0029, t)
241 testST(0x0012, [4]uint16{0x00A2, 0x0001, 0x007F, 0x0001}, 0x00A2, 0x007F, t)
242 testST(0x0013, [4]uint16{0x00A3, 0x0001, 0x0001, 0x001B}, 0x00A3, 0x001B, t)
243
244 testST(0x0014, [4]uint16{0x00A0, 0x00B4, 0x0001, 0x0001}, 0x00B4, 0x00A0, t)
245 testST(0x0015, [4]uint16{0x0001, 0x00B5, 0x0001, 0x0001}, 0x00B5, 0x00B5, t)
246 testST(0x0016, [4]uint16{0x0001, 0x00B6, 0x007F, 0x0001}, 0x00B6, 0x007F, t)
247 testST(0x0017, [4]uint16{0x0001, 0x00B7, 0x0001, 0x001B}, 0x00B7, 0x001B, t)
248
249 testST(0x0018, [4]uint16{0x00A0, 0x0001, 0x00C8, 0x0001}, 0x00C8, 0x00A0, t)
250 testST(0x0019, [4]uint16{0x0001, 0x0029, 0x00C9, 0x0001}, 0x00C9, 0x0029, t)
251 testST(0x001A, [4]uint16{0x0001, 0x0001, 0x00CA, 0x0001}, 0x00CA, 0x00CA, t)
252 testST(0x001B, [4]uint16{0x0001, 0x0001, 0x00CB, 0x001B}, 0x00CB, 0x001B, t)
253
254 testST(0x001C, [4]uint16{0x00A0, 0x0001, 0x0001, 0x00DC}, 0x00DC, 0x00A0, t)
255 testST(0x001D, [4]uint16{0x0001, 0x0029, 0x0001, 0x00DD}, 0x00DD, 0x0029, t)
256 testST(0x001E, [4]uint16{0x0001, 0x0001, 0x1A7F, 0xFCDE}, 0xFCDE, 0x1A7F, t)
257 testST(0x001F, [4]uint16{0x0001, 0x0001, 0x0001, 0x00DF}, 0x00DF, 0x00DF, t)
258}
259
260func testST(instruction uint16, inputRegisters [4]uint16, expectedValueAddress, expectedValue uint16, t *testing.T) {
261 c := SetUpCPU()

Callers

nothing calls this directly

Calls 2

ClearMemFunction · 0.85
testSTFunction · 0.85

Tested by

no test coverage detected