-
Notifications
You must be signed in to change notification settings - Fork 3
/
traffic_project.asm
52 lines (32 loc) · 957 Bytes
/
traffic_project.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
; controlling external device with 8086 microprocessor.
; realistic test for c:\emu8086\devices\Traffic_Lights.exe
#start=Traffic_Lights.exe#
name "traffic"
mov ax, all_red
out 4, ax
mov si, offset situation
next:
mov ax, [si]
out 4, ax
; wait 1 seconds (1 million microseconds)
mov cx, 0FH ; 004C4B40h = 5,000,000
mov dx, 4240H
mov ah, 86h
int 15h
mov cx, 0FH ; 004C4B40h = 5,000,000
mov dx, 4240H
mov ah, 86h
int 15h
add si, 2 ; next situation
cmp si, sit_end
jb next
mov si, offset situation
jmp next
; FEDC_BA98_7654_3210
situation dw 0000_0011_0000_1100b
s1 dw 0000_0110_1001_1010b
s2 dw 0000_1000_0110_0001b
s3 dw 0000_1000_0110_0001b
s4 dw 0000_0100_1101_0011b
sit_end = $
all_red equ 0000_0010_0100_1001b