Specifications
CONSTRUCTION
accepting any further vote. Thus, the maxi-
mum number of votes that can be regis-
tered against any one candidate should
not exceed 9999. This is the limitation in
the present design.
Keyboard. This module is used for
checking key closure and generating the
binary value corresponding to the closed
switch.
Password security
This voting machine has a password op-
tion. The length of the password is limited
to a maximum of seven digits. The pass-
word should be decided before burning the
program in the EPROM. Password check-
ing is performed during execution of boot-
ing program. For entering the password,
the same keyboard switches are used that
otherwise represent specific candidates.
For the setting of password (PW), the
length of PW is chosen first and then it is
loaded into register C using instruction
‘MVI A, length’ in the booting program.
The digits of the password are stored in
memory locations 00F9H to 00FFH. Each
of the PW digits chosen has to be multi-
plied by 4 and converted into hex format,
and then stored in consecutive memory
locations starting from 00F9H. For ex-
ample, if the PW is 1, 4, 8, the length is
loaded as 03 in register C and the data is
as follows:
EPROM Hex Conversion PW
location data digit
00F9 ß 04 ß 04H ß 04 ß 4x1 1
00FA ß 10 ß 10H ß 16 ß 4x4 4
00FB ß 20 ß 20H ß 32 ß 4x8 8
An actual-size, single-sided PCB for
the circuit shown in Fig. 1 is given in
Fig. 3, while its component layout is given
in Fig. 4.
Address Opcode Mnemonics Comments
Booting Program
0000 31 FF 80 LXI SP, 80FF Initialise SP
0003 3E 89 MVI A, 89 Initialise 8255
0005 D3 C3 OUT, C3 Port A, B = input, Port C = output
0007 11 F9 00 LXI D, 00F9 Load Stored Password (PW)
000A 0E 03 MVI C, 03 Password length = 3 digits
000C C5 PUSH B
000D D5 PUSH D
000E AF XRA A Makes contents of Acc. zero
000F 67 MOV H, A Make H reg contents zero
0010 CD 70 00 CALL
KEYBOARD
0013 D1 POP D
0014 C1 POP B
0015 1A LDAX D Load Acc. from mem loc pointed by
DE
0016 BD CMPL
0017 C2 23 00 JNZ 0023 If PW is incorrect, stop execution
001A 13 INX D
001B 0D DCR C
001C C2 0C 00 JNZ, 000C
001F 3E C8 MVI A, C8 If PW is right, enable the inter-
rupts and glow the LED (D2) to
0021 30 SIM indicate that the system is
0022 FB EI energised
0023 76 HLT
RST 5.5 (contains vector for memory clearing subroutine)
002C 00 NOP
002D C3 00 01 JMP Jump to Interrupt Secvice
MEMCLEAR Subroutine MEMCLEAR
RST 6.5 (contains vector for count subroutine)
0034 00 NOP
0035 C3 B6 00 JMP COUNT Jump to Interrupt Service
Subroutine COUNT
RST 7.5 Display subroutine
003C 00 NOP
003D 00 NOP
003E 31 FF 80 LXI SP, 80FF Initialise SP
0041 3E 1E MVI A, 1E Load data byte for displaying
0043 26 00 MVI H, 00 display mode indicator ‘
’
0045 CD 70 00 CALL
KEYBOARD Check key closure
0048 FB EI
0049 E5 PUSH H
004A 06 10 MVI B, 10 Scan the display
004C 7E MOV A, M
004D B0 ORA B
Software Listings
Address Opcode Mnemonics Comments
004E DE C1 OUT C1
0050 11 7F 01 LXID 017F
0053 1B DCX D
0054 7A MOV A, D
0055 B3 ORA E
0056 C2 53 00 JNZ 0053
0059 23 INX H
005A 78 MOV A, B
005B 07 RLC
005C 47 MOV B, A
005D D2 4C 00 JNC 004C
0060 E1 POP H
0061 C3 49 00 JMP 0049
Keyboard subroutine
0070 D3 C1 OUT C1 Display the mode
0072 CD 20 01 CALL DELAY(O/P contents of Acc. thro Port B)
0075 FB EI
0076 IE 00 MVI E, 00 Scan the keyboard
0078 3E 80 MVI A, 80
007A 06 06 MVI B, 06
007C 07 RLC
007D 6F MOV L, A
007E B4 ORA H
007F D3 C0 OUT C0
0081 DB C2 IN C2
0083 0E 08 MVI C, 08
0085 0F RRC
0086 DA 9C 00 JC 009C
0089 1C INR E
008A 16 7F MVI D, 7F
008C 15 DCR D
008D C2 8C 00 JNZ 008C
0090 0D DCR C
0091 C2 85 00 JNZ 0085
0094 7D MOV A, L
0095 05 DCR B
0096 C2 7C 00 JNZ 007C
0099 C3 76 00 JMP 0076
009C F3 DI
009D 7B MOV A, E If closed key is sensed, multiply
009E 07 RLC the key number by 4
009F 07 RLC
00A0 6F MOV L, A
00A1 3E 80 MIV A, 80
00A3 67 MOV H, A
00A4 D3 C0 OUT CO Generate a beep
00A6 CD 20 01 CALL DELAY
00A9 AF XRA A
00AA D3 C0 OUT CO
00AC C9 RET
63