Compare commits
2 Commits
d63c2cbd69
...
2aaae86c8a
Author | SHA1 | Date |
---|---|---|
redfast00 | 2aaae86c8a | |
redfast00 | b773014f61 |
50
messages.asm
50
messages.asm
|
@ -21,9 +21,6 @@ mov dh, HEIGHT
|
||||||
mov dl, WIDTH
|
mov dl, WIDTH
|
||||||
int 0x10
|
int 0x10
|
||||||
|
|
||||||
;; Turn on interrupts
|
|
||||||
sti
|
|
||||||
|
|
||||||
;; Set cursor to bottom of screen
|
;; Set cursor to bottom of screen
|
||||||
mov dh, HEIGHT
|
mov dh, HEIGHT
|
||||||
mov dl, 0x00
|
mov dl, 0x00
|
||||||
|
@ -31,33 +28,10 @@ mov bh, 0x00
|
||||||
mov ah, 0x02
|
mov ah, 0x02
|
||||||
int 0x10
|
int 0x10
|
||||||
|
|
||||||
;; Start serial connection
|
|
||||||
mov ah, 0
|
|
||||||
mov al, 0b11100011
|
|
||||||
mov dx, 0
|
|
||||||
int 0x14
|
|
||||||
|
|
||||||
.loop:
|
.loop:
|
||||||
;; Print a '.' to debug
|
;; Read character
|
||||||
mov ah, 0x01
|
mov ah, 0x00
|
||||||
mov al, '.'
|
int 0x16
|
||||||
mov dx, 0
|
|
||||||
int 0x14
|
|
||||||
|
|
||||||
|
|
||||||
;; Check status of COM1
|
|
||||||
mov ah, 0x03
|
|
||||||
mov dx, 0
|
|
||||||
int 0x14
|
|
||||||
|
|
||||||
;; If not ok, wait
|
|
||||||
and ah, 0x01
|
|
||||||
jz .loop
|
|
||||||
|
|
||||||
;; If ok, start reading character
|
|
||||||
mov ah, 0x02
|
|
||||||
mov dx, 0
|
|
||||||
int 0x14
|
|
||||||
|
|
||||||
cmp al, 0x0d ; newline
|
cmp al, 0x0d ; newline
|
||||||
je .newline
|
je .newline
|
||||||
|
@ -69,6 +43,18 @@ int 0x14
|
||||||
;; Read character
|
;; Read character
|
||||||
mov ah, 0x00
|
mov ah, 0x00
|
||||||
int 0x16
|
int 0x16
|
||||||
|
;; Read character is in al
|
||||||
|
sub al, 'a'
|
||||||
|
mov bl, al
|
||||||
|
shl bl, 0x4
|
||||||
|
|
||||||
|
;; Read character
|
||||||
|
mov ah, 0x00
|
||||||
|
int 0x16
|
||||||
|
;; Read character is in al
|
||||||
|
sub al, 'a'
|
||||||
|
or al, bl
|
||||||
|
|
||||||
mov [color_mode], al
|
mov [color_mode], al
|
||||||
jmp .loop
|
jmp .loop
|
||||||
|
|
||||||
|
@ -98,11 +84,11 @@ int 0x14
|
||||||
.nonewline:
|
.nonewline:
|
||||||
|
|
||||||
;; Write character
|
;; Write character
|
||||||
mov ah, 0x09
|
mov ah, 0x09
|
||||||
mov bh, 0x00
|
mov bh, 0x00
|
||||||
mov bl, [color_mode]
|
mov bl, [color_mode]
|
||||||
mov cx, 0x01
|
mov cx, 0x01
|
||||||
int 0x10
|
int 0x10
|
||||||
|
|
||||||
;; Get current cursor position
|
;; Get current cursor position
|
||||||
mov ah, 0x03
|
mov ah, 0x03
|
||||||
|
@ -142,7 +128,7 @@ int 0x14
|
||||||
|
|
||||||
halt: hlt
|
halt: hlt
|
||||||
|
|
||||||
color_mode: db 0x05
|
color_mode: db 0x02
|
||||||
|
|
||||||
times 510 - ($ - $$) db 0
|
times 510 - ($ - $$) db 0
|
||||||
dw 0xAA55
|
dw 0xAA55
|
||||||
|
|
Loading…
Reference in New Issue