[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 6502 illegal opcodes questions
In article <nospam-A1B4BA.13530528052006@network-065-024-007-028.columbus.rr.com>,
> In article <e5c1e4$24tu$1@merope.saaf.se>,
> pausch@saaf.se (Paul Schlyter) wrote:
>
>> In article
>> <nospam-7B7751.02054028052006@network-065-024-007-028.columbus.rr.com>,
>>
>>> 222222In article <e598gn$134q$1@merope.saaf.se>,
>>> pausch@saaf.se (Paul Schlyter) wrote:
>>>
>>>> In article
>>>> <nospam-467DFC.23375126052006@network-065-024-007-027.columbus.rr.com>,
>>>>
>>>>> In article <e56rj1$7lo$1@merope.saaf.se>,
>>>>> pausch@saaf.se (Paul Schlyter) wrote:
>>>>>
>>>>>> In article <1148544621.115246.248890@y43g2000cwc.googlegroups.com>,
>>>>>> mdj <mdj.mdj@gmail.com> wrote:
>>>>> [...]
>>>>>>> The key concepts that are missing here are pointers, and more
>>>>>>> specifically,
>>>>>>> the ability to perform arbitrary arithmetic on pointer types.
>>>>>>
>>>>>> FORTRAN, Pascal and Ada lacks this too.
>>>>> [...]
>>>>>
>>>>> This is certainly false for Ada:
>>>>>
>>>>> http://www.adapower.com/rm95.php
>>>>>
>>>>> In particular, the standard package Interfaces.C.Pointers overloads the
>>>>> "+" and "-" operators for just this purpose.
>>>>>
>>>>> http://www.adapower.com/rm95/RM-B-3-2.html
>>>>
>>>> OK, Ada has pointer arithmetic - but is it arbitrary?
>>>
>>> Well, it's arbitrary up to the limit of erroneous: you can't access
>>> memory that's forbidden by the OS:-)
>>
>> Ouch .... so much for the "security" of Ada......
>
> I don't see how this follows. One of the goals of Ada is to find more
> errors at compile-time, leaving fewer for run-time. It is certainly
> possible to write an erroneous program in Ada, but one must do so
> explicitly. It's much harder to do by accident.
It's easy to exceed the bounds of an array by accident and overwrite other
data structures in the program with garbage. Apparently it's no more difficult
in Ada than in FORTRAN or C ......
--
----------------------------------------------------------------
Paul Schlyter, Grev Turegatan 40, SE-114 38 Stockholm, SWEDEN
e-mail: pausch at stockholm dot bostream dot se
WWW: http://stjarnhimlen.se/