.ORG 0000h LD SP, 0080h ; ADDED FOR TESTING PURPOSES. CALL RND ; ADDED FOR TESTING PURPOSES. HALT ; ADDED FOR TESTING PURPOSES. RND: LD A,R ; Load the A register with the refresh register. LD L,A ; Copy register A into register L. AND 00111111b ; This masking prevents the address we are creating from accessing RAM. LD H,A ; Copy register A into register H. LD A,(HL) ; Load the pseudo-random value into A. RET .END