Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
zilf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Jira
Jira
Labels
Merge Requests
1
Merge Requests
1
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
This instance will be upgraded to Heptapod 0.19.0 (final) on 2021-01-20 at 14:00 UTC+1
Open sidebar
zilf
zilf
Commits
ff601487405f
Commit
9ff7bc37
authored
Nov 14, 2020
by
Jesse McGrew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Zapf: Clean up PrintLabelAddresses a little.
parent
2ee93d6cb77c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
src/Zapf/Program.cs
src/Zapf/Program.cs
+11
-10
No files found.
src/Zapf/Program.cs
View file @
ff601487405f
...
...
@@ -157,22 +157,23 @@ namespace Zapf
Console
.
Error
.
WriteLine
();
var
query
=
from
s
in
ctx
.
GlobalSymbols
.
Values
where
s
.
Type
==
SymbolType
.
Function
||
s
.
Type
==
SymbolType
.
Label
||
s
.
Type
==
SymbolType
.
String
let
addr
=
(
s
.
Type
==
SymbolType
.
Label
)
?
s
.
Value
:
(
s
.
Type
==
SymbolType
.
Function
)
?
s
.
Value
*
ctx
.
PackingDivisor
+
ctx
.
FunctionsOffset
:
/* (s.Type == SymbolType.String) ? */
s
.
Value
*
ctx
.
PackingDivisor
+
ctx
.
StringsOffset
orderby
addr
select
new
{
s
.
Name
,
Address
=
addr
};
let
addr
=
s
.
Type
switch
{
SymbolType
.
Label
=>
s
.
Value
,
SymbolType
.
Function
=>
s
.
Value
*
ctx
.
PackingDivisor
+
ctx
.
FunctionsOffset
,
SymbolType
.
String
=>
s
.
Value
*
ctx
.
PackingDivisor
+
ctx
.
StringsOffset
,
_
=>
(
int
?)
null
}
where
addr
!=
null
orderby
addr
.
Value
select
new
{
s
.
Name
,
Address
=
addr
.
Value
};
Console
.
WriteLine
(
"{0,-32} {1,-6} {2,-6}"
,
"Name"
,
"Addr"
,
"Length"
);
// TODO: don't allocate an array for the label addresses
var
entries
=
query
.
ToArray
();
for
(
int
i
=
0
;
i
<
entries
.
Length
;
i
++)
...
...
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