-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTraffic Lights.ASM
56 lines (39 loc) · 1.4 KB
/
Traffic Lights.ASM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#start=Traffic_Lights.exe#
name "traffic"
;FEDC_BA98_7654_3210
again: mov ax, 0000_0011_0000_1100b
out 4, ax
;Load the accumulator by the number of minutes
MOV AL, 3
REPEAT1: MOV CX, 0393H
MOV DX, 8700H
MOV AH, 86H
INT 15H
DEC AL
JNZ REPEAT1
;FEDC_BA98_7654_3210
mov ax, 0000_0110_1001_1010b
out 4, ax
MOV CX, 0393H
MOV DX, 8700H
MOV AH, 86H
INT 15H
;FEDC_BA98_7654_3210
mov ax, 0000_1000_0110_0001b
out 4, ax
;Load the accumulator by the number of minutes
mov Al, 3
REPEAT2: MOV CX, 0393H
MOV DX, 8700H
MOV AH, 86H
INT 15H
DEC AL
JNZ REPEAT2
;FEDC_BA98_7654_3210
mov ax, 0000_0100_1101_0011b
out 4, ax
MOV CX, 0393H
MOV DX, 8700H
MOV AH, 86H
INT 15H
jmp again