The WHILE works; I always use it. The reason is that the instruction is part of the WHILE. Therefore, it executes the instruction, then tests the cc. Another example: DO WHILE=(CHI,R9,LT,10). Again, it branches to the ENDDO, then EXCUTES the CHI, followed by a JE.
-----Original Message----- From: IBM Mainframe Assembler List [mailto:[email protected]] On Behalf Of Ed Jaffe Sent: 12 October 2017 06:38 To: [email protected] Subject: Re: Rehabilitated TROT Routine (Was: Detection of Compile-Time Self-Modifying Code) On 10/11/2017 2:18 PM, Steve Smith wrote: > The equivalent I have is DO WHILE,TROT,R14,R2,B'0001' -- the last > operand could be O, or it could be an UNTIL loop with NO (and any > other typical condition). But we allow bare condition-code masks, > too, especially for cases where the mnemonics aren't really mnemonic. The SPMs we use also allow direct specification of the CC if you prefer numbers, etc. It will generate 15-x where 'x' is whatever you've specified. I don't understand the use of WHILE in your example. In most languages, WHILE tests the condition *before* the first loop iteration and UNTIL tests after. Here's what I get if I specify UNTIL=NO: .00004506 B982 0000 36995 ¦ XGR R0,R0 Ensure no stop char . 36996 ¦ DO UNTIL=NO Do for all chars .0000450A B992 00E2 37014 ¦ : TROT R14,R2 Convert to hex .0000450E A714 FFFE 0000450A 37015 ¦ ENDDO , EndDo And here's what I get if I specify WHILE=O: .00004506 B982 0000 36995 ¦ XGR R0,R0 Ensure no stop char .0000450A A7F4 0004 00004512 36996 ¦ DO WHILE=O Do for all chars .0000450E B992 00E2 37015 ¦ : TROT R14,R2 Convert to hex .00004512 A714 FFFE 0000450E 37016 ¦ ENDDO , EndDo -- Phoenix Software International Edward E. Jaffe 831 Parkview Drive North El Segundo, CA 90245 http://www.phoenixsoftware.com/ --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
