2017-05-16 22:19:40 -04:00
|
|
|
//
|
|
|
|
// ZexallTests.swift
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 16/05/2017.
|
|
|
|
// Copyright © 2017 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import XCTest
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
class ZexallTests: XCTestCase {
|
|
|
|
|
|
|
|
func testZexall() {
|
|
|
|
if let filename = Bundle(for: type(of: self)).path(forResource: "zexall", ofType: "com") {
|
|
|
|
if let testData = try? Data(contentsOf: URL(fileURLWithPath: filename)) {
|
|
|
|
|
|
|
|
let machine = CSTestMachineZ80()
|
|
|
|
machine.setData(testData, atAddress: 0x0100)
|
|
|
|
|
2017-05-17 07:36:06 -04:00
|
|
|
machine.setValue(0x0100, for: .programCounter)
|
|
|
|
machine.setValue(0xffff, for: .stackPointer)
|
|
|
|
|
2017-05-16 22:19:40 -04:00
|
|
|
machine.runForNumber(ofCycles: 20)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|