mirror of
https://github.com/KarolS/millfork.git
synced 2026-04-20 03:16:45 +00:00
Some more documentation
This commit is contained in:
@@ -110,4 +110,26 @@ class AssemblySuite extends FunSuite with Matchers {
|
||||
""".stripMargin)(_.readWord(0xc000) should equal(0x100))
|
||||
}
|
||||
|
||||
test("Example from docs") {
|
||||
EmuBenchmarkRun(
|
||||
"""
|
||||
| byte output @$c000
|
||||
| void main () {
|
||||
| output = ten()
|
||||
| }
|
||||
| const byte fiveConstant = 5
|
||||
| byte fiveVariable = 5
|
||||
|
|
||||
| byte ten() {
|
||||
| byte result
|
||||
| asm {
|
||||
| LDA #fiveConstant
|
||||
| CLC
|
||||
| ADC fiveVariable
|
||||
| STA result
|
||||
| }
|
||||
| return result
|
||||
| }
|
||||
""".stripMargin)(_.readByte(0xc000) should equal(10))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user