On 2026-11-05, Peter Flass <Pet…@Iron-Spring.com> wrote:
> On 11/4/26 12:51, Charlie Gibbs wrote: >
>> On 2026-11-04, Peter Flass <Pet…@Iron-Spring.com> wrote: >>
>>> I kind of agree. As a former assembler programmer - at one time it was >>> my first language - I'd like it to be true (although I'm out of the job >>> market), but I can't see it. These days most HLL code is more optimized >>> than a lot of assembler. A good assembler programmer would not make a >>> lot of these optimizations due to lack of readability.
>> >> A mediocre assembly language programmer would not let lack of >> readability stand in the way. And once you get into self-modifying >> code there are all sorts of horrible things you can do.
> > 1. "standard" things like converting a branch to a nop or back.
When reading about interfacing assembly language subroutines to RPG programs, I noted that indicators were stored in one byte as 0x00 for off, and 0xF0 for on. I suspected (but never confirmed) that this would allow code generated by the RPG compiler to stuff the indicator byte into the second byte of a branch instruction, which on a 360-style architecture would change it to either a NOP or a branch.
> I know 1401 Autocoder people used to do horrible things like using > part of an instruction as a constant.
Somewhere in my archives I have a slim pamphlet - I think it was part of an official IBM series on Autocoder programming - which contained tips and techniques for writing self-modifying code.
> 2. You can do anything as long as you comment it. I once had a sequence > to test-store-conditional branch, for some reason I don't recall, bit I > tagged it with comments saying "these three instructions must be kept > together".
Sounds like you were counting on the condition code from the test surviving through the store instruction so that the conditional branch would properly pick it up. Yes, definitely worth a cautionary note.
-- /~\ Charlie Gibbs | In this world there are \ / <cgib…@kltpzyxm.invalid> | two kinds of people: X I'm really at ac.dekanfrus | 1. Those who can extrapolate / \ if you read it the right way. | from incomplete data.