Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/21/07 15:25
Read: times


 
#144880 - Yes, you're quite right ... ... Mea culpa
Responding to: ???'s previous message
I see what you mean. I've become entangled in instruction set differences, with the effect that it makes my remarks inaccurate if not unintelligible.

Unfortunately, there's no easy way to express low-level details such as what I wanted to express in processor-independent pseudocode. My decision to express this notion in 805x assembly language was definitely a poor choice, particularly in light of the fact I was thinking in terms of a totally different processor core. My illustration is, indeed, misleading to those unfamiliar with the underlying concept. Those not so unfamiliar with the concept would likely be confused by the choice to express it as I did.

The reason I picked the 6502, back in the early '80's, was the ability to use a table, to which I pointed with a "zero page" location, with 128 indirect addresses and pre-indexed to the appropriate vector. This allowed me to implement the sequence, "examine inputs, take appropriate action" in a two-instruction dispatch loop, taking less than 2 microseconds at 4.9152 MHz. The 12 MHz 805x, even with the expanded table size, would have taken considerably longer.

Indirect addressing, and particularly indexed indirect or indirect indexed (the distinction being pre- or post- indexing) addressing are powerful features in an instruction set. That's one of the things that made the 650x processors so popular back in the '70's, as it enabled code to be written both smaller and faster than with other, similar, architectures such as MC68xx.

That's not practical in the 805x instruction set, though the basic notion of fetching an address from a table is possible, though either much slower or requiring a somewhat larger table. It would require a table of 128 LJMP instructions, or 384 bytes.

The fact that so few processor cores support this addressing mode is sad, but remains a reality even today. Architectures designed in the day of limited on-chip memory were not often equipped with the facilities supporting the use of tables in this way because it was not perceived as the most efficient way to use what then was a scarce resource, namely on-chip code space. IIRC, the first monolithic CPU to support this addressing mode was the 68000, and it suffered from the fact that its instructions were so long that, with its 16-bit data bus, it required two cycles for each long word fetch, which made many tasks slower than on an 8-bit processor.

That's one weakness inherent in 32 and 16-bit RISC architectures. If you want to operate on a dense table of 8-bit values, you have to isolate each value before you can do that. Now, memory costs almost nothing these days, but time is still at a premium. If only there were a way to ignore 8, 16, or 24 bits of a data object without using extra time ...

RE




List of 62 messages in thread
TopicAuthorDate
weekend survey            01/01/70 00:00      
   1. programming through the whole night            01/01/70 00:00      
   two things at once            01/01/70 00:00      
      not entirely correct            01/01/70 00:00      
   I'm afraid, but...            01/01/70 00:00      
      stealing codes?            01/01/70 00:00      
         A lesson learned by many            01/01/70 00:00      
         They are way faster...            01/01/70 00:00      
            sounds like a bitter experience            01/01/70 00:00      
   3)Math            01/01/70 00:00      
      0) Math            01/01/70 00:00      
   I have to agree with Erik            01/01/70 00:00      
   For hardware design(VHDL)            01/01/70 00:00      
      then, throw out the crap            01/01/70 00:00      
   Math, experience, tools and code libraries            01/01/70 00:00      
   Why?            01/01/70 00:00      
      tradeoffs            01/01/70 00:00      
         Well said, but not what I asked            01/01/70 00:00      
            different question            01/01/70 00:00      
               technique v tool            01/01/70 00:00      
      two reasons            01/01/70 00:00      
         valuation            01/01/70 00:00      
            that's a given, but            01/01/70 00:00      
            Lookup tables are good for lots of stuff            01/01/70 00:00      
   Good topic!            01/01/70 00:00      
      common tool, but            01/01/70 00:00      
         Function Pointers on the 8051            01/01/70 00:00      
            table-driven whatever and function pointers            01/01/70 00:00      
               reduce a task to its basic elements            01/01/70 00:00      
                  Good idea, bad example            01/01/70 00:00      
                     I didn't really want to use 805x instructions            01/01/70 00:00      
                        I can\'t find my old, (t)rusty 65C02 cheatsheet...            01/01/70 00:00      
                           Only the Rockwell version had it            01/01/70 00:00      
                              Oh, mea culpa...            01/01/70 00:00      
                        A very simple example would be helpful            01/01/70 00:00      
                           let\\\'s start at your end            01/01/70 00:00      
                              Here's what's confusing            01/01/70 00:00      
                                 FAQ?            01/01/70 00:00      
                                 Yes, you're quite right ... ... Mea culpa            01/01/70 00:00      
                  inconsistent instruction set            01/01/70 00:00      
                     I ask you, seriously, to inform us            01/01/70 00:00      
                        a few things            01/01/70 00:00      
                           so much \'fun\' with ajmp            01/01/70 00:00      
                              I give up            01/01/70 00:00      
                                 the answer            01/01/70 00:00      
                           My intuition            01/01/70 00:00      
                              mhm            01/01/70 00:00      
      to russ            01/01/70 00:00      
         to erik            01/01/70 00:00      
            to Russ            01/01/70 00:00      
               to Erik            01/01/70 00:00      
               To Erik            01/01/70 00:00      
                  WOW, a companion CD            01/01/70 00:00      
   the bad ideas            01/01/70 00:00      
      Anachronism?            01/01/70 00:00      
         he's certainly not a HW guy...            01/01/70 00:00      
      Hardware protection slated            01/01/70 00:00      
         this is an academic view...            01/01/70 00:00      
            Proving correctness            01/01/70 00:00      
   Why state machine / lookup tables?            01/01/70 00:00      
      Not to disagree ... but ...            01/01/70 00:00      
         A good reference            01/01/70 00:00      

Back to Subject List