1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-11-24 14:32:08 +00:00
erc-c/src/mos6502.stat.c

63 lines
643 B
C
Raw Normal View History

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;
}