Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
os_worksheet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
k26-chow
os_worksheet
Commits
623ab2ed
Commit
623ab2ed
authored
4 months ago
by
k26-chow
Browse files
Options
Downloads
Patches
Plain Diff
edited2
parent
7f793171
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Worksheet2/source/loader.asm
+32
-0
32 additions, 0 deletions
Worksheet2/source/loader.asm
Worksheet2/source/loader.o
+0
-0
0 additions, 0 deletions
Worksheet2/source/loader.o
Worksheet2/source/task2.c
+19
-0
19 additions, 0 deletions
Worksheet2/source/task2.c
with
51 additions
and
0 deletions
Worksheet2/source/loader.asm
0 → 100644
+
32
−
0
View file @
623ab2ed
global
loader
;
MAGIC_NUMBER
equ
0x1BADB002
;
FLAGS
equ
0x0
;
CHECKSUM
equ
-
MAGIC_NUMBER
;
extern
main
;
; (magic number + checksum + flags should equal 0)
section
.text
;
align
4
;
; Multiboot header
dd
MAGIC_NUMBER
;
dd
FLAGS
;
dd
CH
ECKSUM
;
loader:
;
mov
eax
,
0xCAFEBABE
;
.loop:
jmp
.loop
;
; Second part of the code
global
_start
;
extern
sum_of_three
;
_start:
;
push
dword
3
;
push
dword
2
;
push
dword
1
;
call
sum_of_three
;
hlt
;
This diff is collapsed.
Click to expand it.
Worksheet2/source/loader.o
0 → 100644
+
0
−
0
View file @
623ab2ed
File added
This diff is collapsed.
Click to expand it.
Worksheet2/source/task2.c
0 → 100644
+
19
−
0
View file @
623ab2ed
/* The C function */
int
sum_of_three
(
int
arg1
,
int
arg2
,
int
arg3
)
{
return
arg1
+
arg2
+
arg3
;
}
int
multiply_two
(
int
arg1
,
int
arg2
)
{
return
arg1
*
arg2
;
}
void
main
()
{
int
result1
=
sum_of_three
(
1
,
2
,
3
);
int
result2
=
multiply_two
(
10
,
20
);
while
(
1
)
{}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment