ORG +16514
	LD HL, (+16400)
@DEBUT
	LD A,(4025)
	SUB 7F
	RET Z
	INC HL
	LD A,(HL)
	SUB +44
	JP NZ DEBUT
	INC HL
	LD A,(HL)
	SUB +56
	JP NZ DEBUT
	INC HL
	LD A,(HL)
	SUB +53
	JP NZ DEBUT
	INC HL
	LD A,(HL)
	SUB +51
	JP Z NIV
	LD A,(HL)
	SUB +42
	JP Z ENV
	LD A,(HL)
	SUB +40
	JP Z CYCLE
	LD A,(HL)
	SUB "V"
	CALL Z VAL
	LD A,(HL)
	SUB "F"
	JP Z FREQ
	LD A,(HL)
	SUB "B"
	JP Z BRUIT
	LD A,(HL)
	SUB ">"
	JP Z ZAP
	LD A,(HL)
	SUB "*"
	JP Z EXP
	LD A,(HL)
	SUB "$"
	JP Z BELL
	LD A,(HL)
	SUB "/"
	JP Z CLEAR
	RET
@CLEAR	
	LD B,+13
@CL1
	LD A,B
	OUT 0,A
	LD A,0
	OUT 2,A
	DEC B
	JP NZ CL1
	RET
@BELL
	LD A,7
	OUT 0,A
	LD A,+254
	OUT 2,A
	LD A,1
	OUT 0,A
	XOR A
	OUT 2,A
	OUT 0,A
	LD A,+200
	OUT 2,A
	LD A,+12
	OUT 0,A
	LD A,+25
	OUT 2,A
	LD A,8
	OUT 0,A
	LD A,+16
	OUT 2,A
	LD A,+13
	OUT 0,A
	XOR A
	OUT 2,A
	RET
@VAL
	INC HL
	LD A,7
	OUT 0,A
	LD B,+255
	LD A,(HL)
	SUB 0
	JP Z V1
	RES 0,B
@V1
	INC HL
	LD A,(HL)
	SUB 0
	JP Z V2
	RES 1,B
@V2
	INC HL
	LD A,(HL)
	SUB 0
	JP Z V3
	RES 2,B
@V3
	INC HL
	LD A,(HL)
	CP 0
	JP Z V4
	RES 3,B
@V4
	INC HL
	LD A,(HL)
	CP 0
	JP Z V5
	RES 4,B
@V5
	INC HL
	LD A,(HL)
	CP 0
	JP Z V6
	RES 5,B
@V6
	LD A,B
	OUT 2,A
	RET
@CYCLE	  
	INC HL
	LD A,+12
	OUT 0,A
	LD A,(HL)
	SUB +28
	INC HL
	LD B,(HL)
@SORT
	LD D,A
	LD A,B
	SUB +28
	LD B,A
	LD A,D
	ADD A,A
	ADD A,A
	ADD A,A
	ADD A,A
	ADD A,B
	OUT 2,A
	RET
@NIV
	LD C,8
	LD A,C
	OUT 0,A
	INC HL
	LD A,(HL)
	SUB +28
	OUT 2,A
	INC HL
	INC C
	LD A,C
	OUT 0,A
	LD A,(HL)
	SUB +28
	OUT 2,A
	INC HL
	INC C
	LD A,C
	OUT 0,A
	LD A,(HL)
	SUB +28
	OUT 2,A
	RET
@ENV
	INC HL
	LD A,+13
	OUT 0,A
	LD A,(HL)
	SUB +28
	OUT 2,A
	RET
@FR1
	CALL LONG
	CALL TRAD
	XOR A
	OUT 0,A
	LD A,E
	OUT 2,A
	LD A,1
	OUT 0,A
	LD A,D
	OUT 2,A
	RET
@FR2
	CALL LONG
	CALL TRAD
	LD A,2
	OUT 0,A
	LD A,E
	OUT 2,A
	LD A,3
	OUT 0,A
	LD A,D
	OUT 2,A
	RET
@LONG

	DEC HL
	DEC HL
	DEC HL
	DEC HL
	DEC HL
	DEC HL
	LD B,(HL)
	INC B
@LL1
	INC HL
	DEC B
	JP NZ LL1
	RET
@TRAD
	LD A,(HL)
	SUB +28
	LD D,0
	LD E,A
	DEC HL
	LD A,(HL)
	CP 0
	RET Z
	SUB +28
	LD BC,+10
	CALL ADDI
	DEC HL
	LD A,(HL)
	CP 0
	RET Z
	SUB +28
	LD BC,+100
	CALL ADDI
	DEC HL
	LD A,(HL)
	CP 0
	RET Z
	SUB +28
	LD BC,+1000
	CALL ADDI
	RET
@ADDI
	CP 0
	RET Z
	PUSH HL
	EX DE,HL
@KL
	ADD HL,DE
	DEC A
	JP NZ KL
	EX DE,HL
	POP HL
	RET
@EXP
	INC HL
	CALL LONG
	CALL TRAD
	LD A,7
	OUT 0,A
	LD A,+247
	OUT 2,A
	LD A,8
	OUT 0,A
	LD A,+16
	OUT 2,A
	LD A,+13
	OUT 0,A
	XOR A
	OUT 2,A
	LD A,+12
	OUT 0,A
	LD A,E
	OUT 2,A
	RET
@ZAP
	LD A,7
	OUT 0,A
	LD A,+254
	OUT 2,A
	LD A,8
	OUT 0,A
	LD A,+15
	OUT 2,A
	LD HL,0
	LD BC,+20
@L1
	LD A,1
	OUT 0,A
	LD A,H
	OUT 2,A
	XOR A
	OUT 0,A
	LD A,L
	OUT 2,A
	CALL TIME
	ADD HL,BC
	LD A,H
	CP +4
	JP NZ L1
	LD A,1
	OUT 0,A
	XOR A
	OUT 2,A
	OUT 0,A
	OUT 2,A
	LD A,8
	OUT 0,A
	XOR A
	OUT 2,A
	RET
@TIME
	PUSH BC
	LD C,FF
@TI1
	DEC C
	JP NZ TI1
	POP BC
	RET
@BRUIT
	INC HL
	CALL LONG
	CALL TRAD
	LD A,6
	OUT 0,A
	LD A,E
	OUT 2,A
	RET
@FREQ
	INC HL
	LD A,(HL)
	SUB "A"
	JP Z FR1
	LD A,(HL)
	SUB "B"
	JP Z FR2
	CALL LONG
	CALL TRAD
	LD A,5
	OUT 0,A
	LD A,D
	OUT 2,A
	LD A,4
	OUT 0,A
	LD A,E
	OUT 2,A
	LD C,E
	LD B,D
	RET