2017-12-02 19:05:53 +00:00
|
|
|
/*
|
|
|
|
* mos6502.stat.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "mos6502.h"
|
|
|
|
#include "mos6502.enums.h"
|
|
|
|
|
2017-12-07 00:01:13 +00:00
|
|
|
/*
|
|
|
|
* Clear the carry bit in the status register.
|
|
|
|
*/
|
2017-12-02 19:05:53 +00:00
|
|
|
DEFINE_INST(clc)
|
|
|
|
{
|
|
|
|
cpu->P &= ~CARRY;
|
|
|
|
}
|
|
|
|
|
2017-12-07 00:01:13 +00:00
|
|
|
/*
|
|
|
|
* Clear the decimal bit.
|
|
|
|
*/
|
2017-12-02 19:05:53 +00:00
|
|
|
DEFINE_INST(cld)
|
|
|
|
{
|
|
|
|
cpu->P &= ~DECIMAL;
|
|
|
|
}
|
|
|
|
|
2017-12-07 00:01:13 +00:00
|
|
|
/*
|
|
|
|
* Clear the interrupt bit.
|
|
|
|
*/
|
2017-12-02 19:05:53 +00:00
|
|
|
DEFINE_INST(cli)
|
|
|
|
{
|
|
|
|
cpu->P &= ~INTERRUPT;
|
|
|
|
}
|
|
|
|
|
2017-12-07 00:01:13 +00:00
|
|
|
/*
|
|
|
|
* Clear the overflow bit.
|
|
|
|
*/
|
2017-12-02 19:05:53 +00:00
|
|
|
DEFINE_INST(clv)
|
|
|
|
{
|
|
|
|
cpu->P &= ~OVERFLOW;
|
|
|
|
}
|
|
|
|
|
2017-12-07 00:01:13 +00:00
|
|
|
/*
|
|
|
|
* Set the carry bit.
|
|
|
|
*/
|
2017-12-02 19:05:53 +00:00
|
|
|
DEFINE_INST(sec)
|
|
|
|
{
|
|
|
|
cpu->P |= CARRY;
|
|
|
|
}
|
|
|
|
|
2017-12-07 00:01:13 +00:00
|
|
|
/*
|
|
|
|
* Set the decimal bit.
|
|
|
|
*/
|
2017-12-02 19:05:53 +00:00
|
|
|
DEFINE_INST(sed)
|
|
|
|
{
|
|
|
|
cpu->P |= DECIMAL;
|
|
|
|
}
|
|
|
|
|
2017-12-07 00:01:13 +00:00
|
|
|
/*
|
|
|
|
* Set the interrupt bit.
|
|
|
|
*/
|
2017-12-02 19:05:53 +00:00
|
|
|
DEFINE_INST(sei)
|
|
|
|
{
|
|
|
|
cpu->P |= INTERRUPT;
|
|
|
|
}
|