Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
triazo
/
kernel
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
3
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ceba1955
authored
Sep 05, 2015
by
triazo
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Rearrange assembly to fit into boot sector
Really just a messed up merge
parent
e85e6bb9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
16 deletions
boot.asm
boot.asm
View file @
ceba1955
...
@@ -44,7 +44,6 @@ times 510 - ($ - $$) db 0
...
@@ -44,7 +44,6 @@ times 510 - ($ - $$) db 0
;---------------- BOOTLOADER CODE ----------------;
;---------------- BOOTLOADER CODE ----------------;
ls
:
mov
si
,
str1
; pointer to string in si
ls
:
mov
si
,
str1
; pointer to string in si
call
PrintStr
; print string
call
PrintStr
; print string
call
PrintHexStr
; print string
jmp
Main
;
jmp
Main
;
hlt
hlt
...
@@ -72,6 +71,14 @@ PrintChar: ; print char at AL
...
@@ -72,6 +71,14 @@ PrintChar: ; print char at AL
INT
0x10
; Print Character
INT
0x10
; Print Character
RET
RET
;------------------ DATA BLOCK ------------------;
str1
db
'
Hello
World
'
,
0
; Hello World
str2
db
'
WHY
IS
THIS
'
,
0
hexChars
db
'
0123456789
abcdef
'
; Used for hex formatting
PrintHexStr
:
PrintHexStr
:
nexthchar
:
nexthchar
:
mov
al
,
[si]
; grab next char
mov
al
,
[si]
; grab next char
...
@@ -98,23 +105,10 @@ PrintHexChar:
...
@@ -98,23 +105,10 @@ PrintHexChar:
ret
ret
;------------------ DATA BLOCK ------------------;
str1
db
'
Hello
World
'
,
0
; Hello World
str2
db
'
WHY
IS
THIS
'
,
0
hexChars
db
'
0123456789
abcdef
'
; Used for hex formatting
;-------------- PADDING / SIGNATURE -------------;
; $ is current line, $$ is first line, db 0 is a 00000000 byte
; So, pad the code with 0s until you reach 510 bytes
TIMES
510
-
(
$
-
$$
)
DB
0
; Fill last two bytes (a word) with the MBR signature 0xAA55
DW
0xAA55
>>>>>>>
Add
hex
printing
function
,
hex
print
hello
world
Main
:
;main section
Main
:
;main section
nop
nop
nop
nop
mov
si
,
str2
mov
si
,
str2
call
PrintStr
call
PrintStr
mov
si
,
str2
call
PrintHexStr
; print string
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment