.Z80 ASEG ; ; KPRESET.COM is a program that performs a cold boot for ; Kaypros. I have verified that it works on 10s and the "84" ; models. It may also work on vintage machines. Although ; the program clearly is not a remedy for hanging up your ; micro, it is a welcome and valuable utility for other ; situations. ; ; Brian Adsit May 30, 1985 23:50 ; ; The program relocates its code to shared RAM (shared with bank 0 and ; bank 1), reads and modifies the system port to switch to ROM code and ; then jumps to the cold boot routine in ROM. ; ; ORG 100H DEST EQU 8000H ; Address where code will be relocated SYSTEM EQU 1CH ; System port on Kaypro II ; LD HL,BEGIN ; Source address LD DE,DEST ; Destination address LD BC,ENDCOM-BEGIN ; Length of move LDIR ; Move code to high RAM JP DEST ; And branch to it ; ; System port on Kaypro II ; BEGIN: IN A,(SYSTEM) ; Get current system port SET 7,A ; Turn on the ROM OUT (SYSTEM),A ; And output it to system port ; ; System port on later models ; IN A,(14H) SET 7,A OUT (14H),A JP 0 ; Branch to the cold boot routine in ROM ; ENDCOM EQU $ ; Address of last byte to move ; END