diff options
author | Astatin <[email protected]> | 2024-09-19 18:55:25 +0900 |
---|---|---|
committer | Astatin <astatin@redacted> | 2024-09-19 18:55:25 +0900 |
commit | 1680bc5146b25d3631e6b7bfee3946ef59d906fd (patch) | |
tree | 5aac450b147ab4c02b51f2968caefbc343a0a577 /examples/minimal.gbasm | |
parent | 7f41367ce01fbecaec6eb5f173152a59fe55e669 (diff) |
Create 1st draft of new assembler in go
Diffstat (limited to 'examples/minimal.gbasm')
-rw-r--r-- | examples/minimal.gbasm | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/examples/minimal.gbasm b/examples/minimal.gbasm new file mode 100644 index 0000000..33405c3 --- /dev/null +++ b/examples/minimal.gbasm @@ -0,0 +1,37 @@ +.PADTO 0x0100 +Entry: + JP =Start + +.PADTO 0x0104 +Nintendo_Logo: ; The Nintendo logo must be stored in bytes 0x104-133 + .DB $CE,$ED,$66,$66,$CC,$0D,$00,$0B,$03,$73,$00,$83,$00,$0C,$00,$0D + .DB $00,$08,$11,$1F,$88,$89,$00,$0E,$DC,$CC,$6E,$E6,$DD,$DD,$D9,$99 + .DB $BB,$BB,$67,$63,$6E,$0E,$EC,$CC,$DD,$DC,$99,$9F,$BB,$B9,$33,$3E + +.PADTO 0x0134 +Checksum: ; The bytes 0x134-0x14d need to add up to 0xe7 (= 0xff - 0x19) + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$e7 + +Start: + Wait_VBlank: + LD A, (0xFF00+$41) + AND $03 + CP $01 + JR NZ, =Wait_VBlank + LD A, $00 + LD ($40), A + + LD HL, $8000 + VRAM_Clearing_Loop: + LD A, $ff + LD (HL+), A + LD A, H + CP $A0 + JR NZ, =VRAM_Clearing_Loop + + LD A, $91 + LD ($40), A + + Lock: + JR =Lock |