Searching \ for '(OT FWD) Another Pentium BUG ? -Svar' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=another+pentium
Search entire site for: '(OT FWD) Another Pentium BUG ? -Svar'.

Truncated match.
PICList Thread
'(OT FWD) Another Pentium BUG ? -Svar'
1997\11\11@014112 by Erik Klausen

flavicon
face
As far as I can see, this is a C bug or a programmer bug.

> char x [5] = { 0xf0, 0x0f, 0xc7, 0xc8 };  // fill an area with instructions
>
> main ()
> {
>        void (*f)() = x; // declare a function, starting at the variable x
>        f();                  // execute it.
> }

Of course, a PIC programmer wouldn't think of this, since it is impossible to
execute data on a PIC.

Erik Klausen

1997\11\11@023447 by Andrew Warren

face
flavicon
face
Erik Klausen <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU> wrote:

> > char x [5] = { 0xf0, 0x0f, 0xc7, 0xc8 };  // fill an area with instructions
> >
> > main ()
> > {
> >        void (*f)() = x; // declare a function, starting at the variable x
> >        f();                  // execute it.
> > }
>
> Of course, a PIC programmer wouldn't think of this, since it is
> impossible to execute data on a PIC.

Erik:

You can't execute code from the PIC's Data MEMORY SPACE, but you can
certainly hand-code instructions as was done in the Pentium example
you quoted... For example, the following 16C54 program will toggle
pin RB0 continuously at a 50% duty cycle:

           PROCESSOR PIC16C54

           ORG 0

   X:      DATA    0x506, 0xA00+$+1, 0x406, 0xA00+X

   MAIN:   MOVLW   0xFE
           TRIS    6

           CALL    X

           ORG     0x1FF

           GOTO    MAIN

           END


-Andy

=== Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

1997\11\11@140209 by sajjad.akhtar

flavicon
face
    No its not a bug anyway. Your statment
       void (*f)() = x;
    does two things 1. declares a function pinter and then assing it the
    value of x.
    As x is not a funcition point rather an char pointer so it is type
    promoted. And this method has some uses in pc enviornment i think it
    can have some uses in the PIC enviorment too. as in the PIC your
    strings are stored in the code area.

    anyway its not a bug.


______________________________ Reply Separator _________________________________
Subject: (OT FWD) Another Pentium BUG ? -Svar
Author:  pic microcontroller discussion list <PICLISTspamKILLspamMITVMA.MIT.EDU> at smtpgwy
Date:    11/11/97 2:18 PM


As far as I can see, this is a C bug or a programmer bug.

> char x [5] = { 0xf0, 0x0f, 0xc7, 0xc8 };  // fill an area with instructions
>
> main ()
> {
>        void (*f)() = x; // declare a function, starting at the variable x
>        f();                  // execute it.
> }

Of course, a PIC programmer wouldn't think of this, since it is impossible to
execute data on a PIC.

Erik Klausen

1997\11\12@093601 by Roger Books

flavicon
face
sajjad.akhtar wrote:

>      No its not a bug anyway. Your statment
>         void (*f)() = x;
>      does two things 1. declares a function pinter and then assing it the
>      value of x.
>      As x is not a funcition point rather an char pointer so it is type
>      promoted.

Irrelevant, how we get the instructions to the CPU doesn't matter.

>  And this method has some uses in pc enviornment i think it
>      can have some uses in the PIC enviorment too. as in the PIC your
>      strings are stored in the code area.
>
>      anyway its not a bug.

Nobody is saying it is a C bug.  It is a pentium bug.  If I can run a
set of instructions that lock up a multiuser system then there is a bug.
If it is something that cannot be caught by any OS, and affects only
Pentium chips, it is a bug in the CPU.

Userland is not supposed to be able to lock up the machine.  If I wrote
it in assembly the same thing would happen.  It is a major bug.

Roger

More... (looser matching)
- Last day of these posts
- In 1997 , 1998 only
- Today
- New search...