PC Review


Reply
Thread Tools Rate Thread

Clear register

 
 
Ani
Guest
Posts: n/a
 
      29th Nov 2006
Why is it advised to used XOR operator to clear the register contents?
Why is load reg,0 not preferred.

 
Reply With Quote
 
 
 
 
krw
Guest
Posts: n/a
 
      29th Nov 2006
In article <(E-Mail Removed)>,
(E-Mail Removed) says...
> Why is it advised to used XOR operator to clear the register contents?
> Why is load reg,0 not preferred.


Homework? Look at the two instructions.

--
Keith
 
Reply With Quote
 
Yousuf Khan
Guest
Posts: n/a
 
      29th Nov 2006
Ani wrote:
> Why is it advised to used XOR operator to clear the register contents?
> Why is load reg,0 not preferred.


At one time in the olden days of x86 (circa 8086 and 80286 days, maybe
even into the 386 and 486 days), the XOR instruction executed in less
cycles than the MOV instruction. Both probably execute in 1 cycle these
days, however, the XOR instruction still takes up less space in memory
by a few bytes.

Yousuf Khan
 
Reply With Quote
 
pigdos
Guest
Posts: n/a
 
      1st Dec 2006
The 8051 has a better way than either method, at least for the Acc register.
The CLR A instruction executes faster than any other method of clearing the
Acc and uses the least amount of code memory possible.

--
Doug
"Ani" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Why is it advised to used XOR operator to clear the register contents?
> Why is load reg,0 not preferred.
>



 
Reply With Quote
 
krw
Guest
Posts: n/a
 
      1st Dec 2006
In article <06%bh.6653$(E-Mail Removed)>,
(E-Mail Removed) says...
> The 8051 has a better way than either method, at least for the Acc register.
> The CLR A instruction executes faster than any other method of clearing the
> Acc and uses the least amount of code memory possible.


True, but even that takes 12 processor cycles. At 12MHz that's
1usec. Yes folks, that's 1000 nsec. The 8051 is hardly a
"normal" processor.


--
Keith
 
Reply With Quote
 
pigdos
Guest
Posts: n/a
 
      2nd Dec 2006
There are many variants of the 8051 (instruction set compatible) that don't
require 12 oscillator clocks for a machine cycle. For example, the obsolete
80251. What is a "normal" CPU anyway?

--
Doug
"krw" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> In article <06%bh.6653$(E-Mail Removed)>,
> (E-Mail Removed) says...
>> The 8051 has a better way than either method, at least for the Acc
>> register.
>> The CLR A instruction executes faster than any other method of clearing
>> the
>> Acc and uses the least amount of code memory possible.

>
> True, but even that takes 12 processor cycles. At 12MHz that's
> 1usec. Yes folks, that's 1000 nsec. The 8051 is hardly a
> "normal" processor.
>
>
> --
> Keith



 
Reply With Quote
 
krw
Guest
Posts: n/a
 
      2nd Dec 2006
In article <KE3ch.1273$(E-Mail Removed)>,
(E-Mail Removed) says...
> There are many variants of the 8051


That's not what you said.

> (instruction set compatible) that don't
> require 12 oscillator clocks for a machine cycle.


Every one is pigdos slow. THe 8051 was never designed for speed.

> For example, the obsolete
> 80251. What is a "normal" CPU anyway?


Von Neuman architecture is one of the measures of "normal". By
*ANY* measure the 8051 ain't normal. It ain't even normal for a
Harvard architecture processor. The instruction set is a mess.
It's *SLOW*. There are some interesting peripherals built into the
variants, but it is no way "normal" I've used it many times, and
it's an interesting product, but the ISA is a mess.

--
Keith
 
Reply With Quote
 
Yousuf Khan
Guest
Posts: n/a
 
      2nd Dec 2006
krw wrote:
>> For example, the obsolete
>> 80251. What is a "normal" CPU anyway?

>
> Von Neuman architecture is one of the measures of "normal". By
> *ANY* measure the 8051 ain't normal. It ain't even normal for a
> Harvard architecture processor. The instruction set is a mess.
> It's *SLOW*. There are some interesting peripherals built into the
> variants, but it is no way "normal" I've used it many times, and
> it's an interesting product, but the ISA is a mess.



Wasn't the 8051 the PIC (programmable interrupt controller) inside the PC?

Yousuf Khan
 
Reply With Quote
 
daytripper
Guest
Posts: n/a
 
      3rd Dec 2006
On Sat, 02 Dec 2006 18:05:51 -0500, Yousuf Khan <(E-Mail Removed)> wrote:

>krw wrote:
>>> For example, the obsolete
>>> 80251. What is a "normal" CPU anyway?

>>
>> Von Neuman architecture is one of the measures of "normal". By
>> *ANY* measure the 8051 ain't normal. It ain't even normal for a
>> Harvard architecture processor. The instruction set is a mess.
>> It's *SLOW*. There are some interesting peripherals built into the
>> variants, but it is no way "normal" I've used it many times, and
>> it's an interesting product, but the ISA is a mess.

>
>
>Wasn't the 8051 the PIC (programmable interrupt controller) inside the PC?


No. That'd be the venerable 8251...

/daytripper
 
Reply With Quote
 
Joe Pfeiffer
Guest
Posts: n/a
 
      3rd Dec 2006
"Ani" <(E-Mail Removed)> writes:

> Why is it advised to used XOR operator to clear the register contents?
> Why is load reg,0 not preferred.


Think. You could have come up with the answer to your homework
yourself in less time than it took to post it.
--
Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
Department of Computer Science FAX -- (505) 646-1002
New Mexico State University http://www.cs.nmsu.edu/~pfeiffer
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
clear the clear the web page email attachment lines =?Utf-8?B?TUNyaWRlcg==?= Microsoft Excel Misc 0 11th Nov 2007 10:05 PM
excel check register template. How to put symbol in clear column =?Utf-8?B?YmlsbHlqcG9vaGJhaA==?= Microsoft Excel Misc 1 26th Jul 2007 11:24 PM
[HELP]Register doesn't allow install-programs to register dll-file =?Utf-8?B?Q29tcGFjdA==?= Windows XP Help 2 3rd Jul 2007 02:00 PM
I cant figgure out how to un register outlook and register to a new user Dan Leech Microsoft Outlook Installation 0 25th May 2004 08:25 PM
Cannot clear Address Bar -even using Tools /options/clear history Hennie Windows XP Internet Explorer 1 24th Sep 2003 06:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:37 PM.