sixty-five-oh-two/README.md

32 lines
765 B
Markdown
Raw Normal View History

2018-05-25 08:50:04 +00:00
# A 65C02 Assembly DSL for Haskell
2018-05-25 08:51:32 +00:00
![Example image](https://raw.githubusercontent.com/Aearnus/dsl-sixty-five-oh-two/master/fancy_banner.png)
2018-05-25 08:50:04 +00:00
_... shut up, show me the code!_
2018-05-26 08:56:48 +00:00
Here's some example code utilizing all of the features of the eDSL:
2018-05-25 08:50:04 +00:00
```haskell
import SixtyFiveOhTwo.Instruction
accumulatorLoadNStore :: Instruction
accumulatorLoadNStore = do
lda (Immediate 0x10)
sta (Absolute 0x0200)
rts (Implied)
myProgram :: Instruction
myProgram = do
define "accumulatorLoadNStore" accumulatorLoadNStore
call "accumulatorLoadNStore"
```
2018-05-26 08:56:48 +00:00
Here's a fun little snippet that adds 10 to the accumulator using Haskell Monad Magic:
```haskell
test3f2 :: Instruction
test3f2 = replicateM_ 10 (inc (Accumulator))
```
2018-05-25 08:50:04 +00:00
2018-05-25 08:51:32 +00:00
More documentation coming soon!