Skip to content

Instantly share code, notes, and snippets.

@XMPPwocky
Created June 29, 2023 06:07
Show Gist options
  • Save XMPPwocky/215d67525a4757ceb57e39a9dbc910e0 to your computer and use it in GitHub Desktop.
Save XMPPwocky/215d67525a4757ceb57e39a9dbc910e0 to your computer and use it in GitHub Desktop.
there are 16 registers in the following code's ISA.
register 0 is also special, it's the accumulator; many instructions write to it
"in" and "out" are special- they access "audio registers"
(there's 4: 0 and 1 are input audio, 2 is a constant table; 3 is output audio (Out always writes here))
"seek" and "tell" seek/tell in those audio registers
"filter" is a convolution operation
0000: call 09e2
0001: Filter 1b 2d f0
0002: Mov 02 02 6c
0003: Mul 5f bc 69
0004: call 0549
0005: Mul 69 2f 77
0006: In 6c 74 3f
0007: Add e4 08 6c
0008: Ret ab 23 84
0009: jmp 0298
000a: Filter 3c 7a f6
000b: Push cd 68 07
000c: Filter 2b cb e9
000d: Seek 29 85 04
000e: Xor 78 80 a3
000f: Ret 41 24 a0
09e0: Const16 00 d4 f5
09e1: Push db 01 b2
09e2: Test e7 a8 df
09e3: call 0aed
09e4: Tell 0b 52 02
09e5: Xor 7d b3 82
09e6: jif 39 00 a37
09e8: Tell 04 02 e2
09e9: Tell d7 84 ca
09ea: Mov 2c db e0
09eb: Test 4b 00 b6
09ec: Push d9 7f dc
09ed: Mov e8 ff ff
09ef: Tell d1 6c 0d
0ae0: Filter 75 65 02
0ae1: Mul 02 05 d6
0ae2: Filter 06 b4 69
0ae3: In 7f 02 b4
0ae4: Test a5 9e 68
0ae5: Pop 1c c7 bf
0ae7: Tell 6b 9b 02
0ae8: Sub 6e 42 79
0ae9: call 0013
0aea: In 74 03 a4
0aeb: Add 04 4c 4e
0aec: Tell a7 6a a1
0aed: Sub f1 02 04
0aee: Out ff 01 ca
0aef: Tell ee e1 c5
0af0: Mov bd 5a f5
0af1: Const16 11 71 01
0af2: Out 8d 23 6f
0af3: Out 03 f1 00
0af4: Mul 2d 33 00
0af5: In ad 7f 26
0af6: Out 7b cf 4d
0af7: call 0afa
0af8: jmp 0afa
0af9: Mul e1 ff 0d
0afa: Seek ca a5 80
0afb: call 0fff
0afc: Mul d0 04 2d
0afd: Add a0 00 1a
0afe: Pop 00 80 97
0aff: call 08e1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment