mirror of
https://github.com/pskupinski/65816.js.git
synced 2024-06-05 22:29:30 +00:00
added STP
This commit is contained in:
parent
5813feaa89
commit
dbe014ada1
2
TODO
2
TODO
|
@ -7,8 +7,6 @@ Testing:
|
|||
- Tests needed for T** transfer operations
|
||||
- Tests needed for interrupt support
|
||||
- Tests needed for the numerous other operations added
|
||||
Operations Not Yet Implemented:
|
||||
- 0xdb : STP
|
||||
CPU:
|
||||
- More work on interrupts
|
||||
- Decimal mode support
|
||||
|
|
28
cpu.js
28
cpu.js
|
@ -49,11 +49,23 @@ function CPU_65816() {
|
|||
// is received.
|
||||
this.waiting = false;
|
||||
|
||||
// This is set by the STP operation to stop execution until a RESET
|
||||
// interrupt is received.
|
||||
this.stopped = false;
|
||||
|
||||
this.raise_interrupt = function(i) {
|
||||
if(this.waiting) {
|
||||
this.interrupt = i;
|
||||
this.waiting = false;
|
||||
if(this.p.i) {
|
||||
if(i===this.INTERRUPT.IRQ) {
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
this.interrupt = i;
|
||||
this.start();
|
||||
} else if(this.stopped&&(i===this.INTERRUPT.RESET)) {
|
||||
this.stopped = false;
|
||||
this.start();
|
||||
} else {
|
||||
this.interrupt = i;
|
||||
}
|
||||
|
@ -230,7 +242,8 @@ function CPU_65816() {
|
|||
0x34 : BIT_direct_page_indexed_x,
|
||||
0x0c : TSB_absolute, 0x04 : TSB_direct_page,
|
||||
0x1c : TRB_absolute, 0x14 : TRB_direct_page,
|
||||
0x9a : TXS, 0xba : TSX, 0x42: WDM, 0xcb : WAI };
|
||||
0x9a : TXS, 0xba : TSX, 0x42: WDM, 0xcb : WAI,
|
||||
0xdb : STP };
|
||||
|
||||
/**
|
||||
* Take a raw hex string representing the program and execute it.
|
||||
|
@ -349,7 +362,7 @@ function CPU_65816() {
|
|||
operation.execute(this,bytes);
|
||||
}
|
||||
|
||||
if(this.waiting)
|
||||
if(this.waiting||this.stopped)
|
||||
executing = false;
|
||||
}
|
||||
};
|
||||
|
@ -454,6 +467,15 @@ var MMU = {
|
|||
}
|
||||
};
|
||||
|
||||
var STP = {
|
||||
bytes_required:function() {
|
||||
return 1;
|
||||
},
|
||||
execute:function(cpu) {
|
||||
cpu.stopped = true;
|
||||
}
|
||||
};
|
||||
|
||||
var WAI = {
|
||||
bytes_required:function() {
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue
Block a user