-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreciever.asm
69 lines (61 loc) · 1.27 KB
/
reciever.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
57
58
59
60
61
62
63
64
65
66
67
68
69
.model small
.stack 64
.data
VALUE db ?
axPlayer1 dw 0000h
bxPlayer1 dw 0000h
cxPlayer1 dw 0000h
dxPlayer1 dw 0000h
.code
Main proc far
mov ax,@data
mov ds,ax
call RecieveGuiElements
mov si,offset axPlayer1
mov cx,08h
Print:
mov ah,02
mov dl , [si]
int 21h
inc si
Loop Print
Main endp
RecieveGuiElements proc
;Set Divisor Latch Access Bit
mov dx,3fbh ; Line Control Register
mov al,10000000b ;Set Divisor Latch Access Bit
out dx,al ;Out it
;Set LSB byte of the Baud Rate Divisor Latch register.
mov dx,3f8h
mov al,0ch
out dx,al
;Set MSB byte of the Baud Rate Divisor Latch register.
mov dx,3f9h
mov al,00h
out dx,al
;Set port configuration
mov dx,3fbh
mov al,00011011b
;0:Access to Receiver buffer, Transmitter buffer
;0:Set Break disabled
;011:Even Parity
;0:One Stop Bit
;11:8bits
out dx,al
mov cx,08h
mov si,offset axPlayer1
;Check that Data is Ready
RecieveLoop:
mov dx , 3FDH ; Line Status Register
CHK: in al , dx
and al , 1
JZ CHK ;Not Ready
;If Ready read the VALUE in Receive data register
mov dx , 03F8H
in al , dx
mov [si] , al
inc si
Loop RecieveLoop
ret
RecieveGuiElements endp
end Main