32 lines
896 B
Plaintext
32 lines
896 B
Plaintext
# This Source Code Form is subject to the terms of the Mozilla Public
|
|||
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||
|
|
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||
|
|
#
|
||
|
|
# COM1 seri port sürücüsü (16550 UART).
|
||
|
|
|
||
|
|
PORT = 0x3F8
|
||
|
|
|
||
|
|
fonksiyon hazirla():
|
||
|
|
port_yaz8(PORT + 1, 0x00) # UART kesmeleri kapalı
|
||
|
|
port_yaz8(PORT + 3, 0x80) # bölen ayarı (DLAB)
|
||
|
|
port_yaz8(PORT + 0, 0x03) # 38400 baud
|
||
|
|
port_yaz8(PORT + 1, 0x00)
|
||
|
|
port_yaz8(PORT + 3, 0x03) # 8 bit, eşliksiz, 1 dur biti
|
||
|
|
port_yaz8(PORT + 2, 0xC7) # FIFO açık
|
||
|
|
port_yaz8(PORT + 4, 0x0B)
|
||
|
|
|
||
|
|
fonksiyon bayt_yaz(b):
|
||
|
|
iken bit_ve(port_oku8(PORT + 5), 0x20) == 0:
|
||
|
|
devam
|
||
|
|
port_yaz8(PORT, b)
|
||
|
|
|
||
|
|
fonksiyon yaz(m):
|
||
|
|
i = 0
|
||
|
|
iken bayt(m, i) != 0:
|
||
|
|
bayt_yaz(bayt(m, i))
|
||
|
|
i = i + 1
|
||
|
|
|
||
|
|
fonksiyon satir(m):
|
||
|
|
yaz(m)
|
||
|
|
bayt_yaz(0x0A)
|