Posted By
Degauss on 2007-04-27 12:36:24
| Indirect,X
Hi Guys!
From time to time i think "Oh man, why didn't they do an (addr),X adressing mode instead of (addr,x)" because there are so rare occasions when you could be needing the Indirect,X-Adressing mode.
This is my question: In what situations do YOU use the Indirect,X adressing mode?
|
|
Posted By
Luca on 2007-04-27 13:00:20
| Re: Indirect,X
Never! Never used! My classic situation is more like "Oh my, I used LDA ($zp),X instead of LDA ($zp),Y !!".
|
|
Posted By
indi on 2007-04-27 13:10:35
| Re: Indirect,X
used it once or twice....but it is fairly rare.
|
|
Posted By
TMR on 2007-04-27 18:57:31
| Re: Indirect,X
i use self mod. =-)
|
|
Posted By
Bionic on 2007-04-28 05:07:19
| Re: Indirect,X
Never used it. It is probably in there to support some long dead high-level language.
Instructions I'd have rather had:
ASR TXY/TYX STX $aaaa,y STY $aaaa,x
More obselete stuff:
-BCD Mode -V-Flag and everything related to it
|
|
Posted By
siz on 2007-04-28 07:41:09
| Re: Indirect,X
I used BCD mode for some real decimal mode calculations. For example in Double Blocks it is used to calculate scores.
|
|
Posted By
Bionic on 2007-04-28 09:04:31
| Re: Indirect,X
I bet using one byte per digit would not be less efficient.
|
|
Posted By
Degauss on 2007-04-28 11:10:45
| Re: Indirect,X
*chuckle* If Bionic says he never used it, it's of no use... But why do you think the V-Flag is obsolete?
JMP (addr),y would've been nice too. If we collect more of these "would-be-nice"-opcodes we are going to find out why the 68000 became so popular
|
|
Posted By
indi on 2007-04-28 11:54:05
| Re: Indirect,X
65c02 and 65816 were much better opcode wise. Things like tyx, stz, bra, ply etc. make a huge difference when coding and I miss them. I did love the 16bit mode of 65816 as well, and I want to do something with the C64 super CPU at somepoint just because of that!
|
|
Posted By
SVS on 2007-05-03 08:44:47
| Re: Indirect,X
[Indirect addressing] The (zz,x) was never used inside Plus4 O.S.
[BCD] is useful! For example if you code a clock. The un-needed convertion from hex to dec is saved and a lot of runtime is gained.
|
|
Posted By
Bionic on 2007-05-03 12:59:34
| Re: Indirect,X
[BCD] is useful! For example if you code a clock.
Really? You still need a BCD to string converter. Isnt it more efficient to use a byte per digit and operate on full digits instead? I would bet there is hardly any advantage.
|
|
Posted By
Degauss on 2007-05-03 18:21:38
| Re: Indirect,X
i'm also one of the one-byte-per-digit-fraction. arithmetic is easy as converting numbers to PETSCII.
but BCD must have been popular once. it's unbelievable processors like 68000 and x86 have this mode. i remember especially the x86 has lots of operations concerning BCD.
@SVS: so even the plus4 OS found no use for that opcode. hm, i'm thinking of putting a bounty on a proof for a meaningful use of Indirect,X
|
|
Posted By
Litwr on 2007-05-04 02:12:43
| Re: Indirect,X
This mode is useful when X is set to zero. IMHO BCD mode is descendant of calculators "processors".
|
|
Posted By
siz on 2007-05-04 05:02:52
| Re: Indirect,X
BCD mode is used on midrange and mainframe computers for fixed point numeric calculations where higher accuracy is required than the floating point arithmetic can support. (for example 0.3 can not be represented in floating point because it gives an infinite binary fraction part. According to Bionic it could be represented as 1 byte/digit but in the old times the storage was expensive and the engineers must did something about that. I work on a telephone usage billing system that runs on the midrange IBM i5 system (formerly AS/400) and it's main number format is a descendant of BCD (called packed decimal where the last BCD digit is the sign). When we store 10 millions of calls and all of their data it DOES matter if we use BCD or one byte per digit. (Floating point is not acceptable as mentioned above)
|
|
Posted By
SVS on 2007-05-04 11:25:53
| Re: Indirect,X
@siz: indeed! In fact all old accountant machines and many old O.S. worked in BCD.
@Bionic: with BCD you have 2 digit in 1 byte. The convertion to string is easy (BCD nibble + $30) and the convertion to screencodes is the same.
With BCD, programmer had not to care about the skipping $A...$F, carry was automatic and overflow too. So called 'Registers' were clusters of 8 BCD bytes then achieving values from -999.999.999.999.999 to +-999.999.999.999.999 not bad!!! Oops this remember me something (BalSys)
|
|
Posted By
Bionic on 2007-05-04 12:32:29
| Re: Indirect,X
I guess the reason for the BCD mode is that the first microprocessor was developed to control calculators..
|
|
Posted By
indi on 2007-05-04 13:34:41
| Re: Indirect,X
I use BCD all the time when coding scores, its much easier to print the final number if you only have to AND #$0f and look it up in a table...
|
|