Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Open Source Software
Zipr Toolchain
Commits
ae8cf583
Commit
ae8cf583
authored
13 years ago
by
an7s
Browse files
Options
Downloads
Patches
Plain Diff
widening/truncation examples
parent
21b7287f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitattributes
+1
-0
1 addition, 0 deletions
.gitattributes
examples/width.c
+72
-0
72 additions, 0 deletions
examples/width.c
with
73 additions
and
0 deletions
.gitattributes
+
1
−
0
View file @
ae8cf583
...
...
@@ -152,6 +152,7 @@ examples/mul/run_tests.sh -text
examples/overflow1.c -text
examples/test1.c -text
examples/test2.c -text
examples/width.c -text
libIRDB/Makefile -text
libIRDB/include/cfg/BasicBlock.hpp -text
libIRDB/include/cfg/CFG.hpp -text
...
...
This diff is collapsed.
Click to expand it.
examples/width.c
0 → 100644
+
72
−
0
View file @
ae8cf583
int
main
(
int
argc
,
char
**
argv
)
{
volatile
char
c
=
0
;
volatile
short
s
=
0
;
volatile
char
uc
=
0
;
volatile
int
i
=
0
;
volatile
unsigned
short
us
=
0
;
volatile
int
ui
=
0
;
// widening
i
=
c
;
/* movzx eax, [ebp+var_1]
movsx eax, al
mov [ebp+var_C], eax
*/
i
=
uc
;
/* movzx eax, [ebp+var_5]
movsx eax, al
mov [ebp+var_C], eax
*/
ui
=
c
;
/*
movzx eax, [ebp+var_1]
movsx eax, al
mov [ebp+var_14], eax
*/
ui
=
uc
;
/* movzx eax, [ebp+var_5]
movsx eax, al
mov [ebp+var_14], eax
*/
s
=
c
;
/* movzx eax, [ebp+var_1]
cbw ; convert byte to word (sign-extend)
mov [ebp+var_4], ax
*/
s
=
uc
;
/* movzx eax, [ebp+var_5]
cbw
mov [ebp+var_4], ax
*/
us
=
c
;
/* movzx eax, [ebp+var_1]
cbw
mov [ebp+var_E], ax
*/
us
=
uc
;
/* movzx eax, [ebp+var_5]
cbw
mov [ebp+var_E], ax
*/
//
// truncating
//
c
=
i
;
/* mov eax, [ebp+var_C]
mov [ebp+var_1], al
*/
uc
=
i
;
/* mov eax, [ebp+var_C]
mov [ebp+var_5], al
*/
s
=
i
;
/* mov eax, [ebp+var_C]
mov [ebp+var_4], ax
*/
s
=
ui
;
/* mov eax, [ebp+var_14]
mov [ebp+var_4], ax
*/
}
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