Packages

An emulation of the famous 6502 processor. Focus is on modern versions of the processor (as opposed to the MOS 6502 version).

Current section

Files

Jump to
ex6502 lib ex6502 cpu executor cld.ex
Raw

lib/ex6502/cpu/executor/cld.ex

defmodule Ex6502.CPU.Executor.CLD do
@moduledoc """
Clear decimal mode flag
Reset or clear the decimal mode flag to 0
## Operation
0 → D
## Table
CLD | Clear Decimal Mode
================================================
N V - B D I Z C
- - - - 0 - - -
addressing assembler opc bytes cycles
------------------------------------------------
implied CLD D8 1 2
## Flags
Decimal: resets to 0 always
"""
alias Ex6502.{Computer, CPU}
# addressing assembler opc bytes cycles
# implied CLD D8 1 2
def execute(%Computer{data_bus: 0xD8} = c), do: CPU.set_flag(c, :d, false)
end