Maker Pro
Maker Pro

Windows 2000 is The Borg!

B

Bob Masta

Jan 1, 1970
0
In programming, you use a NOP to allow time for a device to settle
before sampling it. You have to ask yourself how much time is consumed
by programming a 0 cycle NOP, and how many times will I have to loop
it before, say, 31 nanoseconds is consumed?

You can't use instruction timings for delays on any modern CPU;
they just aren't that predictable. This used to be recommended on
'286 machines where JMP $+2 was used after I/O instructions to allow
the slow ISA bus to settle. When '386s came along, you used to see
strings of JMPs (in BIOS hard drive code, for example) until people
finally wised up and used hardware timing. I've used it on '486s
in special cases where I calibrated the delay at the start of the
program, but it's a real hassle. Hopeless on a Pentium or later.

Having said all that, instruction delays are still useful in lots of
embedded processor applications, where they use old-style
CPU cores that have deterministic instruction timings. And
there are a _lot_ of embedded systems out there!


Bob Masta
dqatechATdaqartaDOTcom

D A Q A R T A
Data AcQuisition And Real-Time Analysis
Shareware from Interstellar Research
www.daqarta.com
 
K

Keith R. Williams

Jan 1, 1970
0
Not much of a programmer but I am left wondering why you would want a 0
cycle NOP, what other uses does it have other than a bit of time?

Aligning code on cache line boundaries, perhaps. Filling to the end of
code pages. There was a time when NOPs were put in as place-holders for
self-modified code (another bad idea ;-).

OTOH, why waste the energy dispatching, executing, and completing a
NOP. It's wasting system resources (and heat) that could be used for
real instructions. Architecturally it doesn't do anything (obviously).
Any inference one makes on the function of a NOP (or any other
parameter not specified in the architecture) is simply asking for
trouble. Add in the OoO nature of modern processors; counting on the
execution time of any instruction/loop gets even more dubious.
 
K

Keith R. Williams

Jan 1, 1970
0
Oh, I suppose it does! Although Microsoft hopefully doesn't do this in
Windows anywhere. :)

I was thinking more along the lines of self-modifying code, which you
(hopefully) don't see much of today since it's a lot trickier to make work
correctly and I'm not aware of any benefit of using such code on a modern
processor anyway. (And I mean 'self-modifying while it's running,' not just
patching up absolute addresses prior to starting execution.)

Indeed. Since the L1 I-caches don't generally have a write port the
modified code would have to go at least to the L2, address invalidated
in the L2, and then refetched. Ugly!

There was a time when self-modified code was common. It's not so
anymore.
 
J

John Jardine

Jan 1, 1970
0
Harry Conover said:
"Mjolinor" <[email protected]> wrote in message

In programming, you use a NOP to allow time for a device to settle
before sampling it. You have to ask yourself how much time is consumed
by programming a 0 cycle NOP, and how many times will I have to loop
it before, say, 31 nanoseconds is consumed?

Harry C.

On the face of it, the 31nS loop time would seem to need ... 31nS divided by
the Planc time of 5.38e-44 seconds or roughly 5.76e35 no-cycle loops.
regards
john
 
K

Keith R. Williams

Jan 1, 1970
0
On the face of it, the 31nS loop time would seem to need ... 31nS divided by
the Planc time of 5.38e-44 seconds or roughly 5.76e35 no-cycle loops.

Please send me the design of your counter. We can make some
serious money! ;-)
 
K

Keith R. Williams

Jan 1, 1970
0
Actually, if you coded a 'NOP', it did take a cycle.

Nope. It was dropped from the pipe (never saw an execution
unit). It took zero clocks, as long as there wasn't an unusual
branch around.
The problem was the instruction 'pre-fetch' on the K6, bypassed the
'implicit' NOP, in a decrement and loop instruction.

Nope. It wasn't dispatched. This isn't unusual these days.
Anyone using NOPS, or any other instructions for that matter, for
timing loops should be taken out and *shot*. There is a reason
we have timers these days.
 
J

Joel Kolstad

Jan 1, 1970
0
Keith R. Williams said:
Anyone using NOPS, or any other instructions for that matter, for
timing loops should be taken out and *shot*. There is a reason
we have timers these days.

I was reading an article just yesterday that suggested the way to perform a
delay in C was to code up an empty for loop. I suppose someone using that
approach also wouldn't know to turn on the compiler's optimizer... which
would undoubtedly just remove the loop entirely! (Although it might issue a
warning message if the user were lucky...)
 
J

Johannes Bauer

Jan 1, 1970
0
On 15 Sep 2003 09:22:17 -0700, [email protected] (Rich Grise)
wrote:

[All BS snipped]
I'm a hacker, and a consultant,
and have been poking around with computers and stuff since the days
when you could actually SEE the components you were working with.

All your cursing reveals you're a total moron, not a "hacker". If
you're too stupid to get your computer to work with Windows, try
Linux. Although I can hardly believe Linux is something you ever heard
of.

What the hell is wrong with you people?

Joe
 
A

Andre

Jan 1, 1970
0
Paul Hovnanian P.E. said:
Rich said:
[snip]

The storedrone says, "Just let me show you something." I grumbled
and seethed, but there wasn't much I could do - this weenie starts
the computer, and goes into CMOS setup, and I say, "Yeah, I know
how to do that. Oddly, it doesn't have a "factory defaults" setting,
just "Optimum performance" and "Best Performance" or some such.
So this guy is showing me the BIOS, and goes down into the deepest
menus and actually changes the processor clock! He says, Oh, yeah -
factory default is 100/100, but you have to set it to 133/133 or it
won't boot. I blew up. I said, "If you'd told me that two fucking
weeks ago, I'd have had a fucking computer already!!!!!'
He says, "Oh, we're not supposed to tell you that...." muttering
sometning about 'knowledge base'...

[snip]

Get used to it. The day is rapidly approaching when you will not be
permitted to open the case of your computer (or any other electronic
device) without the proper authorization from the licensor of its
hardware/software.

Nah . It'll never happen.

No-one can stop the individual taking their equipment apart , not even
the Government . No matter how many warnings they put on it and/or
security screws .
 
A

Andre

Jan 1, 1970
0
Paul Hovnanian P.E. said:
Andre said:
Paul Hovnanian P.E. said:
Rich Grise wrote:
[snip]

The storedrone says, "Just let me show you something." I grumbled
and seethed, but there wasn't much I could do - this weenie starts
the computer, and goes into CMOS setup, and I say, "Yeah, I know
how to do that. Oddly, it doesn't have a "factory defaults" setting,
just "Optimum performance" and "Best Performance" or some such.
So this guy is showing me the BIOS, and goes down into the deepest
menus and actually changes the processor clock! He says, Oh, yeah -
factory default is 100/100, but you have to set it to 133/133 or it
won't boot. I blew up. I said, "If you'd told me that two fucking
weeks ago, I'd have had a fucking computer already!!!!!'
He says, "Oh, we're not supposed to tell you that...." muttering
sometning about 'knowledge base'...

[snip]

Get used to it. The day is rapidly approaching when you will not be
permitted to open the case of your computer (or any other electronic
device) without the proper authorization from the licensor of its
hardware/software.

Nah . It'll never happen.

No-one can stop the individual taking their equipment apart , not even
the Government . No matter how many warnings they put on it and/or
security screws .

No security screws or labels needed. Just a federal law. Its the next
step beyond the DMCA. In order to protect copyrighted material, the next
step beyond software encryption will be security at the hardware level.
Reverse engineering software used for the protection of copyrighted
material is now a violation of federal law. Once a part of that function
is implemented in hardware, you will no longer be permitted (without
proper authorization, of course) to know how the innards of your PC
work. Any attempt to discover this, for whatever reason, will also be a
violation of the law.

Dammit, we fought two world wars to stop these kinds of idiots . :(

....

-A
 
D

Dimitrij Klingbeil

Jan 1, 1970
0
Paul said:
Andre said:
Paul Hovnanian P.E. said:
Rich Grise wrote:

[snip]

The storedrone says, "Just let me show you something." I grumbled
and seethed, but there wasn't much I could do - this weenie starts
the computer, and goes into CMOS setup, and I say, "Yeah, I know
how to do that. Oddly, it doesn't have a "factory defaults" setting,
just "Optimum performance" and "Best Performance" or some such.
So this guy is showing me the BIOS, and goes down into the deepest
menus and actually changes the processor clock! He says, Oh, yeah -
factory default is 100/100, but you have to set it to 133/133 or it
won't boot. I blew up. I said, "If you'd told me that two fucking
weeks ago, I'd have had a fucking computer already!!!!!'
He says, "Oh, we're not supposed to tell you that...." muttering
sometning about 'knowledge base'...

[snip]

Get used to it. The day is rapidly approaching when you will not be
permitted to open the case of your computer (or any other electronic
device) without the proper authorization from the licensor of its
hardware/software.

Nah . It'll never happen.

No-one can stop the individual taking their equipment apart , not even
the Government . No matter how many warnings they put on it and/or
security screws .

No security screws or labels needed. Just a federal law. Its the next
step beyond the DMCA. In order to protect copyrighted material, the next
step beyond software encryption will be security at the hardware level.
Reverse engineering software used for the protection of copyrighted
material is now a violation of federal law. Once a part of that function
is implemented in hardware, you will no longer be permitted (without
proper authorization, of course) to know how the innards of your PC
work. Any attempt to discover this, for whatever reason, will also be a
violation of the law.

To hell the law! How many licensed copies of W2K+XP are in use? How many
unlicensed are? Do you really think that a federal law will be effective
unless you're going to attach a goddamn CIA agent to every man everywhere
in the world. As with the hardware, you'll always be able to assemble a
working PC by buying each card/component separately even if (and this tends
to be true nowadays) the components have been made not within the country
you live in just because it is more profitable for those companies to
assemble different parts at different locations and sell them without
worrying about who buys them and what for he uses them. Modern hardware is
far too complicated to be easily tampered with, so there is no point in
attempting to reverse-engineer e.g. an NVidia gfx card. Did you know that a
law exists (Sorry, I forgot in which jurisdiction) that requires a hacker
to set some sort of 'i am a hacker' flag during login to the ISP. Now tell
me, what use will be of this law. It's obvious, a law is far not everything
and there is a vast difference between things allowed and those done. As
for your 'note to spammers', do you think someone using an open-relay
server in Ho-Chi-Mingh City (or wherever) will care about a Washington
State Resident?

Having all this said, I apologize for the language used, I just had to
comment on the omnipotence of law and what it appears to me.
 
Top