Even so:
c:\@Work\Perl\monks>perl -wMstrict -le
"LINE:
for my $line (
'tag:0x3bb5044d addr:0x1009db0 qospri:40 len:0x40',
'tag:0x3bb5043d addr:0x1009d40 qospri:30 len:0x30',
'tag:0x3bb5044d addr:0xb0 qospri:40 len:0x40',
'tag:0x3bb5043d addr:0x40 qospri:30 len:0x30',
'tag:0x3bb5044d qospri:40 len:0x40',
'tag:0x3bb5043d qospri:30 len:0x30',
) {
my $got_addr =
my ($hex_str) =
$line =~ m{ addr:0x ([[:xdigit:]]+) }xms;
;;
next LINE if not $got_addr;
;;
my $bit_6_set = 0x40 & hex $hex_str;
;;
printf qq{bit 6 %7s in %9s of '$line' \n},
$bit_6_set ? 'set' : 'not set',
qq{'$hex_str'}
;
}
"
bit 6 not set in '1009db0' of 'tag:0x3bb5044d addr:0x1009db0 qospri:40
+ len:0x40'
bit 6 set in '1009d40' of 'tag:0x3bb5043d addr:0x1009d40 qospri:30
+ len:0x30'
bit 6 not set in 'b0' of 'tag:0x3bb5044d addr:0xb0 qospri:40 len:
+0x40'
bit 6 set in '40' of 'tag:0x3bb5043d addr:0x40 qospri:30 len:
+0x30'
Give a man a fish: <%-{-{-{-<
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|