You should not confuse assembly and high level languages, as those are very different things.
Quote:
Cool! In the languages I've looked at, I've never seen no flags. Always good to learn a thing.
I know it's weird, but I don't think it's correct to call different assembly language "languages". Even if they are all completely different, they're still assembly language : The different processors are usually referred to as "architectures" or "processor family".
Most RISC does not have flags, exept ARM which does have them. I am not sure about PowerPC and MSP430 series, but I'm sure MIPS series lacks them.
Erockbrox wrote:
load 55 into x register
compare with value of 20
since they are not equal then do something
if they are equal then don't do something
Quote:
like this?
Code:
ldx #55
cpx #20
bne "do something"
beq "don't do something"
The ARM family can do exactly that, not only branches are conditional but all other instructions too. This is a huge advantage in an if-then-else of a single instruction, as it avoids flushing the pipeline in one of both cases. When there is more than 2 instrucitons, typically it's better to take the risk to flush the pipeline, rather than loosing fetching many useless instructions, although it depends on applications.
In non-pipelined processors such as the 6502 it does not matter, since we never loose time flushing the pipeline since there is none. So it makes more sense not wasting 4 bits per instructions just for the conditional flags, and have only the branches who are conditional.