Code Comments
Programming Forum and web based access to our favorite programming groups.I'm sure we've all seen a "First Time NOP", typically: NOP SOMEWHER OI *-3,X'F0' On first execution, the NOP falls through to the OI, which changes the NOP t o a B. On subsequent executions, it branches to SOMEWHER. Note that the code doesn't test any condition or storage external to itself to "know" it's the first time, nor is it modified by anything outside of itself. This code can be used in any program, regardless of the specific application. (Let's ignore R ENT considerations for purposes of this discussion). There's also the FIRST TIME BRANCH: NOP *+12 OI *-3,X'F0' B SOMEWHER Where the branch to SOMEWHER occurs only the first time. I want to see someone design a LAST TIME NOP (or branch). The rules are that you can't "cheat" by testing any condition or storage external to the actual code itself, nor can the code be modified by anything outside of itself. It should be useable in any application (again, forget RENT stuff). The action (NOP or BRANCH) can only be taken the LAST TIME the code is executed.
Post Follow-up to this messageOn 23 Nov 2003 18:50:33 GMT rfcommsys@aol.com (RFCOMMSYS) wrote: :>I want to see someone design a LAST TIME NOP (or branch). The rules are th at :>you can't "cheat" by testing any condition or storage external to the actu al :>code itself, nor can the code be modified by anything outside of itself. I t :>should be useable in any application (again, forget RENT stuff). The actio n :>(NOP or BRANCH) can only be taken the LAST TIME the code is executed. Other than the trivial cases of clearing storage or loading a wait state PSW , i.e., the routine setting conditions that it can never be re-executed, it is impossible without knowledge of what causes the routine to be executed. -- Binyamin Dissen <bdissen@dissensoftware.com> http://www.dissensoftware.com Director, Dissen Software, Bar & Grill - Israel
Post Follow-up to this messageExactly. You cannot predict the future. The examples listed show knowledge o f the past, not the future. "Binyamin Dissen" <postingid@dissensoftware.com> wrote in message news:0v02svce1ortusdpds4iivvtq9qsl3kj8t@ 4ax.com... > On 23 Nov 2003 18:50:33 GMT rfcommsys@aol.com (RFCOMMSYS) wrote: > > :>I want to see someone design a LAST TIME NOP (or branch). The rules are that > :>you can't "cheat" by testing any condition or storage external to the ac tual > :>code itself, nor can the code be modified by anything outside of itself. It > :>should be useable in any application (again, forget RENT stuff). The act ion > :>(NOP or BRANCH) can only be taken the LAST TIME the code is executed. > > Other than the trivial cases of clearing storage or loading a wait state P SW, > i.e., the routine setting conditions that it can never be re-executed, it is > impossible without knowledge of what causes the routine to be executed. > > -- > Binyamin Dissen <bdissen@dissensoftware.com> > http://www.dissensoftware.com > > Director, Dissen Software, Bar & Grill - Israel
Post Follow-up to this messagexarax wrote: > Exactly. You cannot predict the future. The examples listed show knowledge of > the past, not the future. Consider phase conjugate optics, where given an optical signal a device will create the time reversed version of the signal. Also, consider compilers with a COME FROM statement, that does the opposite of the GO TO statement. -- glen
Post Follow-up to this message"RFCOMMSYS" <rfcommsys@aol.com> wrote in message news:20031123135033.02030.00000736@mb-m16.aol.com... > I'm sure we've all seen a "First Time NOP", typically: > > NOP SOMEWHER > OI *-3,X'F0' > > On first execution, the NOP falls through to the OI, which changes the NOP to a > B. On subsequent executions, it branches to SOMEWHER. Note that the code > doesn't test any condition or storage external to itself to "know" it's the > first time, nor is it modified by anything outside of itself. This code can be > used in any program, regardless of the specific application. (Let's ignore RENT > considerations for purposes of this discussion). > > There's also the FIRST TIME BRANCH: > > NOP *+12 > OI *-3,X'F0' > B SOMEWHER > > Where the branch to SOMEWHER occurs only the first time. > > > I want to see someone design a LAST TIME NOP (or branch). The rules are that > you can't "cheat" by testing any condition or storage external to the actual > code itself, nor can the code be modified by anything outside of itself. It > should be useable in any application (again, forget RENT stuff). The action > (NOP or BRANCH) can only be taken the LAST TIME the code is executed. > > > Just how do you know that it is the last time? Sven
Post Follow-up to this message"glen herrmannsfeldt" <gah@ugcs.caltech.edu> wrote in message news:Cgawb.217404$275.810476@attbi_s53... > xarax wrote: > knowledge of > > Consider phase conjugate optics, where given an optical signal a device > will create the time reversed version of the signal. > > Also, consider compilers with a COME FROM statement, that does the > opposite of the GO TO statement. > > -- glen > COME FROM is no problem, any decent trouble diagnostics program includes that for a traceback of the calling sequence leading up to the error. Reversing time to see what the future will bring seems, well Startrek technology some 500 years ahead of us? Sven
Post Follow-up to this messageSven Pran said --- > > >Just how do you know that it is the last time? > > Ah, how indeed ...
Post Follow-up to this messageOn Tue, 25 Nov 2003 05:41:12 GMT glen herrmannsfeldt <gah@ugcs.caltech.edu> wrote: :>RFCOMMSYS wrote: :>> Sven Pran said --- :>>>Just how do you know that it is the last time? :>> Ah, how indeed ... :>There is a question in another newsgroup about how to find the value of :>the fifth from the last element of a linked list with one pass through :>the list. Well....... You can save the last five values. Obviously there are more constraints. -- Binyamin Dissen <bdissen@dissensoftware.com> http://www.dissensoftware.com Director, Dissen Software, Bar & Grill - Israel
Post Follow-up to this messageIt's a standard M$ interview question. It simply means managing two pointers that represent a specified span of elements in the linked-list. Just walk th e first pointer for 5 elements, then continue walking both elements. When the first pointer gets to the end of the list, the other pointer is 5 elements f rom the end. A variation of this technique is used for walking damaged linked-lists to fi nd the broken element (the one that points incorrectly back into the previous elements somewhere). "glen herrmannsfeldt" <gah@ugcs.caltech.edu> wrote in message news:YXBwb.221104$mZ5.1690987@attbi_s54... > RFCOMMSYS wrote: > > > > > There is a question in another newsgroup about how to find the value of > the fifth from the last element of a linked list with one pass through > the list. > > -- glen >
Post Follow-up to this messagerfcommsys@aol.com (RFCOMMSYS) wrote > I want to see someone design a LAST TIME NOP (or branch). The rules are th at > you can't "cheat" by testing any condition or storage external to the actu al > code itself, nor can the code be modified by anything outside of itself. I t > should be useable in any application (again, forget RENT stuff). The actio n > (NOP or BRANCH) can only be taken the LAST TIME the code is executed. If this were possible, what path would the following code take: TOP_LOOP ... ... some looping process code ... * * Use of the grand-spankin new macro - LASTTIME_BRANCH_TO label * LAST_TIME_CHECK DS 0H LASTTIME_BRANCH_TO PARADOX_CODE B TOP_LOOP * PARADOX_CODE DS 0H B LAST_TIME_CHECK So, does the macro LASTTIME_BRANCH_TO ever branch? Is the label PARADOX_CODE ever reached? Is this an infinite loop? Tim
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.