Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lib ui1 #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ if [ -x "$(command -v curl)" ]; then
curl -s -o libBareMetal.asm https://raw.githubusercontent.com/ReturnInfinity/BareMetal/master/api/libBareMetal.asm
curl -s -o libBareMetal.c https://raw.githubusercontent.com/ReturnInfinity/BareMetal/master/api/libBareMetal.c
curl -s -o libBareMetal.h https://raw.githubusercontent.com/ReturnInfinity/BareMetal/master/api/libBareMetal.h
curl -s -o lib-ui.asm https://raw.githubusercontent.com/ReturnInfinity/BareMetal-Monitor/master/api/lib-ui.asm
curl -s -o lib-ui.h https://raw.githubusercontent.com/ReturnInfinity/BareMetal-Monitor/master/api/lib-ui.h
else
wget -q https://raw.githubusercontent.com/ReturnInfinity/BareMetal/master/api/libBareMetal.asm
wget -q https://raw.githubusercontent.com/ReturnInfinity/BareMetal/master/api/libBareMetal.c
wget -q https://raw.githubusercontent.com/ReturnInfinity/BareMetal/master/api/libBareMetal.h
wget -q https://raw.githubusercontent.com/ReturnInfinity/BareMetal-Monitor/master/api/lib-ui.asm
wget -q https://raw.githubusercontent.com/ReturnInfinity/BareMetal-Monitor/master/api/lib-ui.h
fi
cd ..

Expand Down
17 changes: 9 additions & 8 deletions src/uitest.asm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[BITS 64]

%INCLUDE "libBareMetal.asm"
%INCLUDE "lib-ui.asm"

b_user equ 0x0000000000100048

Expand All @@ -13,8 +14,8 @@ start: ; Start of program label
call [b_output] ; Print the string that RSI points to

mov eax, 0x00FF0000 ; Red
mov cl, 0x11
call [b_user]
mov cl, SET_FG
call [b_user] ; b_user is set entry point of ui_api
lea rsi, [rel test_message] ; Load RSI with the relative memory address of string
mov ecx, 4 ; Output 14 characters
call [b_output] ; Print the string that RSI points to
Expand All @@ -24,7 +25,7 @@ start: ; Start of program label
call [b_output] ; Print the string that RSI points to

mov eax, 0x0000FF00 ; Green
mov cl, 0x11
mov cl, SET_FG
call [b_user]
lea rsi, [rel test_message] ; Load RSI with the relative memory address of string
mov ecx, 4 ; Output 14 characters
Expand All @@ -35,23 +36,23 @@ start: ; Start of program label
call [b_output] ; Print the string that RSI points to

mov eax, 0x000000FF ; Blue
mov cl, 0x11
mov cl, SET_FG
call [b_user]
lea rsi, [rel test_message] ; Load RSI with the relative memory address of string
mov ecx, 4 ; Output 14 characters
call [b_output] ; Print the string that RSI points to

mov eax, 0x00FF00FF
mov cl, 0x11
mov cl, SET_FG
call [b_user]
mov eax, 0x0000FF00 ; Green
mov cl, 0x12
mov cl, SET_BG
call [b_user]
mov ax, 20
mov cl, 0x13
mov cl, SET_CURSOR_ROW
call [b_user]
mov ax, 10
mov cl, 0x14
mov cl, SET_CURSOR_COL
call [b_user]
lea rsi, [rel test_message] ; Load RSI with the relative memory address of string
mov ecx, 4 ; Output 14 characters
Expand Down