|
Jerome Grimbert writes:
> My assembly being a little rusted, I would like to check with the knowledgeable > people the following portion of code. > > > ... > tst.l d2 > beq.s first_place > second_place: > ... > > Now, if d2 is 0, would executing that code reach first_place or second_place ? > (I have my idea, but I do not want to influence the audience). > > Thanks for your attention. Glad to see that "assembly questions" still appear to attract
a lot of interest. I too sometimes have problems with conditionals.
Probably something to do with latent dyslexia (I really must get round to
joining the DNA - National Dyslexia Association ;) (If you dont get the
joke you are probably a sufferer too!) My solution was to create and use the
following table:
Conditional branching
(bcc)
--------------------------- CMP Dx,Dy
X = branch taken, N Z C = flags set
Dx/Dy | 1/0 | 1/1 | -1/0 | 0/1 | 1/-1 | -2/-1 | Flags | NC | Z | C | ---- | N | ---- | + - - - + - - - + - - - + - - - + - - - + - - - + U bhi | | | | X | X | X | + + + + + + + U bls | X | X | X | | | | + + + + + + + U bcc | | X | | X | X | X | + + + + + + + U bcs | X | | X | | | | + + + + + + + bne | X | | X | X | X | X | + + + + + + + beq | | X | | | | | + + + + + + + S bpl | | X | X | X | | X | + + + + + + + S bmi | X | | | | X | | + + + + + + + S bge | | X | X | X | | X | + + + + + + + S blt | X | | | | X | | + + + + + + + S bgt | | | X | X | | X | + + + + + + + S ble | X | X | | | X | | + + + + + + +
(Please let me know if you discover
any mistakes!)
Per
|
- Re: [ql-users] Assembly question Marcel Kilgus
- Re: [ql-users] Assembly quest... Jerome Grimbert
- Re: [ql-users] Assembly q... Marcel Kilgus
- Re: [ql-users] Assembly q... Jerome Grimbert
- Re: [ql-users] Assembly q... Wolfgang Lenerz
- Re: [ql-users] Assembly q... Jerome Grimbert
- Re: [ql-users] Assembly question Marcel Kilgus
- Re: [ql-users] Assembly question Jerome Grimbert
- Re: [ql-users] Assembly question Wolfgang Lenerz
- Re: [ql-users] Assembly question Wolfgang Lenerz
- Re: [ql-users] Assembly question P Witte
- Re: [ql-users] Assembly question Robert Newson
- Re: [ql-users] Assembly question P Witte
- Re: [ql-users] Assembly question Robert Newson
- Re: [ql-users] Assembly question Marcel Kilgus
- Re: [ql-users] Assembly question Robert Newson
- RE: [ql-users] Assembly question Norman Dunbar
- RE: [ql-users] Assembly question Norman Dunbar
- Re: [ql-users] Assembly question Marcel Kilgus
- Re: [ql-users] Assembly question Joachim Van der Auwera
- RE: [ql-users] Assembly question Norman Dunbar
