Microprocessor-based event sequence recorder

Microprocessor-based event sequence recorder

Microprocessor-based event sequence recorder Process industries often depend on careful monitoring of several parameters and events. T V Karthikeyan*,...

477KB Sizes 0 Downloads 41 Views

Microprocessor-based event sequence recorder Process industries often depend on careful monitoring of several parameters and events. T V Karthikeyan*, K S Rajashekara and S R Bhat have designed a recorder to meet this need

An event sequence recorder is a specialized piece of equipment that accepts inputs from switches and contactors, and prints the sequence in which they operate. This paper describes an event sequence recorder based on an Intel 8085 microprocessor. It scans the inputs every millisecond and prints in a compact form the channel number, type of event (normal or abnormal) and time of occurrence. It also communicates these events over an RS232C link to a remote computer. A realtime calendar/clock is included. The system described has been designed for continuous operation in process plants, power stations etc. The system has been tested and found to be working satisfactorily. microsyslems processcontrol

eventsequencerecording

In many process industries, the performance and operation of the plant depends on a large number of parameters and events. It may be necessary to monitor and report the sequence of events that resulted in tripping or shut down of a plant. The event sequence recorder is a specialized piece of equipment which detects the numerous and often rapidly occuring events and transmits the critical events to the plant personnel. This helps in analysing the reason for maloperation of the plant. With discrete logic circuits, the system was extremely complicated, and expansion to cater for more input events was not possible w i t h o u t major changes in the hardware. Using microprocessors, it has been found that the event sequence recorder could be more sophisticated, and many more features could be implemented, with little or no extra hardware. This paper describes the development of hardware, software and the input unit for a microprocessor-based

Centre for Electronics Design and Technology, Indian Institute of S(ience, Bangalore 560012, India *On deputation from Reactor Research Centre, Kalpakkam, India

T V Karthikeyan graduated with a BE in electronics and communication from the College of Engineering, Guindy, Madras University, India, in 1974. He then joined the Reactor Research Centre of the Department of Atomic Energy, India. He has primarily engaged in the development of microprocessorbased instruments and laboratory automation using microprocessors. The work described was undertaken by him as part of a postgraduate diploma in electronics design and technology at the Indian Institute of Science, Bangalore, in 1983-1984. K S Rajashekara was born in 1951 in Devarayasamudram, Karnataka, India. He obtained his BE, ME and PhD in 1974, 1977 and 1983 respectively. In 1977 he joined the Centre for Electronics Design and Technology (Indian Institute of Science, Bangalore) as a scientific officer. He has been a senior scientific officer since 1981. His main interests are in power electronics and microprocessor applications to industrial systems. S R Bhat obtained his BE from UVCE, Bangalore, India, in 1972 and an MTech from the Indian Institute of Technology, Kanpur, in 1974. From 1974 he has been working at the Centre for Electronics Design and Technology (Indian Institute of Science, Bangalore). He is currently a senior scientific officer at the Centre. His research interests include microprocessor application to power electronics and solarphotovoltaic energy conversion. event sequence recorder. Standard CPU, m e m o r y and o u t p u t boards based on the Intel 8085 microprocessor are used. The input unit hardware was d e v e l o p e d to sense 24 V o r 110 V from an u n c o m m i t t e d contact or a voltage input. In order that an event's t i m e of occurrence and the resolution between events is maintained, the software is divided into two parts: synchronous and asynchronous.

0 1 4 1 - 9 3 3 1 / 8 4 / 0 9 4 9 2 - 0 6 $03.00 © "1984 Butterworth & Co. (Publishers) Ltd

492

microprocessors and microsystems

The asynchronous software detects changes from the normal state and prints them out. It is this division of software that has made it possible to achieve the results which in other equivalent instruments require at least two processors.

SPECIFICATION OF THE EVENT SEQUENCE RECORDER The specifications of the event sequence recorder are • 128 channels of randomly occuring events coming from contactors and switches are scanned • 2 kV isolation between the inputs and microprocessor system • audio-visual alarm on detection of certain events • continuous display of real time in hours, minutes and seconds • printing of normal or abnormal events on each channel to a resolution of 1 ms • print-out of the sequence of events • software debouncing of switches

SYSTEM DESIGN A schematic block diagram, meeting these above specifications, is shown in Figure 1. The essential function of the system is to detect a change of state in any one of the numerous digital inputs to a high resolution in the time domain, and to print a message for each change, in the order of occurrence, This can be implemented in a number of ways, discussed below. One possible approach is for the digital inputs to be connected to the interrupts of the processor, such that any change of state can interrupt the processor. In this case, normally the processor maintains only the realtime clock and the other routine operations. When an event occurs, the processor prints the time along with the channel number of the event which caused the interrupt. The above approach has many disadvantages. When several events occur simultaneously, only the toppriority event is reported by the interrupt controller. This has then to be masked b y t h e processor to look for other events. There is also a dead time between the recognition of successive events, so that detection of the exact time of occurrence of an event is not possible. Only one transition on the input condition can be 230V,50Hz

256 wires

[-Z > K B E display rinter

[[

detected, namely normal to abnormal, whereas in practical circumstances both normal-to-abnormal and abnormal-to-normal transitions should be considered as events. Implementing this would require a lot of extra hardware. Also, debouncing of the switches in software is not possible. No debouncing would cause multiple interrupts, and hardware debouncing would delay the detection of events. Hence this system cannot be considered. The other solution is for the computer to scan the inputs fast enough to meet the resolution requirements. Here again the inputs can be scanned either directly by the computer, or by a direct memory access controller which transfers the inputs to memory where the computer takes care of further processing. After an approximate calculation of time saved by using a direct memory access controller, it was found that the additional hardware does not result in proportional advantage. Hence it was decided to use a simple scanning scheme, which reduces the hardware complexity.

Design approach After considering various possible solutions, the following approach was selected. The inputs are connected to the system as simple input ports. The computer scar]s the inputs, detects whether they are different from the previous states; if they are, the computer stores this information in a TLCbuf (time-of-last-change buffer). The TLCbuf is allocated for each channel separately. This is done by the interrupt service software every millisecond. The main program checks the TLCbuf for a change lasting longer than 5 ms, to allow for debouncing. This is recorded as an event and the TLCbuf is transferred to an EVEbuf (event buffer) along with the channel number. This is picked up by the printer handler software and printed out. The design of the electronic hardware to implemer~t the system is discussed next.

Microcomputer unit The microcomputer unit is based on an Intel 8085 microprocessor. It is configured from a standardized set of single Euroboards. The CPU board is Eurobus compatible and contains the 8085 CPU and buffers fl,r the address, data and control buses. It also has an auxiliary connector where the nonbus signals are terminated. The unit uses 4 k b y t e of EPROM and 2 kbyte ~f RAM. The peripheral board contains LSI chips for the console keyboard display and the parallel printer, and a timer for the realtime clock. The dual USART board has two independent serial channels, and a baud rate generator and address decoder. The serial channels are used to communicate with a remote computer and a CRT. Both support an RS232C interface.

I~ Remote coml)uter

Input unit Figure 1.

Block diagram of the event sequence recorder

vol 8 no 9 november 1984

The input unit connects the field inputs to the micr~-

4c~3

processor system via input ports. It can handle voltagefree contacts, or contacts with a field control voltage of 24 V or 110 V. For voltage-free contacts, a floating supply of 24 V is provided by the system. The inputs are optoisolated and protected against noise and reverse connections. A low-pass filter is included to filter out spurious pulses of up to 1 ms wide. The output of the optoisolator is connected to the microprocessor bus through a Schmitt trigger input tristate buffer, to enhance noise immunity further. This also has an onboard address decoder. The ports have been mapped in the memory space of the 8085 to make best use of the register-indirect addressing instructions of the 8085. The circuit schematic diagram is shown in Figure 2.

Diagnostics '[]

Initia ize

4 Evedet

1

SO F T W A R E

Pri'

J

Read consoh, l P,TCUPD 1

The overall working of the software is as follows. When the system is initialized, a timer is set to interrupt the processor every millisecond. At each interrupt, the processor updates the realtime clock, scans the events and stores them in a buffer. If there isachange from the previous scan, these changes are stored for each channel in a TLCbuf, along with the time of occurrence of the event. The EVEDET (event detect routine) scans through the TLCbuf, debounces the events and stores them with their channel numbers and time of occurrence in ar EVEbuf (event buffer). The PRNT (printer driver) routine prints the event from EVEbuf and also transmits them to the remote computer. The overall flow chart is shown in Figure 3. The most (ritical decisions in the software design were to identify those tasks to be performed by the interrupt routine and those by the main routine. To maximize the response of the system, the tasks are divided as follows. The RTCUPDT (realtime clock update) routine and the UPDTLC (scan and update TLCbuf) routine are executed on interrupt. The other routines including console handler, are executed as the main routine. The functions of some of the important subroutines are briefly explained below.

Real time clock The most widely used technique for realtime clocks is to employ separate hardware and a display so that the computer can read the time when required. However, the technique used here is a combination of hardware and software. The realtime image in the memory is updated on every millisecond interrupt, provided for scanning. The display is updated every second. This +SV R2 ~a] 47 kS2 1

D1

|

LS244

/

• Data bt,s C1

' le

I

Figure 2.

494

I IL _ = T I L 1 1 6JLf

Scflematic diagram of the input circuit

I

Scm

Console handler

a

[

b

Figure 3. Flowcharts for (a) the main routine and (b) the RTC interrupt service routine approach reduces hardware; moreover, since Scan and RTCUPDT form part of the RTC interrupt service routine, the display showing the realtime confirms the proper functioning of the software.

Scan This routine is executed every millisecond after the RTCUPDT routine. It scans the inputs and compares them with the previous scan values. If there is a change in a channel, it stores the current time in the TLCbuf of that channel, provided it is enabled. The time taken to process a change is significant: if more than eight channels change in the same scan, the next RTC interrupt may occur before this service routine is completed. This may lead to the stack becoming mixed up. To eliminate this problem, a SAVE flag, which is normally reset, is tested on entry to Scan. If this flag is reset, registers are saved and the flag is set. Otherwise, it means that the routine has interrupted itself. In this case, the registers need not be saved and the return address on the stack can be popped off and ignored. While restoring registers at the end of the routine, the SAVE flag is also reset. The flowchart of this routine is shown in Figure 4. To compensate for the difference in the speeds of events occurring and being printed out, a special ringtype buffer is implemented in memory by software. The EVEDET routine fills the buffer and increments a counter. The print routine prints out that event and increments another counter. A buffer-full flag is set if

microprocessors and microsystems

No

0

Yes

1 i

Save all registers

1 Set save

5

Irlput port

q

[ I.:l [) ,, T LCl,ut Hit(

E~. Et, ]f

I

Yes

i

J

uu ,.

Ir~c

,

Store ACCR in Prebuf

Mask with Enmask

Trackdown changes UPDTlLebuf

,i N ° @ y e s J Restore registers Reset save flag

Figure 4.

flowchart for the Scan routine

the event counter is found equal to the print counter after an event is stored. The flowchart for the EVEDET routine is shown in Figure 5.

Figure 5.

Flowchart for the EVEDET subroutine

software. Linking of this software with the EVEDET and PRNT routines had to be done carefully. The system was designed so that the main routine acts as the console handler and the EVEDET and PRNT subroutines are called from this as often as possible. In this way, although the system is ready to accept console inputs any time, it spends a minimum amount of time on the console handler itself.

Debug Console handler The console software provides the following user functions: setting time and date, enable or disable channels, program normal status of channels, run diagnostics, print status or summary, and debug mode. The commands have been made helpful to the user. For example when the 'Tim' key is pressed, the 'Hours' field on the display starts blinking. Any identical decimal key updates the hours display only. After a comma key, the blinking shifts to minutes and so on. Once the command is terminated, the display resumes showing the time. Similarly, while enabling channels, consecutive channels can be enabled by just pressing the comma key repeatedly, or random channels can be enabled by directly entering the channel number. In any case, the enabling is valid after the comma key is pressed. That is, there is no separate run key in the system to bring the parameters entered into effect. They are accepted 'on the fly'. This is an essential requirement of this system. Since an event occurring while the operator is changing a parameter cannot be ignored, the console handler operates in parallel with the rest of the

vol 8 no 9 november 1984

The debug command puts the system in a monitor mode in which the user has access to various registers and to the microprocessor memory, for debugging pu rposes. Small test routines can also be entered and executed in this mode. The MDS-231 microprocessor development system from Intel Corporation, USA, was used for the develot)ment of the software.

CONCLUSIONS The system was tested thoroughly using a swit(h simulator. It resolves events occurring in successive milliseconds, and prints events occurring within a millisecond as simultaneous events. This resolution is suitable for the operating times of relays and contactors used in the process industry. To simulate an industrial environment, the system was connected to a noise simulator, and was found to work without any degradation. It has also been operated continuously for more than seven days, with all parts of the software and hardware being exercised.

49!;

The system was found to be working satisfactorily. The event sequence recorder is suitable for use in any process industry, in power stations etc. This system can be expanded to handle 1024 channels with minimum degradation in the number of simultaneous events detected. REFERENCES 1

M C Mulder, and Fasahg, P P 'A microprocessor controlled substation alarm logger' Proc. Ind. Appl. Microprocessors, 20-22 March 1978 I ECI (1978) MC$-85 user's manual Intel Corporation, USA (1981) Intel Components Data Catalog 1983 l(atthikeyan,T V et al. 'Standardisation of microcomputer hardware and software' RRC Report (1981)

2 3 4

A P P E N D I X 1: SOFTWARE SEQUENCE R E C O R D E R LOC

OBJ

0F78 0F80 0080 2100 0F28 OF70 2100 2110 2120 2130 0006 0000 0080 0080 0001 2280 2580 2582 2583 25BC 2~84 27F0 0000 0078 1800

1800 1600 1802 210021 1808 D878 1807 BE 1808 C21B18 1808 3E7F 1800 320618 1810 23 1811 14 1812 7A 1813 FEIO 1815 C20518 1818 C35A18 181B 47 181C AE 1810 70 181E OEO0 1820 1F 1821 DA2C18 1824 OC 1825 B7 1826 622018 1829 C:31018 182C 47 1820 7A 182E 87 182F 87 1830 87

496

THE

EVENT

SOURCE STATEMENT

LINE I

FOR

;

THE FOLLOWING DEFINES THE DATA 8TRU~TURE FOR THE PROJET. 2 ROMES EOU OFYgH~ ROM ERROR MESSAGE POINIE R 3 RAME8 EOU OFSOH; R A M E R R O R M E S S A G E F'OINTE R 4 TOTCH EQU 128 5 ORG 2100H 6 CHMASE EQU OF28H 7 NORMES EOU OF70H 8 PREDUF: DS IOH 9 ENMASK: D8 108 I 0 STOBUF: DS IOH 11 EVEDUF: DE: 6-6,4~ 64 EVENTS EACH OF 6 BYTE S IN LENGTH 12 INCR EOU 6H 13 N O R M EQU 0 14 A B N O R M EUU 80H 15 CHABIT EQU 80H 16 EVEBIT EQU I 17 T L C B U F : D S 6*TOTCHI ILCBLIF IS 6 BYTE S PER CHANNEL 1B E V E P T R : D S 2; T H I S P O I N T S TO I H E N E X T EVENT TO BE SFORED 19 EVECR: 0 8 I 20 PDWTCR: DS I 21 E N R r C EQU 2~BCH; A " O N E " HERE D I B B L E S R T S U P D T lO DISPLAY. 22 BUFFUL: DS I 23 STK EQU 27FOH 24 O H N O H I 8Er 0 2 5 PORT SET 07SH 26 SEJECT 27 ORO 1800H 28 ; THE NEXT PACKAGE SENSES A CHANGE IN THE INPUT SIATUS AND COPIES 29 ; THE TIME OF LAST CHANGE IN A BUF FER CALLED 'TIME OF LAST 30 ; CHANGE BUFFER'. THE EVENT DETECT ION SOFTWARE WHICH FOLLO 31 ~ WS DETEClS WHETHERTHE LAST CHAN OB HAS BEEN 8TABLE FOR 32 ; • MORE THAN 5 MILLISECONDS,AND IF S O DETERMINES: THR S E N S E 33 ; OF CHANGE AND STORES THIS AND OH ANNEL NO. ALONGWITH 84 ; REAL TIME INFO ON WHEN THE CHANG E WAS ACTUALLY DETECTED 35 ; IN AN EVENT BUFFER FOR FURTHUR P ERUSAL BY THE PRINT 36. ; SOFTWARE. 37 UPDTLC: MVI D,OH 88 LXI H,F'REBUF 39 LOOP: IN PORT 40 CMP M 41 JNZ LIP1 42 MVI A,07FH 43 8TA LOOP+I 44 UP2: INX H 45 INR b 46 MOV A,D 47 CPI /OH 48 JNZ LOOP 49 JMP DET 50 UPI: MOV B.A 51 XRA N 52 MOV M,B 5:3 MVI C,O 54 LOOP/: BAR 55 JC FOUND 56 AGAIN: INR C: 57 ORA 8 58 JNZ LOOP/ 59 JMP UP2 6 0 FOUND: NOV B,A 61 NOV A,D 62 ADO A 63 ADO A 64 ADD A

LOC

OBJ

1831 81 1832 05 1833 E5 1834 110000 1837 62 1838 5F 1838 6F 188A 29 1838 19 183C: 29 1830 EB 183E 21D022 1841 19 1842 I I A 0 2 0 1843 3680 1847 23 1848 C5 1849 0E05 1 8 4 8 IA 184C 77 184D 23 I8~E 13 184F OO 1850 C24818 1858 CI 185~ E1 1855 DI 1856 78 185/ C32418 185A OE7F 185C 218022 185F 7E 1860 07 1861 DA6D18 1864 IIFAFF 1867 19 1 8 6 8 OO 1869 F25F18 186C C9 1860 23 186E 3AA020 1871 96 1 8 7 2 FE05 1874 DA6418 1877 28 1878 8600 187A 23 18~D EB 18YC 78 I870 EgF8 187F OF 1880 OF 1881 OF 1 8 8 2 D5 1883 110021 1886 7 D 1887 8 t 1888 6F 1889 36 188A C620 188C ~E 1880 21280F 1890 79 1891 E 6 0 7 1893 85 1894 6F 1895 7A 1896 AB 189"7 A 6 1898 C A D I g 189B 3E80 189D 81 189E 2AE025 ISAI 7 7 18A2 23 1 8 A 8 Dl 18A4 C 5 18A50E05 18A7 1A 18A8 77 18A9 23 18AA 13 18A8 OD 1SAC C2A718 18A~ C l 18B0 22B025 1883 218225 1886 7E 1887 3C 1888 E63F 188A 77 18BB C2C618 18BE E5 188F 213021 18C2 228025 18C5 E l 18C6 23 18C7 BE 18C8 E8 18CY C26418 18CC 3EOI 18CE 828425 1801 036418

2080 20A5

LINE

SOURCE STATEMENT

65 ADD C: 66 PUSH D 67 PUSH H 68 LXI D,0 69 NOV H,D 70 MOV E,A /1 MOV L,A 72 DAD H 73 DAD D 74 DAD H 75 XCHO 76 LXI H,TLCBUF 77 DAD D 78 L×I D,RTSAV 79 MVI M,gOH 80 INX H 81 PUSH D 82 MVI C,5 83 LOOP2: LDAX D 84 MOV M,A 85 INX H 86 INX D S/ DCR C 88 JNZ LOOP2 89 POP 8 90 POP H 91 POP D --°? MOV A.D 93 JMP AGAIN 94 DET: MVI C,7FH 95 LXI H, FLCBUF 96 LOOPS: MOV A,M 97 RLC 98 JC C:ONT 9 9 DETI: LXI D,OFFFAH I00 DAD D 101 OCR C: 102 JF' LOOP3 103 RET 104 CONT: INX H I08 LBA RTSAV 106 SUB M 107 CPI 5 I08 dE: DETI 109 OCX H 110 MVI M,O Iii INX H 112 XCHG 113 DIR: MOV A,C 114 AN/ OF8H 115 RRC 116 RRC 117 RRC 118 PUSH D I19 LXI D,PREBUF 120 MOV A,L 121 ADD O 122 MOV L,A 123 NOV ~,M 124 ADI 20H 125 MOV E,M 126 LXI H, CHMASK 121 HOV A,C 128 ANI 07 12"9 AUD L 130 MOV L,A 131 MOV A,D 132 XRA E 183 A~ tl 134 JZ OUII 135 MVI A,80N 136 OU]I: ORA C 137 LHLD EVEPTR 138 NOV M,A 139 INX H 140 POP D 141 PUSH B 142 MVI C:.5 143 B E T 2 : LBAX B 144 MOV M.A 145 INX H 146 INX D 147 OCR C: 148 JNZ DET2 149 POP B 150 SHLD EVEP~R 151 LXI H,EVECR 152 MOV A,M 153 INR A 154 ANI 3FH 155 MOV M.A 156 JNZ C:ONT2 15! PUSH H 158 LXI H,EVEBUF 159 8HLD EVEPTR 160 POP H 161 CONT2: INX H 162 C:MP M 163 XCHG 164 JNZ DETI 165 MVI A,I 166 STA BUFFUL "167 OMP DEC/ 168 $EJECT REAL TII'IE CLOCK 169 $ TITLE(" 83806. X22") THIS ROUTINE IS CALLED I 170 ; DESCRIPTI0N: F;MEDI A TELY AFTER 171 ; EVERY MILLISECOND INTERRUPT.THIS UPnATES THE REAL TIME 172 ~ CLOCK IN MEMORY AS ALE.O THE DISPLAY AS R EOUIREO. 17:3 ; INPUTS: I )TIME: RTSAV ONWARDly: L 0'4 I"/4 ; MILLISECONDS,HIGH MILLISECONOS,SECONDS.M I NU f E B 175 ~ HOURS,DAYS, MONTHS, 176 ~ 2)DISPLAY TRANSLATION TABLE 1"27 ; 8)DAYS IN EACH HONTHTABLE 178 179 ; CALLS: NONE 180 ; DESTROYS: FLAGS 181 ; OUTPUTS: AS ABOVE 182 RTSAV EQU 20AOH 183 DAYS EQU RTSAV+5

microprocessors and microsystems

LOC

OBJ

20R2 05FI 0F40 0051 0050 20~4 OF01 OF01 31 OF02 2 8 OFO3 31 0F04 3 0 OF05 31 OF06 30 OF07 31"~ OF08 31 OF09 3 0 OFO~ 31 OFOB 0F11 3 0 0 F 1 2 31 0 F 1 3 OC OPI4 9F 0 F 1 5 4A CWF16 OB 0F17 99 0F18 2 9 OFI9 2 8 O F I A 8F OFIB 06 OFIC ~9 OFI~ OFIE OPIF 6C OP20 I A OF21 6 8 0 F 2 2 E8 0 F 2 3 9S 0 F 2 4 7C 0 F 2 5 CS 0 F 2 6 9!; 0 F 2 7 FA OCO0 OCO0 C5 0C01 D 5

0 C 0 2 EO 0 C 0 3 F'5 0C04 ~'~W~020 0{:07 OCOe OCO~ OCOC OCOD

22A020 7C B5 C2SOOC

0C10 21E803 0C13 0C16 0C19 O(.~I A OCIC OCID OCIE 0C20 0C23 0C25 0C26

22~020 21~20 7E C601 27 77 ~0 C2670C 3600 23 "IE

LINE

SOURCE STATENENT

LOC

184 SECS 185 DELAY 18& ADTAB 187 KBCTRL 188 KBDATA 189 HOURS 190 191DAYTAB!

EQU EOU EOU EQU EQU EQU ORO DB

20A2H 05FIH OF40H 0051H KBCTRL-1 RTSAV+4 OFOIH 31H,28H,31H,30H,31H,30H,31H,31H

192

DB

30H,31H

193 194

DS DB

6 30H,31H

195DIGTAB:

DB

OCH, g F H . 4 A H , O B H , 9 9 H , 2 9 H , Z S H , SFH

196

DB

SH, 8 9 H , ~BH, SSH, 6CH, 1AH, 6 8 4 , OESH

197

DB

9SH,7CH,OCG~,SFH,OFAH

198 O~ 199 RTC: PUSH 200 PUSH 201 PUSH 202 PUSH 203 LHLD E WHETHER ZERO. 204 DCX 205; SHLD HOV 207 ORA 208 dNZ TUS AND RETURN 209 LXI A~IN 210 SHLD 211 LXI 212 HOV 213 ADI 214 DAA 215 MOV 216 CPI 217 JNZ 218 MVI 219 INX 220 MOV

vol 8 no 9 november 1984

OCOOH B ;S~VE ALL REGISTEF~. D H PSN R T S A V l O S TMILLISECONDS AND SE H RTS~ A,H L EXIT

I I F NO, TH~N RESTORE STA

H,OSESH; RfSAV H, SECS A,M; 1! H,A 6OH; UPDT; H,O HI A, M

OBJ

LINE

0C27 C601 0C29 27 OC2A 77 0C2S FE60 OC2U C2670C 0C30 3600 0C32 2 3 0C33 7E 0C34 C601 0C36 21 0C37 7~ OCSS FE24 OC3A C2670C 0C3D 3600 OCSF 2 3 0(;40 7E 0C41 C601 0C43 27 0C44 77 0C45 2 3 0C46 01010F 0C49 7E OC4A 8 t OC4B 79 0C4C OA

221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245

OC4D 2B OC4E BE 0¢4F C2670C 0C32 3601 0C54 23 0C55 7E OCS& C601 OCSB 27 0C59 77 OCSA FE13 0C5C C2670C OC5F 3601 0C61 23 0C62 7E 0(::63 0601 0C63 27 0C66 77 0C67 3ABC25 OC6A B7 0C6B C2SOOC

246 247 24S 249 250 251 252 253 254 255 256 25/ 259 2~9 260 261 262 263 264 265

OC6E 3ESO

266

0C70 D351 0C72 21A420

267 268

0C75 1603 0C77 46

269 2/0

OC7B CDOE14 OCTB 2B

271 272

0C7C 13 OCTD C2770C OCSO F I OCB1 E1 DUB2 DI 0(383 Cl 0C84 FB OCB5 C9

273 274 275 276 277 27S 279 280 281

IF YES LOAD 1000

GET IT AND INCREMENT IT DECIMALLY

I F ONE MINUTE NOT OVER, U P I ~ T EDISPLAY. REPEAT FOR MINUTES.

SOURCE STATEMENT ADI 1 DAA NOV H,A CPI 60H JNZ UPDT MVI M,O INX H; REPEAT FOR HOURS NOV A,M ADI 1 DAA MOV M,A CPI 24H dNl UPDT MVI M,O INX HI REPEAT FOR DAYS HOV A,M ADI 1 DAA NOV N,A INX H b • DAY~AB LXI MOV A,M ADO C NOV A,C B~ GET HO.OF DAYS FOR C:URRE LDAX NT H~qTH. DCX H; SEE IF MONTH IS OVER. CMP M JNZ UPDT MVI M.I INX HI REPEAl FOR MONTHS MUV A,H ADI 1 DAA NOV M, A CPI 13H JNZ UPDT MVI H, I INX H REPEAT FOR YEARS MOV A,M| ADI I DAA NOV M,A UPDT: LDA 25BCH ORA A IF DISPLAY NOT ENABLED,E JNZ EXITI XIT MVI A, 90H; SET 8279 FOR AUTO INCREM ENT @~RITE DISPLAY KBCTRL~ RAM MODE OUT LXI H,HOURS; POIHT HL TO HOUR S, D,3; NO OF BYTES TO BE OUTPUT MVI B,N; MOST SIS NIBBLE OF HOURS NEXI: MOV FIRST UPDAD I CALL DCX HI REPEAT FOR MINUTES AND S ECONDS DCR D NEXT EXIT: POP PSI.J POP H POP D POP B El RET $EJEC r

497