Window Module
This module is handles all things window related... A summary of the routine inputs/outputs for this module are found here or downloaded in Lotus Wordpro 97 format here (50KB)
Download:
; /////////////////////////////////////////////////////////////
; // Window Interface Module
; // (c) 1999 Geoff Knagge, Andrew Carr, Mark Lynn
; // last modified : 22/10/1999
; //
; /////////////////////////////////////////////////////////////
WinData:
; status : bit 7 = 1 if in secure state
; bits 3-0 = controlling zone
.byte 02H ; Window 1 status
.byte 01H ; Window 2 status
.byte 08H ; Window 3 status
.byte 08H ; Window 4 status
.byte 08H ; Window 5 status
.byte 08H ; Window 6 status
.byte 08H ; Window 7 status
.byte 08H ; Window 8 status
;//////////////////// Data Accessor Routines
SWgopen: ; get window open status
; input : C = window number,
; output: A = zero if locked
push hl
push bc
mvi b,0
lxi hl,SW_Masks
dad bc ; point to right cell
mov a,m ; read masking info
lxi hl,SW_open ; point to lock info
ana m ; get the bit
pop bc
pop hl
ret
SWgCtZone: ; Gets the controlling zone in A
; input : C = window number, 0 = window 1
; output: A = zone number
push bc
push hl
push de
mvi b,0
lxi hl,WinData ;point HL to the Window array
dad bc ;move to correct array element
mov a,m ;load old zone data
ani 0F ;clear other data
pop de
pop hl
pop bc
ret
;//////////////////// IO Routines
SW_Masks: .byte 01,02,04,08,10,20,40,80
SW_open: .byte 0 ; window open bits in
SW_read: ; read window open statuses
push af
in WinPort
sta SW_open
pop af
ret
;//////////////////// Data Modifying Routines
SW_T2Secure: ; Try to secure a window. Input: C=window
; if it is closed, then secure it
push af
call SWgOpen
cpi 0 ; check what's left over
jnz SWeT2Secure ; not zero, therefore open
call SW_Secure ; closed, so secure it
SWeT2Secure:
pop af
ret
SW_Alarm: ; Check a window - if it's open and secure, give alarm
; input : C = window number, 0 = window 1
; output: A = FF if security violated, 00 otherwise
push bc
push hl
call SWgSecure
cpi 00 ; is it set?
jz SWeAlarm ; no, window isn't classed as secure
; yes, now check if it's open
call SWgOpen
cpi 0
jz SWeAlarm ; if 00, window is closed and no alarm
mvi A,0FF ; set alert code
SWeAlarm:
pop hl
pop bc
ret
SW_CtZone: ; Sets a window's controlling zone
; input : C = window number, 0 = window 1
; A = zone number, only bits 3-0 used
push af
push bc
push hl
push de
mvi b,0
lxi hl,WinData ;point HL to the Window array
dad bc ;move to correct array element
ani 0F ;masks the other bits
mov e,a ;E = controlling zone
mov a,m ;load old zone data
ani 0F0 ;clear old controlling zone
add e ;add in the new data
mov m,a ;save it
pop de
pop hl
pop bc
pop af
ret
SW_secure: ; sets a window to its secure state
; input : C = window number, 0 = window 1
push af
push bc
push hl
mvi b,0
lxi hl,WinData ;point HL to the Window array
dad bc ;move to correct array element
mov a,m ;get the status byte
ori 80 ;set secure bit
mov m,a ;store the new status byte
pop hl
pop bc
pop af
ret
SWgsecure: ; gets a windows secure state
; input : C = window number, 0 = window 1
; output: A= state
push bc
push hl
mvi b,0
lxi hl,WinData ;point HL to the Window array
dad bc ;move to correct array element
mov a,m ;get the status byte
ani 80 ;get secure bit
pop hl
pop bc
ret
SWgLock: ; is a window (zone) locked?
push hl
push de
push bc
call SWgCtZone
call SZgLock
pop bc
pop de
pop hl
ret
SW_unsecure: ; resets a windows secure state
; input : C = window number, 0 = window 1
push af
push bc
push hl
mvi b,0
lxi hl,WinData ;point HL to the window array
dad bc ;move to correct array element
mov a,m ;get the status byte
ani 7F ;clear secure bit
mov m,a ;store the new status byte
pop hl
pop bc
pop af
ret
|