

;
; +-------------------------------------------------------------------------+
; |      This file was generated by The Interactive Disassembler (IDA)      |
; |           Copyright (c) 2019 Hex-Rays, <support@hex-rays.com>           |
; |                      License info: 48-3555-7134-39                      |
; |                     Stefan Berndt, personal license                     |
; +-------------------------------------------------------------------------+
;
; Input SHA256 : 7D0AC5A3352C56821959D3C3F9DB17006B9A830454FB8AC26B4A10F5AB57580A
; Input MD5    : B047EF0A0B0E304C248F6CCB94E56091
; Input CRC32  : E86CD2F9

; File Name   : /home/stefan/melodiegenerator.bin
; Format      : Binary file
; Base Address: 0000h Range: 0000h - 0100h Loaded length: 0100h

; Processor       : z80 []
; Target assembler: Zilog Macro Assembler

; ===========================================================================

; Segment type: Pure code
                segment ROM

; =============== S U B R O U T I N E =======================================


sub_0:                                  ; CODE XREF: sub_0+F↓p
                                        ; sub_0+36↓j
                di
                im      1
                ld      b, 1
                jr      loc_16
; ---------------------------------------------------------------------------

loc_7:                                  ; CODE XREF: sub_0+D↓j
                                        ; sub_0+28↓j
                ei

loc_8:                                  ; CODE XREF: sub_0+B↓j
                inc     hl
                ld      a, h
                or      l
                jr      nz, loc_8
                jr      loc_7
; ---------------------------------------------------------------------------
                rst     0

loc_10:                                 ; CODE XREF: sub_0+14↓j
                                        ; sub_0+A5↓p
                in      a, (23h)
                cp      1
                jr      nz, loc_10

loc_16:                                 ; CODE XREF: sub_0+5↑j
                ld      a, 33h ; '3'
                out     (20h), a
                add     a, 40h ; '@'
                out     (21h), a
                out     (22h), a
                out     (23h), a
                xor     a
                cp      b
                jr      z, loc_43
                inc     a
                cp      b
                jr      z, loc_7
                inc     a
                cp      b
                jr      z, loc_81
                inc     a
                cp      b
                jr      z, loc_43
                inc     a
                cp      b
                jr      z, loc_78
                jr      sub_0
; ---------------------------------------------------------------------------

IRQ_Entry:                              ; CODE XREF: sub_0+3D↓j
                inc     hl
                ld      a, (hl)
                inc     a
                cp      0F1h
                jr      nz, IRQ_Entry
                inc     hl

loc_40:                                 ; CODE XREF: sub_0+69↓j
                ld      c, (hl)
                jr      loc_44
; ---------------------------------------------------------------------------

loc_43:                                 ; CODE XREF: sub_0+24↑j
                                        ; sub_0+30↑j
                exx

loc_44:                                 ; CODE XREF: sub_0+41↑j
                inc     hl
                ld      a, (hl)
                cp      0EFh
                jr      nc, loc_A6
                ex      af, af'
                ld      a, (hl)
                exx
                ld      e, 2
                and     7
                cp      6
                jr      c, loc_58
                inc     e
                sub     4

loc_58:                                 ; CODE XREF: sub_0+53↑j
                ld      hl, unk_B5
                add     a, l
                ld      l, a
                ld      c, (hl)
                ex      af, af'
                and     0F8h
                pop     bc
                xor     (hl)
                nop
                jr      loc_6B
; ---------------------------------------------------------------------------

NMI_Entry:
                ld      hl, unk_EB
                jr      loc_40
; ---------------------------------------------------------------------------

loc_6B:                                 ; CODE XREF: sub_0+64↑j
                ld      l, unk_B9
                rrca
                rrca
                add     a, l
                ld      l, a
                ld      d, (hl)
                inc     hl
                ld      l, (hl)
                exx
                ld      a, c
                exx
                ld      h, a

loc_78:                                 ; CODE XREF: sub_0+34↑j
                ld      b, 2
                ld      a, 77h ; 'w'
                out     (23h), a
                ld      a, b
                jr      loc_9C
; ---------------------------------------------------------------------------

loc_81:                                 ; CODE XREF: sub_0+2C↑j
                ld      a, e
                ld      b, 3
                cp      b
                jr      nz, loc_89
                inc     b
                dec     e

loc_89:                                 ; CODE XREF: sub_0+85↑j
                ld      a, 77h ; 'w'
                out     (21h), a
                ld      a, d
                out     (21h), a
                ld      a, 77h ; 'w'
                out     (22h), a
                ld      a, l
                out     (22h), a

loc_97:                                 ; CODE XREF: sub_0+AC↓j
                ld      a, 77h ; 'w'
                out     (23h), a
                ld      a, c

loc_9C:                                 ; CODE XREF: sub_0+7F↑j
                out     (23h), a
                ld      a, 37h ; '7'
                out     (20h), a
                ld      a, h
                out     (20h), a
                rst     10h

loc_A6:                                 ; CODE XREF: sub_0+48↑j
                ld      b, 0
                ld      h, b
                inc     b
                ld      c, 0FFh
                jr      loc_97
; End of function sub_0

; ---------------------------------------------------------------------------
                db  47h ; G
                db 0D9h
                db  79h ; y
                db 0D9h
                db  67h ; g
                db  18h
                db 0E2h
unk_B5:         db    5                 ; DATA XREF: sub_0:loc_58↑o
                db  0Dh
                db  55h ; U
                db    8
unk_B9:         db  6Bh ; k             ; DATA XREF: sub_0:loc_6B↑o
                db    6
                db  65h ; e
                db    6
                db  8Fh
                db    4
                db  6Bh ; k
                db    8
                db  65h ; e
                db    8
                db  6Dh ; m
                db    7
                db  67h ; g
                db    7
                db  55h ; U
                db    8
                db  6Bh ; k
                db    6
                db  65h ; e
                db    6
                db  8Fh
                db    4
                db  87h
                db    4
                db  66h ; f
                db    5
                db  25h ; %
                db  0Dh
                db 0E3h
                db    2
                db  6Bh ; k
                db    4
                db  65h ; e
                db    4
                db 0BFh
                db    2
                db  2Dh ; -
                db    8
                db  55h ; U
                db    4
                db  6Bh ; k
                db    3
                db  65h ; e
                db    3
                db  8Fh
                db    2
                db  1Eh
                db    9
                db  33h ; 3
                db    5
unk_EB:         db    0                 ; DATA XREF: sub_0:NMI_Entry↑o
                db    0
                db    0
                db    0
                db    0
                db    0
                db    0
                db    0
                db    0
                db    0
                db    0
                db    0
                db    0
                db    0
                db    0
                db    0
                db    0
                db    0
                db    0
                db    0
                db    0
; end of 'ROM'


                end
