mirror of
https://github.com/trebonian/visual6502.git
synced 2025-07-09 05:24:02 +00:00
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
6c138a4f6b | |||
658d40646c | |||
67e15e68c1 | |||
a316831100 | |||
acd7b0310e | |||
9331be20fe | |||
e6d42eb1aa | |||
8ae5c087f6 | |||
c6dd03ba17 | |||
fca2eb5cb6 |
@ -73,6 +73,34 @@ ir7: 1277,
|
||||
// internal control signals
|
||||
sync: 1528, // aka #decode_0
|
||||
|
||||
// timing state signals
|
||||
Ts: 1309,
|
||||
Ta0: 879,
|
||||
Td0_0: 981,
|
||||
"#Te0": 868,
|
||||
"Te0.2": 866,
|
||||
Tg0: 12,
|
||||
Tx0: 850,
|
||||
Ta1: 838,
|
||||
Te1_0: 735,
|
||||
Tg1: 772,
|
||||
Tx1: 851,
|
||||
Ta2: 844,
|
||||
Tg2: 832,
|
||||
Tx2: 860,
|
||||
Tg3: 835,
|
||||
Tr3: 823,
|
||||
Tg4: 696,
|
||||
Tr4: 825,
|
||||
Tg5: 914,
|
||||
Tr5: 828,
|
||||
Tg6: 911,
|
||||
Tr6: 894,
|
||||
Tr7: 694,
|
||||
Tg7: 1081,
|
||||
Tg8: 891,
|
||||
Tr8: 697,
|
||||
|
||||
// many other internal busses registers and signals
|
||||
abh0: 267,
|
||||
abh1: 258,
|
||||
|
@ -12,12 +12,12 @@ npwr = nodenames['vcc'];
|
||||
nodenamereset = 'reset';
|
||||
|
||||
presetLogLists=[
|
||||
['cycle','phi1','phi2'],
|
||||
['cycle',],
|
||||
['ab','db','rw','vma','Fetch','pc','acca','accb','ix','sp','p'],
|
||||
['ir','sync','Execute'], // instruction fetch and execution control
|
||||
['dbi','dbo','tmp'], // internal state
|
||||
['idb','abh','abl','ablx'], // internal busses
|
||||
['irq','nmi',nodenamereset,'tsc','dbe','halt','ba'], // other pins
|
||||
['ir','sync','Execute','State'], // instruction fetch and execution control
|
||||
['dbi','dbo','tmp'], // internal register-sized state
|
||||
['idb','abh','abl','ablx'], // internal busses
|
||||
['irq','nmi',nodenamereset,'tsc','dbe','halt','ba'], // other pins
|
||||
];
|
||||
|
||||
function setupTransistors(){
|
||||
@ -86,7 +86,7 @@ function initChip(){
|
||||
setHigh('phi1');
|
||||
}
|
||||
setHigh(nodenamereset);
|
||||
for(var i=0;i<18;i++){halfStep();} // avoid updating graphics and trace buffer before user code
|
||||
for(var i=0;i<6;i++){halfStep();} // avoid updating graphics and trace buffer before user code
|
||||
refresh();
|
||||
cycle = 0;
|
||||
trace = Array();
|
||||
@ -125,6 +125,33 @@ function readPstring(){
|
||||
return result;
|
||||
}
|
||||
|
||||
// The 6800 state control is something like a branching shift register
|
||||
// ... but not quite like that
|
||||
TCStates=[
|
||||
"Ts",
|
||||
"Tx0", "Tx1", "Tx2",
|
||||
"Ta0", "Ta1", "Ta2",
|
||||
"Td0_0",
|
||||
"#Te0", "Te1_0",
|
||||
"Tg0", "Tg1", "Tg2", "Tg3", "Tg4", "Tg5", "Tg6", "Tg7", "Tg8",
|
||||
"Tr3", "Tr4", "Tr5", "Tr6", "Tr7", "Tr8",
|
||||
];
|
||||
|
||||
function listActiveTCStates() {
|
||||
var s=[];
|
||||
for(var i=0;i<TCStates.length;i++){
|
||||
var t=TCStates[i];
|
||||
// remove a leading hash, but invert the signal
|
||||
// in any case, remove any trailing suffix
|
||||
if(t[0]=="#"){
|
||||
if(!isNodeHigh(nodenames[t])) s.push(t.slice(1,4));
|
||||
} else {
|
||||
if(isNodeHigh(nodenames[t])) s.push(t.slice(0,3));
|
||||
}
|
||||
}
|
||||
return s.join("+");
|
||||
}
|
||||
|
||||
function busToString(busname){
|
||||
// takes a signal name or prefix
|
||||
// returns an appropriate string representation
|
||||
@ -190,7 +217,7 @@ function chipStatus(){
|
||||
}
|
||||
|
||||
setStatus(machine1, machine2, machine3);
|
||||
if (loglevel>0) {
|
||||
if (logThese.length>1) {
|
||||
updateLogbox(logThese);
|
||||
}
|
||||
selectCell(ab);
|
||||
|
@ -7,19 +7,19 @@ var consoleboxStream="";
|
||||
// for opcodes, see ftp://ftp.comlab.ox.ac.uk/pub/Cards/txt/6800.txt
|
||||
|
||||
testprogram = [
|
||||
0x01, // NOP
|
||||
0x01, // NOP
|
||||
0x01, // NOP
|
||||
0xce, 0x43, 0x21, // LDX #4321
|
||||
0x35, // TXS
|
||||
0xc6, 0x00, // LDAA #$00
|
||||
0xc6, 0xfb, // LDAB #$FB
|
||||
0xbd, 0x00, 0x10, // JSR $0010
|
||||
0x7e, 0x00, 0x02, // JMP $0002
|
||||
0x7e, 0x00, 0x04, // JMP $0004
|
||||
0x01, // NOP
|
||||
0x01, // NOP
|
||||
0x01, // NOP
|
||||
0x01, // NOP
|
||||
0x08, // INX
|
||||
0x5a, // DECB
|
||||
0x4a, // DECA
|
||||
0x7c, 0x00, 0x0f, // INC $0F
|
||||
0x0d, // SEC
|
||||
0xc9, 0x02, // ADCA #$02
|
||||
0xc9, 0x02, // ADCB #$02
|
||||
0x39, // RTS
|
||||
]
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -471,7 +471,7 @@ function chipStatus(){
|
||||
machine3 += " Chk:" + traceChecksum + ((traceChecksum==goldenChecksum)?" OK":" no match");
|
||||
}
|
||||
setStatus(machine1, machine2, machine3);
|
||||
if (loglevel>0) {
|
||||
if (logThese.length>1) {
|
||||
updateLogbox(logThese);
|
||||
}
|
||||
selectCell(ab);
|
||||
@ -509,6 +509,8 @@ function goForN(n){
|
||||
return;
|
||||
}
|
||||
running = false;
|
||||
var start = document.getElementById('start');
|
||||
var stop = document.getElementById('stop');
|
||||
start.style.visibility = 'visible';
|
||||
stop.style.visibility = 'hidden';
|
||||
}
|
||||
|
Reference in New Issue
Block a user