summaryrefslogtreecommitdiff
path: root/terminal.asm
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2017-12-03 11:46:20 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2017-12-03 11:46:20 -0500
commit457605b4041736795d8da9179778dac81d44affb (patch)
tree208a83dfc724abedbef0f1539f056cf051e19994 /terminal.asm
parent273c0801dee82f0e5e2d89edd743b9d62e026437 (diff)
downloadminos-457605b4041736795d8da9179778dac81d44affb.tar.gz
Use stosb
Diffstat (limited to 'terminal.asm')
-rw-r--r--terminal.asm14
1 files changed, 4 insertions, 10 deletions
diff --git a/terminal.asm b/terminal.asm
index 13ed786..647152d 100644
--- a/terminal.asm
+++ b/terminal.asm
@@ -9,15 +9,8 @@ terminal:
.clear_buffer:
mov cx, T_BUFSZ ; counter is length of buffer
- mov bx, t_buffer ; get address of buffer
- mov di, bx ; destination is buffer
- .cl:
- mov [di], byte 0 ; zero out
- inc di ; increment buffer address
- dec cx ; decrement counter
- jne .cl ; repeat until counter is 0
-
- mov di, bx ; reset destination to original address
+ mov di, t_buffer ; destination is buffer
+ rep stosb ; zero buffer
.do_prompt:
mov cx, 0 ; reset counter
@@ -55,7 +48,7 @@ terminal:
call putc ; print carriage return
; ---- TEMPORARY ---
- ; A jump to a command parser occur here eventually
+ ; a command parser will be here eventually
; TODO: write string tokenizer
push t_buffer ; push buffer string address
@@ -76,6 +69,7 @@ terminal:
pop bp
ret
+
; data
t_msg_prompt_fmt: db '%s', 0
t_msg_prompt: db '$ ', 0