Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stud-support
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
Container 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
Roman Romanov
stud-support
Commits
31956cfc
Commit
31956cfc
authored
4 years ago
by
Pavel Pisa
Browse files
Options
Downloads
Patches
Plain Diff
seminaries/qtmips/call-syscall/lec10-05-call-6args.S: correct naming to match video.
Signed-off-by:
Pavel Pisa
<
pisa@cmp.felk.cvut.cz
>
parent
a04eb064
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
seminaries/qtmips/call-syscall/l10-05-call-6args.S
+0
-87
0 additions, 87 deletions
seminaries/qtmips/call-syscall/l10-05-call-6args.S
seminaries/qtmips/call-syscall/lec10-05-call-6args.S
+68
-26
68 additions, 26 deletions
seminaries/qtmips/call-syscall/lec10-05-call-6args.S
with
68 additions
and
113 deletions
seminaries/qtmips/call-syscall/l10-05-call-6args.S
deleted
100644 → 0
+
0
−
87
View file @
a04eb064
//
select
core
without
pipeline
but
with
delay
slot
#pragma qtmips show registers
#pragma qtmips show memory
.
equ
SPILED_REG_LED_LINE
,
0xffffc104
//
32
bit
word
mapped
as
output
.
equ
STACK_INIT
,
0x01230000
//
The
bottom
of
the
stack
,
the
stack
grows
down
.
set
noreorder
.
text
.
globl
start
.
globl
_start
//
int
main
(){
//
int
res
;
//
res
=
complex
(
1
,
2
,
3
,
4
,
5
,
6
)
;
//
return
res
;
//
}
//
mips
-
elf
-
gcc
-
c
-
O6
l10
-
call
-
6
args
.
c
//
mips
-
elf
-
objdump
--
source
-
M
no
-
aliases
l10
-
call
-
6
args
.
o
start
:
_start
:
la
$sp
,
STACK_INIT
jal
main
nop
sw
$v0
,
SPILED_REG_LED_LINE
(
$
0
)
final
:
break
beq
$
0
,
$
0
,
final
nop
main
:
addiu
$sp
,
$sp
,
-
32
//
allocate
space
for
save
and
arguments
sw
$ra
,
28
(
$sp
)
//
store
return
address
from
main
sw
$s8
,
24
(
$sp
)
//
store
farme
pointer
,
not
required
there
or
$s8
,
$sp
,
$zero
//
set
fp
to
point
to
top
of
the
stack
,
not
required
//
see
-
fomit
-
frame
-
pointer
/-
fno
-
omit
-
frame
-
pointer
addiu
$v0
,
$zero
,
6
//
6
-
th
argument
value
sw
$v0
,
20
(
$sp
)
//
6
-
th
argument
to
the
stack
addiu
$v0
,
$zero
,
5
//
5
-
th
argument
value
sw
$v0
,
16
(
$sp
)
addiu
$a3
,
$zero
,
4
//
4
-
th
argument
value
addiu
$a2
,
$zero
,
3
//
3
-
rd
argument
value
addiu
$a1
,
$zero
,
2
//
2
-
nd
argument
value
jal
complex
//
call
complex
function
addiu
$a0
,
$zero
,
1
//
store
1
-
st
argument
,
run
in
delay
slot
or
$sp
,
$s8
,
$zero
//
restore
stack
from
frame
pointer
lw
$s8
,
24
(
$sp
)
//
restore
frame
pointer
,
not
required
there
lw
$ra
,
28
(
$sp
)
//
restore
return
address
nop
//
on
MIPS1
lw
result
not
available
directly
jr
$ra
//
return
from
main
,
result
in
v0
addiu
$sp
,
$sp
,
32
//
free
stack
frame
,
run
in
delay
slot
complex
:
//
sequnece
to
allocate
function
frame
addiu
$sp
,
$sp
,
-
24
//
allocate
frame
for
the
function
sw
$s8
,
16
(
$sp
)
//
store
previous
fp
value
sw
$ra
,
20
(
$sp
)
//
store
return
address
to
allow
call
subroutine
,
//
it
is
not
required
in
leaf
node
function
or
$s8
,
$sp
,
$zero
//
set
fp
to
point
to
top
of
the
stack
//
function
body
,
stack
can
be
freely
allocated
//
to
pas
arguments
and
store
local
variables
addu
$a0
,
$a0
,
$a1
//
add
the
arg
0
and
1
lw
$v0
,
40
(
$s8
)
//
load
5
-
th
argument
24
+
16
addu
$a2
,
$a0
,
$a2
//
add
the
2
-
nd
one
to
the
sum
addu
$a3
,
$a2
,
$a3
//
add
the
3
-
rd
one
to
the
sum
lw
$t0
,
44
(
$s8
)
//
load
6
-
th
argument
24
+
20
addu
$v0
,
$a3
,
$v0
//
add
5
-
h
argument
addu
$v0
,
$v0
,
$t0
//
add
6
-
th
one
to
the
summ
//
sequence
to
leave
function
frame
or
$sp
,
$s8
,
$zero
//
restore
stack
from
frame
pointer
lw
$ra
,
20
(
$sp
)
//
restore
return
address
,
not
necessary
in
leaf
node
lw
$s8
,
16
(
$sp
)
//
restore
previous
frame
pointer
jr
$ra
//
return
from
subroutine
addiu
$sp
,
$sp
,
24
//
free
stack
frame
in
delay
slot
#pragma qtmips focus memory STACK_INIT-32-24
This diff is collapsed.
Click to expand it.
seminaries/qtmips/call-syscall/lec10-05-call-6args.S
+
68
−
26
View file @
31956cfc
...
...
@@ -2,7 +2,6 @@
#pragma qtmips show registers
#pragma qtmips show memory
#pragma qtmips show peripherals
.
equ
SPILED_REG_LED_LINE
,
0xffffc104
//
32
bit
word
mapped
as
output
.
equ
STACK_INIT
,
0x01230000
//
The
bottom
of
the
stack
,
the
stack
grows
down
...
...
@@ -10,36 +9,79 @@
.
set
noreorder
.
text
main
:
.
globl
start
.
globl
_start
//
int
main
(){
//
int
res
;
//
res
=
complex
(
1
,
2
,
3
,
4
,
5
,
6
)
;
//
return
res
;
//
}
//
mips
-
elf
-
gcc
-
c
-
O6
lec10
-
call
-
6
args
.
c
//
mips
-
elf
-
objdump
--
source
-
M
no
-
aliases
lec10
-
call
-
6
args
.
o
start
:
_start
:
la
$sp
,
STACK_INIT
addi
$a0
,
$
0
,
4
//
4
!
->
24
jal
fact
jal
main
nop
add
$s0
,
$v0
,
$
0
sw
$s0
,
SPILED_REG_LED_LINE
(
$
0
)
sw
$v0
,
SPILED_REG_LED_LINE
(
$
0
)
final
:
break
beq
$
0
,
$
0
,
final
nop
fact
:
addi
$sp
,
$sp
,
-
8
//
adjust
stack
for
2
items
sw
$ra
,
4
(
$sp
)
//
save
return
address
sw
$a0
,
0
(
$sp
)
//
save
argument
slti
$t0
,
$a0
,
1
//
test
for
n
<
1
beq
$t0
,
$zero
,
L1
addi
$v0
,
$zero
,
1
//
if
so
,
result
is
1
addi
$sp
,
$sp
,
8
//
pop
2
items
from
stack
jr
$ra
//
and
return
nop
L1
:
addi
$a0
,
$a0
,
-
1
//
else
decrement
n
jal
fact
//
recursive
call
nop
lw
$a0
,
0
(
$sp
)
//
restore
original
n
lw
$ra
,
4
(
$sp
)
//
and
return
address
addi
$sp
,
$sp
,
8
//
pop
2
items
from
stack
mul
$v0
,
$a0
,
$v0
//
multiply
to
get
result
jr
$ra
//
and
return
nop
main
:
addiu
$sp
,
$sp
,
-
32
//
allocate
space
for
save
and
arguments
sw
$ra
,
28
(
$sp
)
//
store
return
address
from
main
sw
$s8
,
24
(
$sp
)
//
store
farme
pointer
,
not
required
there
or
$s8
,
$sp
,
$zero
//
set
fp
to
point
to
top
of
the
stack
,
not
required
//
see
-
fomit
-
frame
-
pointer
/-
fno
-
omit
-
frame
-
pointer
addiu
$v0
,
$zero
,
6
//
6
-
th
argument
value
sw
$v0
,
20
(
$sp
)
//
6
-
th
argument
to
the
stack
addiu
$v0
,
$zero
,
5
//
5
-
th
argument
value
sw
$v0
,
16
(
$sp
)
//
5
-
th
argument
to
the
stack
addiu
$a3
,
$zero
,
4
//
4
-
th
argument
value
addiu
$a2
,
$zero
,
3
//
3
-
rd
argument
value
addiu
$a1
,
$zero
,
2
//
2
-
nd
argument
value
jal
complex
//
call
complex
function
addiu
$a0
,
$zero
,
1
//
store
1
-
st
argument
,
run
in
delay
slot
or
$sp
,
$s8
,
$zero
//
restore
stack
from
frame
pointer
lw
$s8
,
24
(
$sp
)
//
restore
frame
pointer
,
not
required
there
lw
$ra
,
28
(
$sp
)
//
restore
return
address
nop
//
on
MIPS1
lw
result
not
available
directly
jr
$ra
//
return
from
main
,
result
in
v0
addiu
$sp
,
$sp
,
32
//
free
stack
frame
,
run
in
delay
slot
complex
:
//
sequnece
to
allocate
function
frame
addiu
$sp
,
$sp
,
-
24
//
allocate
frame
for
the
function
sw
$s8
,
16
(
$sp
)
//
store
previous
fp
value
sw
$ra
,
20
(
$sp
)
//
store
return
address
to
allow
call
subroutine
,
//
it
is
not
required
in
leaf
node
function
or
$s8
,
$sp
,
$zero
//
set
fp
to
point
to
top
of
the
stack
//
function
body
,
stack
can
be
freely
allocated
//
to
pas
arguments
and
store
local
variables
addu
$a0
,
$a0
,
$a1
//
add
the
arg
1
-
st
and
2
-
nd
lw
$v0
,
40
(
$s8
)
//
load
5
-
th
argument
24
+
16
addu
$a2
,
$a0
,
$a2
//
add
the
3
-
rd
one
to
the
sum
addu
$a3
,
$a2
,
$a3
//
add
the
4
-
th
one
to
the
sum
lw
$t0
,
44
(
$s8
)
//
load
6
-
th
argument
24
+
20
addu
$v0
,
$a3
,
$v0
//
add
5
-
th
argument
addu
$v0
,
$v0
,
$t0
//
add
6
-
th
one
to
the
summ
//
sequence
to
leave
function
frame
or
$sp
,
$s8
,
$zero
//
restore
stack
from
frame
pointer
lw
$ra
,
20
(
$sp
)
//
restore
return
address
,
not
necessary
in
leaf
node
lw
$s8
,
16
(
$sp
)
//
restore
previous
frame
pointer
jr
$ra
//
return
from
subroutine
addiu
$sp
,
$sp
,
24
//
free
stack
frame
in
delay
slot
#pragma qtmips focus memory STACK_INIT-
4*8
#pragma qtmips focus memory STACK_INIT-
32-24
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