浏览代码

unignored readme

master
Thorn Avery 4 年前
父节点
当前提交
2be553db25
共有 2 个文件被更改,包括 56 次插入0 次删除
  1. +5
    -0
      .gitignore
  2. +51
    -0
      README.md

+ 5
- 0
.gitignore 查看文件

@@ -0,0 +1,5 @@
*
!*.rkt
!old-code
!README.md
!.gitignore

+ 51
- 0
README.md 查看文件

@@ -0,0 +1,51 @@
# zybino: LR35902ish racket language

very early days for now.

in the racket repl:

```
(run-lines (list
(8b-ld-reg-imm 4 #x01)
(8b-ld-reg-imm 5 #x50)
(8b-ld-reg-imm 7 #x69)
(8b-ld-reg-reg 6 7)
(8b-ld-reg-reg 7 4)
(8b-ld-reg-imm 5 #x51)
(8b-ld-reg-reg 6 7)))
```

will evaluate to:

```
PC: $07, SP: $00, Flags: %00000000
BC: $0000, DE: $0000
HL: $0151, AF: $0100
(HL): $01
$0150 > $69 $01 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 < $0160
```

which is the equivilent of:

```
LD H, $01
LD L, $50
LD A, $69
LD (HL), A
LD A, H
LD L, $51
LD (HL), A
```

# notes

register numbering is following how the LR35902 decodes instructions, as such:

* 0: B
* 1: C
* 2: D
* 3: E
* 4: H
* 5: L
* 6: (HL)
* 7: A

正在加载...
取消
保存