Tutorial 9
Using a Program to turn off the calculator

Overview

This program will turn off the calculator. WOW!

Programming

The code is simple, it dosn't even include any ROM calls! Follow along now.

#define B_CALL(xxxx)	rst 28h \ .dw xxxx		
#define B_JUMP(xxxx)	call 50h \ .dw xxxx	

	.org 9D95h	
	
	DI			; disable interrupts
        LD A,001H		; Loading 0 to "a" register
        OUT (003H),A		; turn off screen
	EI			;enabling intterupts
        RET                

.end
END

New Commands Used

DI - z80 Instruction that Disables Interrupts
EI - z80 Instruction that Enables Interrupts

Conclusion

What's to explain?

Tutorial 10