2016-06-05 04:52:43 +00:00
|
|
|
alwaysinline auto readPC() -> uint8 {
|
|
|
|
return read(regs.pc++);
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2016-06-05 04:52:43 +00:00
|
|
|
alwaysinline auto readSP() -> uint8 {
|
|
|
|
return read(0x0100 | ++regs.s);
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2016-06-05 04:52:43 +00:00
|
|
|
alwaysinline auto writeSP(uint8 data) -> void {
|
|
|
|
return write(0x0100 | regs.s--, data);
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2016-06-05 04:52:43 +00:00
|
|
|
alwaysinline auto readDP(uint8 addr) -> uint8 {
|
|
|
|
return read(regs.p.p << 8 | addr);
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2016-06-05 04:52:43 +00:00
|
|
|
alwaysinline auto writeDP(uint8 addr, uint8 data) -> void {
|
|
|
|
return write(regs.p.p << 8 | addr, data);
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|