OT: Arithmetic order of operations

Oct 21, 2024 Last reply: 1 year ago 59 Replies

I'm making exactly the opposite point. Andy burns stated that "In assembly language, every branch is a GOTO".

I was pointing out that that was incorrect, as there are specific instructions that are "GOSUBs", not GOTOs, as GOTOs don't store the return address.

They are still doing it. My son is at university and has had one lecturer declare that he deducts marks for commenting the code!

No, I'm not as well-respected as the character Fluellen

I rest my case.

As late as that? The Data General Nova (1969) instruction set contained JMP and JSR, the latter storing the next address in the fourth accumulator for return. The third accumulator could also be used for indexed jumps.

<arguments snipped>

As it's so silly, do you really have to sully this group with it?

I assume that is how Shakespeare spelt 'Llewellyn'

-- "Socialist governments traditionally do make a financial mess. They always run out of other people's money. It's quite a characteristic of them"

Margaret Thatcher

I believe, Llywelyn, but there are many other spellings

PA ( ex-Wales )

See also Llwyd -> Lloyd -> Floyd

That was how the guy in my class spelled his name.

"Llywelyn, Llewelyn or Llewellyn is a name of Welsh language origins" sez wiki

Definitely - although, when living in the north-west of Wales, I knew a LLywelyn from Pakistan.

Incidentally, I watched the 1944, Olivier version of Henry V last night.

I'd forgotten what a good film it was. When you see Fluellen it is worth knowing that at that point, the actor was virtually blind - as a result of WW2 Royal Navy service.

In a CISC instruction set I would agree with you. However for RISC instruction sets that's not always the case. For example the ARM processor uses a Link Register (LR) and register have to be "manually" pushed onto the stack. There is no "call" or "return" instruction as such.

Mind, no one in their right mind would code in ARM assembler in all but the most extreme cases. Even the open sourced GCC compiler produces compact, fast code.

It is recognised that written well code should be understood without comments.

In practice its common sense to add comments, if only to say what you're trying to achieve.

Are there instruction sets that include instructions such as "CALLifnotzero label:" rather than "GOTOifnotzero label:" ?

In my (6502/6809) head, JMP is a GOTO, JSR is GOSUB and Bxx conditional branches are relative GOTOs

I think that applies to 6502s

Intel/Zilog used conditional calls, and conditional jumps. And even conditional returns

Ah yes, I've done such little Z80 coding, so long ago that those conditional calls and returns have been flushed from my brain.

I had a play with ARM assembler about 35 years ago, and was struck by how similar the machine code was to that of the old DG Nova, with individual instruction bits directly driving hardware pins, so that jumps and arithmetic instructions could be assembled like Meccano, with a 'not zero' or 'on carry' condition or 'shift left' bit added to the basic instruction. The Nova did have explicit JMP and JSR instructions, though not return, you just used the contents of accumulator 3 as an indirect jump address.

ERM, what do YOU think the D stands for?

I confess I haven't had any dealings with the DG Nova. Just looked and it was popular in the 1970s when I was still wearing short trousers!

I worked for a company making a television character generator (before the Amiga) which was based on a Nova. CPU, I/O and RAM were four 15" square PCBs.

DG stopped making it during production, so the company had to quickly develop a code-compatible alternative, which they did using AMD 2901 bit-slice micros.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required