Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #18 from 9xbt/branch-o'-ekeleze
Browse files Browse the repository at this point in the history
very simple TUI test i wrote on vacation
  • Loading branch information
ekeleze authored Jul 31, 2023
2 parents a0233f0 + e06fbf3 commit 3749dec
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Makefile
iDOS.iml
.idea
.run
*.bat
*.bat
*.sh
File renamed without changes.
2 changes: 1 addition & 1 deletion src/GUI/GUImain.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%include "src/GUIcore.asm"
%include "src/GUI/GUIcore.asm"
%include "src/functions/clear.asm"

section .data
Expand Down
80 changes: 80 additions & 0 deletions src/TUI/TESTTUI.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
%include "src/core.asm"
%include "src/functions/clear.asm"

section .data
cmd_tui_test: db `tui\0`
text_one: db `one\0`
text_two: db `two\0`

section .text
tui_run:
call func_clear
mov ch, 0
jmp .run

.run:
mov ah, 0h
int 16h

cmp al, 113
je .down

cmp al, 119
je .up

cmp al, 27
je .ret

cmp ch, 1
je .display_one

cmp ch, 2
je .display_two

jmp .run

.ret:
call func_clear
ret

.display_one:
;mov ah, 02h
;mov bh, 0
;mov dh, 10
;mov dl, 10
;int 10h

write text_one
jmp .run

.display_two:
;mov ah, 02h
;mov bh, 0
;mov dh, 11
;mov dl, 10
;int 10h

write text_two
jmp .run

.up:
inc ch
cmp ch, 0
je .last

jmp .run

.down:
cmp ch, 2
je .first

mov ch, 2
jmp .run

.last:
mov ch, 2
jmp .run

.first:
mov ch, 1
jmp .run
11 changes: 11 additions & 0 deletions src/kernel.asm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jmp _start
%include "src/functions/user.asm"
%include "src/functions/echo.asm"
%include "src/GUI/GUImain.asm"
%include "src/TUI/TESTTUI.asm"

section .data
logo: db ` __ _______ ______ ______ \r\n| \\| \\ / \\ / \\ \r\n \\$$| $$$$$$$\\| $$$$$$\\| $$$$$$\\\r\n| \\| $$ | $$| $$ | $$| $$___\\$$\r\n| $$| $$ | $$| $$ | $$ \\$$ \\ \r\n| $$| $$ | $$| $$ | $$ _\\$$$$$$\\\r\n| $$| $$__/ $$| $$__/ $$| \\__| $$\r\n| $$| $$ $$ \\$$ $$ \\$$ $$\r\n \\$$ \\$$$$$$$ \\$$$$$$ \\$$$$$$ \r\n\n\0`
Expand Down Expand Up @@ -73,6 +74,12 @@ section .text
cmp byte [si], 0
je _loop

mov si, input_buffer
mov di, cmd_tui_test
mov cl, 0x00
call cmp_string
jc .tui_test

mov si, input_buffer
mov di, cmd_help
mov cl, 0x00
Expand Down Expand Up @@ -131,6 +138,10 @@ section .text
; Commands/functions section

.tui_test:
call tui_run
jmp _loop

.unknown:
cwrite err_unknown, $0C
jmp _loop
Expand Down

0 comments on commit 3749dec

Please sign in to comment.