Skip to content

Commit

Permalink
Added some comments and reminders.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Savastio authored and Michael Savastio committed May 8, 2017
1 parent fd151d8 commit 45e084f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/Sim6502.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ include("memory.jl")
include("boilerplate.jl")
include("instructions.jl")
include("northbridge.jl")
include("opcodes.jl")

end # module
12 changes: 6 additions & 6 deletions src/instructions.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#=====================================================================================================
Some conventions:
All instructions are based on methods where arguments are passed explicitly (rather than from
the stack). These base methods affect the registers (or memory) as they should, but do not
affect the program counter as they are not reading from the stack.
All instructions are based on methods where arguments are passed from an external source
(i.e. they do not come from the CPU's memory).
Zero-argument instruction methods read memory from the stack, and affect the PC register as
they should.
**These calls do not affect the program counter.**
TODO add methods for running instructions from Memory.
=====================================================================================================#

# these can be passed to instructions to specify addressing modes when appropriate
Expand Down Expand Up @@ -202,7 +202,7 @@ export and!, eor!, ora!, bit!
===================================================================================================#
function adc!(c::CPU, val::UInt8)
val += UInt8(status(c, :C))
checkCflag!(c, c.A, val)
checkCflag!(c, c.A, val) # TODO check whether this is supposed to unset
c.A += val
checkNflag!(c, c.A)
checkZflag!(c, c.A)
Expand Down
5 changes: 5 additions & 0 deletions src/opcodes.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#===================================================================================================
TODO write these in such a way that it'll still be possible to generate Julia code from
instructions.
===================================================================================================#

0 comments on commit 45e084f

Please sign in to comment.