From: Ken Smith on 19 Feb 2007 12:33 In article <ercdh2$8qk_008(a)s942.apx1.sbo.ma.dialup.rcn.com>, <jmfbahciv(a)aol.com> wrote: >In article <erak31$its$2(a)blue.rahul.net>, > kensmith(a)green.rahul.net (Ken Smith) wrote: >>>> [..... [BP+N] addressing ....] [....] >>>> It is usually software that does it at compile time. If you are writing >>>> in assembly, you allocate the space and assign the symbols once and then >>>> use them in each place. Unless you do something veery stupid, there is no >>>> need to run time check such stuff. >>>> >>>You've never heard of a "buffer overflow"? You aren't a Windows >>>programmer, by chance, are you? >> >> :) >>You don't get buffer overflows from [BP+N] type instructions. These are >>used to address single values on the stack. It is the [BP+SI] type of >>instructions that Windows blows it on. > >It is rare when N does not have to be calculated. Somebody, at >some point in time, has to assign a value to N. By its very >nature, it is a value that changed over time; in the olden >days, this used to be called a variable. No it is all done at the compile time: int bogus(int A){ int B; .... } Both A and B are addressed on an 8086 with the [BP+N] construct. >[emoticon begins to reassess assumptions] Do people not >know what variables are these days? krw? It seems that you don't. -- -- kensmith(a)rahul.net forging knowledge
From: Ken Smith on 19 Feb 2007 12:37 In article <ercd8o$8qk_006(a)s942.apx1.sbo.ma.dialup.rcn.com>, <jmfbahciv(a)aol.com> wrote: >In article <era1en$tvp$2(a)blue.rahul.net>, > kensmith(a)green.rahul.net (Ken Smith) wrote: >>In article <er9ick$8qk_008(a)s1005.apx1.sbo.ma.dialup.rcn.com>, >> <jmfbahciv(a)aol.com> wrote: >>>In article <er91e0$ji1$1(a)jasen.is-a-geek.org>, >>> jasen <jasen(a)free.net.nz> wrote: >> >>[..... [BP+N] addressing ....] >> >>>>> Snort. Don't you just love that "appropriate values of N"? >>>>> It implies you have to check it each and every time. >>>> >>>>means you have to make room on the stack (where BP offsets >>>>are typically used) for the counter. >>> >>>Now think. You either have to use software to check out of >>>range or have hardware that will cough at you when you >>>do go out of range. >> >>It is usually software that does it at compile time. > >Oh, good grief!!!! NOOOO! Never. All a compiler can >do is range-check the static stuff. It can never range >check the values that change as a result of execution. The [BP+N] construct contains the "N" part that never ever changes and the BP part that is a known place in the stack. The entry code to a procedure has a MOV BP,SP instruction followed perhaps bay a change to SP to make room for the variable. From that point on there is a known relationship between BP and the location of all parameters and variables. >> If you are writing >>in assembly, you allocate the space and assign the symbols once and then >>use them in each place. Unless you do something veery stupid, there is no >>need to run time check such stuff. > >Son, you are not paranoid enough. No, I know when to be paranoid. The [BP+N] is a waste of a single noid. -- -- kensmith(a)rahul.net forging knowledge
From: Phil Carmody on 19 Feb 2007 12:38 jmfbahciv(a)aol.com writes: > In article <era1en$tvp$2(a)blue.rahul.net>, > kensmith(a)green.rahul.net (Ken Smith) wrote: > >In article <er9ick$8qk_008(a)s1005.apx1.sbo.ma.dialup.rcn.com>, > > <jmfbahciv(a)aol.com> wrote: > >>In article <er91e0$ji1$1(a)jasen.is-a-geek.org>, > >> jasen <jasen(a)free.net.nz> wrote: > > > >[..... [BP+N] addressing ....] > > > >>>> Snort. Don't you just love that "appropriate values of N"? > >>>> It implies you have to check it each and every time. > >>> > >>>means you have to make room on the stack (where BP offsets > >>>are typically used) for the counter. > >> > >>Now think. You either have to use software to check out of > >>range or have hardware that will cough at you when you > >>do go out of range. > > > >It is usually software that does it at compile time. > > Oh, good grief!!!! NOOOO! Never. All a compiler can > do is range-check the static stuff. It can never range > check the values that change as a result of execution. Wrong. In the case in question, it's a simple local variable stack frame reference, and the compiler is the one that _set up_ the stack frame, and is also the one creating the machine code for _accessing_ the stack frame. Therefore the compiler of sufficient quality, at compile time, performs all the checks necessary. > > If you are writing > >in assembly, you allocate the space and assign the symbols once and then > >use them in each place. Unless you do something veery stupid, there is no > >need to run time check such stuff. > > Son, you are not paranoid enough. Only things that can go wrong need to be prevented. Adding unnecessary checks is adding unnecessary code. Which is bloat, and which is also gives more opportunities for errors to creep in. Good paranoia is knowing _what_ to be paranoid about, and the answer is definitely _not_ everything. Phil -- "Home taping is killing big business profits. We left this side blank so you can help." -- Dead Kennedys, written upon the B-side of tapes of /In God We Trust, Inc./.
From: nonsense on 19 Feb 2007 12:43 jmfbahciv(a)aol.com wrote: > In article <6baf5$45d8df82$49ecf3c$12829(a)DIALUPUSA.NET>, > "nonsense(a)unsettled.com" <nonsense(a)unsettled.com> wrote: > >>Ken Smith wrote: >> >>>In article <5f310$45d8a544$4fe770f$11782(a)DIALUPUSA.NET>, >>>nonsense(a)unsettled.com <nonsense(a)unsettled.com> wrote: >>>BAH wrote: >>> >>> >>>>>>Where's that supposed bright line between coding and using? >>>> >>>>><GRIN> Believe it or not, compilation. I guess I'd better >>>>>define this one. Compilation is the computing service that >>>>>changes your ASCII character directions into data blocks >>>>>that a linker can use to produce an executable set of >>>>>machine insructions. >>>> >>>>You mean like when I type a name and password in at >>>>the appropriate prompts. :-) >>> >>> >>>No, that is obviously an interpreter. >>> >>> >>> >>>>I understand what you think you wrote, but that >>>>doesn't define a bright line. When I set up a >>>>crontab to repeat a computer process (perhaps back >>>>up a set of files and put them on tape or a cd) at >>>>a certain time every day am I coding or am I using? >>> >>> >>>I'd say both in this case. It is an interpreter you are coding for, you >>>are using, lets say, vi and likely bash to do it. >>> >>> >>> >>> >>>>Same thing with a doze PC and "scheduled tasks." >>> >>> >>>In that case you are neither programming not a user. You are a victim. >>> >>> >>> >>> >>>>There are libraries at all "higher levels." I view this >>>>as a discussion well suited to fuzzy logic analysis. >>> >>> >>>I disagree. Fuzzy logic is just a digital guy trying to do analog. >> >>Disagree all you want. Disagreement doesn't change the >>facts or the scope. > > > It does need discussion from my POV. That's the first time > anybody asked the question and the first time I've tried to > set it down in English ASCII. Thus, I'm still thinking > about it because I surprised myself with that answer. Ideas live in sets. This might be a good point to branch into the question, "How much of the universe is binary, and how much analog?" just to see where that one goes. It is an issue I've not seen addressed. It gets even more interesting when viewed through the prisms of the various physics models in use today. One might think particle charges are binary. (<- teaser) I can't wait to hear MP's reply. LOL
From: Phil Carmody on 19 Feb 2007 12:43
jmfbahciv(a)aol.com writes: > >>> [..... [BP+N] addressing ....] > It is rare when N does not have to be calculated. Somebody, at > some point in time, has to assign a value to N. Wrong. The compiler does. > By its very > nature, it is a value that changed over time; in the olden > days, this used to be called a variable. It still is. The programmer in a high level language does not control the location in memory of the local variables. The compiler does. The only time the value of N will change is if you change the code or the compilation options, and recompile. > [emoticon begins to reassess assumptions] Do people not > know what variables are these days? krw? Do BAHs not know what compilers do? Didn't think so - just like the rest of the computing world, you're painfully ignorant. Phil -- "Home taping is killing big business profits. We left this side blank so you can help." -- Dead Kennedys, written upon the B-side of tapes of /In God We Trust, Inc./. |