Title Hardware Handshaking for Mt-70 Terminals (18_Dec_84) ; ; Copyright 1984 ; Morrow Designs, Inc. ; San Leandro, Ca. .z80 aseg org 0100h ;---------------------------------------------------------------------- ; Equates (18_Dec_84) ;-------------------- ; @Hand_Shake equ 5 ;Hardware Handshake bit Con_Stat_3_Off equ 6 ;Offset to Console Handshake byte Bios_Entry equ 0 ;Bios Entry Point ;Extended Bios Function Numbers EB_Put_Sys_Mem equ 1 ;Write to System Memory EB_Get_CTable equ 6 ;Get character Table Function EB_Init_HndShk equ 10 ;Initialize Hardware Handshake ;---------------------------------------------------------------------- ; Main Line (18_Dec_84) ;---------------------- ; Setup_HandShake: ld a,EB_Get_CTable ;A:= Read Character Table Function call Get_Buffer ;Copy the Character Table to Local Buffer ld a,(Local_Buffer + Con_Stat_3_Off) set @Hand_Shake,a ld (Local_Buffer + Con_Stat_3_Off),a call Put_Buffer ;Move altered Character Table to System ld a,EB_Init_HndShk call Extended_Bios ;Re:Initialize the Baud Rates/HandShake jp Bios_Entry ;Return to the System ;---------------------------------------------------------------------- ; Call the Bios Extended Bios (Cold Boot) Entry Point (1_Aug_84) ;--------------------------------------------------------------- ; 1) The Cold Boot Entry point to the bios (1st entry in the bios ; jump table) is located by looking at locations 1 & 2 which ; point to the warm boot address (the desired address + 3). ; Extended_Bios: push hl ;Save the HL Register Pair ld hl,(Bios_Entry+1) ;HL:= Warm Boot Address ld l,0 ;HL:= Cold Boot Address ex (sp),hl ;HL:= Entry Value; Stack:= Cold Boot Entry ret ;Goto The Cold Boot entry ;---------------------------------------------------------------------- ; Move system memory into the local buffer (30_Jul_84) ;----------------------------------------------------- ; 1) This routine forces the destination to be the local buffer, calls ; the cold start (extended bios functions) entry point, and then saves ; the registers. ; 2) Enter with Accm equal to the extended bios function desired ; Get_Buffer: ld de,Local_Buffer ;DE:= Pointer to Local Buffer call Extended_Bios ;Move System Memory into local buffer ld (Save_BC),bc ;Save the returned registers ld (Save_DE),de ld (Save_HL),hl ret ;Return ;---------------------------------------------------------------------- ; Put the Local Buffer into System Memory (30_Jul_84) ;---------------------------------------------------- ; 1) This is the inverse of GetBuf; It replaces the system's memory ; with the contents of the local buffer. ; Put_Buffer: ld a,EB_Put_Sys_Mem ;Function_1:= Write to system memory ld bc,(Save_BC) ld de,(Save_DE) ld hl,(Save_HL) ;Restore the Returned Registers ex de,hl ;HL:= Swap Source and Destination call Extended_Bios ;Write Buffer back into system memory ret ds 200h - $,0 ;Blank Fill for Debugging ;---------------------------------------------------------------------- ; Local Data Area (30_Jul_84) ;---------------------------- ; Save_BC: dw 0 ;Save location for the BC register pair Save_DE: dw 0 ; " " " " DE " " Save_HL: dw 0 ; " " " " HL " " Local_Buffer: ds 100h,0 ;Local Buffer end