Loading ...
Sorry, an error occurred while loading the content.

Re: Common Subroutine Idiom

Expand Messages
  • druske
    Charlie, if you d like to email them to me, I ll create a page on the cosmacelf.com site for 1802 developer tools. It looks like the PseudoSam assembler that
    Message 1 of 29 , Apr 26 6:55 AM
    • 0 Attachment
      Charlie, if you'd like to email them to me, I'll create a page on the
      cosmacelf.com site for 1802 developer tools. It looks like the
      PseudoSam assembler that Steve mentioned can be freely distributed as
      well, so I can include that as well.

      Does anyone know of other tools that could be included, or commercial
      products that could be linked to?

      Dave

      --- In cosmacelf@y..., herc_fun <no_reply@y...> wrote:
      > If anyone is interested, I have an 1802 cross-assembler written in
      > COBOL (of all things). If that's not weird enough, I have a dis-
      > assembler written in PL/I. If there's any interest, post a note and
      > I'll be willing to share.
      >
      > Charlie
    • John Chris Wren
      I was hunting around for source archives last night, and didn t run across any. Is there a good 1802 central software repository? I often start projects I
      Message 2 of 29 , Apr 26 6:55 AM
      • 0 Attachment
        I was hunting around for source archives last night, and didn't run across
        any. Is there a good 1802 central software repository?

        I often start projects I never get around to finishing, but I was actually
        thinking about seeing what it would take to port GCC to the 1802.

        --John
        -----Original Message-----
        From: herc_fun [mailto:no_reply@yahoogroups.com]
        Sent: Friday, April 26, 2002 9:35 AM
        To: cosmacelf@yahoogroups.com
        Subject: [cosmacelf] Re: Common Subroutine Idiom



        > -----Original Message-----
        > From: John Chris Wren [mailto:jcwren@j...]
        .....
        > What's the most common idiom for implementing subroutine type
        > functionality on a 1802?
        The 3-register approach is what I always used (see the Space Invaders
        source for implementation)

        > Finally, can anyone recommend a good Linux based 1802
        assembler? And if
        > not Linux, then DOS?

        If anyone is interested, I have an 1802 cross-assembler written in
        COBOL (of all things). If that's not weird enough, I have a dis-
        assembler written in PL/I. If there's any interest, post a note and
        I'll be willing to share.

        Charlie


        [Non-text portions of this message have been removed]
      • Lee Hart
        ... RCA s SCRT (Standard Call and Return Technique) is the most common. Briefly, it uses R4 as the dedicated call program counter, and R5 as the dedicated
        Message 3 of 29 , Apr 26 11:45 AM
        • 0 Attachment
          John Chris Wren wrote:
          > What's the most common idiom for implementing subroutine type
          > functionality on a 1802? I see the 1805/06 has an actual call
          > instruction, which would be nice.

          RCA's SCRT (Standard Call and Return Technique) is the most common.
          Briefly, it uses R4 as the dedicated "call" program counter, and R5 as
          the dedicated "return" program counter. Your main program looks like
          this:

          opcode
          opcode
          SEP R4 ;this is the "call" instruction
          dw subroutine ;the address of the subroutine you are calling
          opcode
          opcode

          Assume R3 is the program counter. The "call" program at R4 pushes R3
          onto the stack, loads R3 with the address of the subroutine, and makes
          R3 the program counter. In effect, you jumped to the subroutine and
          saved the return address. The subroutine code looks like this:

          subroutine:
          opcode ;code to do whatever the subroutine does
          opcode
          SEP R5 ;this is the "return" instruction

          The program at R5 pops the old program counter off the stack, restores
          it to R3, and makes R3 the program counter again, thus returning to the
          original program.

          SCRT imitates what programmers think are "normal" microcomputer calls
          and returns. However, it is rather slow.

          > And do people tend to mess around with actually changing the register
          > used for the PC, or stick to R0?

          Normally, yes. Once you figure out how the 1802 works, it is faster and
          takes less code to do it the "1802 way". Basically, you assign a program
          counter to each layer or task; R0 for DMA, R1 for interrupts, R2 for
          stack, R3 for top-level program, R4 for 1st level subroutines, R5 for
          2nd level subroutines, etc.

          For example, you may want to call the "charout" (output a character)
          routine a lot. So, you dedicate R4 as its dedicated program counter.
          Then to output a character in D, all it takes is a 1-byte SEP R4
          instruction. The charout subroutine at R4 returns with a simple SEP R3.

          If you have more subroutines than registers, you can pass a single byte
          to the subroutine to tell it which of 256 tasks to perform. Calls take 2
          bytes and are slower than the 1-byte call, but you still use less memory
          and time than a generalized 3-byte call.

          It is this ability to design highly optimized calls and returns that
          makes the 1802 unusually powerful. Tom Pittman once said (and I have
          found no evidence to disprove it) that the 1802 takes fewer bytes and
          fewer machine cycles to do a given job than any other microcomputer.

          > Finally, can anyone recommend a good Linux based 1802 assembler?
          > And if not Linux, then DOS?

          I am using the Avocet XASM18 1802 cross-assemblers for DOS and CP/M.
          --
          Lee A. Hart Ring the bells that still can ring
          814 8th Ave. N. Forget your perfect offering
          Sartell, MN 56377 USA There is a crack in everything
          leeahart_at_earthlink.net That's how the light gets in - Leonard Cohen
        • John Chris Wren
          Saw these at GoldMine Electronics (www.goldmine-elec.com, however, these items are not in the web catalog). 1-800-445-0697, Scottsdale AZ 85261 MSI/88e
          Message 4 of 29 , Apr 26 2:04 PM
          • 0 Attachment
            Saw these at GoldMine Electronics (www.goldmine-elec.com, however, these
            items are not in the web catalog). 1-800-445-0697, Scottsdale AZ 85261

            MSI/88e Portable Barcode Computer Terminal -- The cases show signs of wear
            including sctratches, cracks and dirty keyboards. We are selling them "as
            is" for the circuit boards with components inside. The unit we opened had 5
            circuit boards, a keyboard with 27 keyswitches, a display board with a 16
            character alphanumeric LED display and 9 ICs including CMOS and display
            drivers, a 16K data RAM board with 1K x 4K chips including 16 MWS5114E ICs,
            2 more RAM boards with 24 TC5514P-1 ICs 8K-24K on each board and one CPU
            board with a CPU IC type CDP1802ACE, a 26043IC, a 26045 IC and various other
            ICs. Another unit we opened used Japan 8050 24560-00-00A RAM ICs on the RAM
            boards, so there is some variance, however, each unit will have 3 RAM
            boards, 1 display board, a keyboard, and a CPU board. Operates from 4 "AA"
            batteries (not included). Size: 7 3/4" x 3 1/2" x 2 1/2". We have absolutely
            no data or info of any kind on these and we are not selling them as working.
            They are being sold "AS IS" only-no returns. G8007 Sale! $3.00 ea.


            [Non-text portions of this message have been removed]
          • victor baca
            you wana port thr GCC to 1802 your in for world of hurt. wow your must be a maskist.... vic ps good luck buddy ... [Non-text portions of this message have
            Message 5 of 29 , Apr 28 7:06 PM
            • 0 Attachment
              you wana port thr GCC to 1802 your in for world of hurt. wow your
              must be a maskist....
              vic
              ps good luck buddy


              John Chris Wren wrote:

              > I was hunting around for source archives last night, and didn't run
              > across
              > any. Is there a good 1802 central software repository?
              >
              > I often start projects I never get around to finishing, but I was
              > actually
              > thinking about seeing what it would take to port GCC to the 1802.
              >
              > --John
              > -----Original Message-----
              > From: herc_fun [mailto:no_reply@yahoogroups.com]
              > Sent: Friday, April 26, 2002 9:35 AM
              > To: cosmacelf@yahoogroups.com
              > Subject: [cosmacelf] Re: Common Subroutine Idiom
              >
              >
              >
              > > -----Original Message-----
              > > From: John Chris Wren [mailto:jcwren@j...]
              > .....
              > > What's the most common idiom for implementing subroutine type
              > > functionality on a 1802?
              > The 3-register approach is what I always used (see the Space
              > Invaders
              > source for implementation)
              >
              > > Finally, can anyone recommend a good Linux based 1802
              > assembler? And if
              > > not Linux, then DOS?
              >
              > If anyone is interested, I have an 1802 cross-assembler written in
              > COBOL (of all things). If that's not weird enough, I have a dis-
              > assembler written in PL/I. If there's any interest, post a note and
              >
              > I'll be willing to share.
              >
              > Charlie
              >
              >
              > [Non-text portions of this message have been removed]
              >
              >
              >
              > ==================================================
              > Visit the COSMAC ELF website at www.cosmacelf.com.
              >
              > To unsubscribe from this group, send an email to:
              > cosmacelf-unsubscribe@yahoogroups.com
              >
              >
              >
              > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


              [Non-text portions of this message have been removed]
            • John Chris Wren
              GCC is the GNU C compiler (http://gcc.gnu.org). It s been ported to a great many processors, including Alphas, PPC, AVRs, Sparc, 68K, MSP430, Vax, AMD29K,
              Message 6 of 29 , Apr 29 6:42 AM
              • 0 Attachment
                GCC is the GNU C compiler (http://gcc.gnu.org). It's been ported to a
                great many processors, including Alphas, PPC, AVRs, Sparc, 68K, MSP430, Vax,
                AMD29K, etc.

                GCC normally doesn't port well to 8 bit processors, but GCC 3.01 has
                made it easier. I would imagine that the 1802 architecture would be easier
                to port than something like the 8051, since there are several 16 bit
                registers (most 8051s have one, and several have two, but require games be
                played to use both. It's an adhoc extension).

                It's not like I have enough uncompleted projects that starting one more
                would be noticed...

                --John
                -----Original Message-----
                From: Lee Hart [mailto:leeahart@...]
                Sent: Monday, April 29, 2002 10:43 AM
                To: cosmacelf@yahoogroups.com
                Subject: Re: [cosmacelf] Re: Common Subroutine Idiom


                victor baca wrote:
                > you wana port thr GCC to 1802 your in for world of hurt. wow your
                > must be a maskist....

                What is GCC? Why would the 1802 be any less capable than any other CPU?
                --
                Lee A. Hart Ring the bells that still can ring
                814 8th Ave. N. Forget your perfect offering
                Sartell, MN 56377 USA There is a crack in everything
                leeahart_at_earthlink.net That's how the light gets in - Leonard Cohen


                [Non-text portions of this message have been removed]
              • Lee Hart
                ... What is GCC? Why would the 1802 be any less capable than any other CPU? -- Lee A. Hart Ring the bells that still can ring 814 8th Ave. N.
                Message 7 of 29 , Apr 29 7:42 AM
                • 0 Attachment
                  victor baca wrote:
                  > you wana port thr GCC to 1802 your in for world of hurt. wow your
                  > must be a maskist....

                  What is GCC? Why would the 1802 be any less capable than any other CPU?
                  --
                  Lee A. Hart Ring the bells that still can ring
                  814 8th Ave. N. Forget your perfect offering
                  Sartell, MN 56377 USA There is a crack in everything
                  leeahart_at_earthlink.net That's how the light gets in - Leonard Cohen
                • Dave Ruske
                  There was a C compiler for the 1802? Wow, I had no idea. Does anyone have any literature or additional information on this? Was it a cross compiler? Dave
                  Message 8 of 29 , Apr 29 8:03 AM
                  • 0 Attachment
                    There was a C compiler for the 1802? Wow, I had no idea. Does anyone have
                    any literature or additional information on this? Was it a cross compiler?

                    Dave

                    At 09:27 AM 4/29/2002 -0700, you wrote:
                    >Thank you. Yes, I would imagine that the 1802 would be much easier to
                    >port C to than most small micros. RCA did sell a C compiler (and Pascal,
                    >BASIC, FORTH, and PL/M compilers) for the 1802, so it has been done.
                  • Lee Hart
                    ... Thank you. Yes, I would imagine that the 1802 would be much easier to port C to than most small micros. RCA did sell a C compiler (and Pascal, BASIC,
                    Message 9 of 29 , Apr 29 9:27 AM
                    • 0 Attachment
                      John Chris Wren wrote:
                      > GCC is the GNU C compiler (http://gcc.gnu.org)... I would imagine that
                      > the 1802 architecture would be easier to port than something like the
                      > 8051, since there are several 16 bit registers

                      Thank you. Yes, I would imagine that the 1802 would be much easier to
                      port C to than most small micros. RCA did sell a C compiler (and Pascal,
                      BASIC, FORTH, and PL/M compilers) for the 1802, so it has been done.
                      --
                      Lee A. Hart Ring the bells that still can ring
                      814 8th Ave. N. Forget your perfect offering
                      Sartell, MN 56377 USA There is a crack in everything
                      leeahart_at_earthlink.net That's how the light gets in - Leonard Cohen
                    • stew_m_3
                      ... Hello Lee, Have you run across a copy of that Pascal compiler anywhere? I would love to find it. Stewart
                      Message 10 of 29 , Apr 29 10:11 AM
                      • 0 Attachment
                        --- In cosmacelf@y..., Lee Hart <leeahart@e...> wrote:
                        > . . . RCA did sell a C compiler (and Pascal,
                        > BASIC, FORTH, and PL/M compilers) for the 1802, so it has been done.

                        Hello Lee,

                        Have you run across a copy of that Pascal compiler anywhere? I
                        would love to find it.

                        Stewart
                      • Lee Hart
                        ... I believe it ran on the RCA development system (which had an 1802 as its CPU). The development system had the resources you d need for a high level
                        Message 11 of 29 , Apr 29 11:20 AM
                        • 0 Attachment
                          Dave Ruske wrote:
                          > There was a C compiler for the 1802? Wow, I had no idea. Does anyone
                          > have any literature or additional information on this? Was it a cross
                          > compiler?

                          I believe it ran on the RCA development system (which had an 1802 as its
                          CPU). The development system had the resources you'd need for a high
                          level language (lots of memory, 8" floppy disks, 80x24 screen, etc.). It
                          compiled programs that were intended to run on a "target" system, i.e.
                          some dedicated product application.

                          If memory serves, this C was produced by some outside company and
                          marketed by RCA (like FORTH). It was more like a "small C", and less
                          capable than RCA's Pascal or PL/M compilers. Thus RCA marketing steered
                          you toward these other products.
                          --
                          Lee A. Hart Ring the bells that still can ring
                          814 8th Ave. N. Forget your perfect offering
                          Sartell, MN 56377 USA There is a crack in everything
                          leeahart_at_earthlink.net That's how the light gets in - Leonard Cohen
                        • Lee Hart
                          ... No; I haven t. I ve only seen it described in the RCA documentation. -- Lee A. Hart Ring the bells that still can ring 814 8th Ave. N.
                          Message 12 of 29 , Apr 29 4:00 PM
                          • 0 Attachment
                            stew_m_3 wrote:
                            > Have you run across a copy of that Pascal compiler anywhere?
                            > I would love to find it.

                            No; I haven't. I've only seen it described in the RCA documentation.
                            --
                            Lee A. Hart Ring the bells that still can ring
                            814 8th Ave. N. Forget your perfect offering
                            Sartell, MN 56377 USA There is a crack in everything
                            leeahart_at_earthlink.net That's how the light gets in - Leonard Cohen
                          • oopic_developer
                            Cool! I will take 2. How did you find them? -Scott ... be pulls. If ... Priority ... of ... able to
                            Message 13 of 29 , May 6, 2002
                            • 0 Attachment
                              Cool!
                              I will take 2.

                              How did you find them?

                              -Scott

                              --- In cosmacelf@y..., "John Chris Wren" <jcwren@j...> wrote:
                              > I've got 90 CDP1802ACE that are in tubes, and don't appear to
                              be pulls. If
                              > anyone is interested, $3 USD ea + shipping (cheapest is probably
                              Priority
                              > Mail at $3.50, but I'd have to check to prove that). If anyone is
                              > interested, email me at jcwren@j... Paypal, check, money orders,
                              > gold bullion, and virgins (female, 18-24) are all acceptable forms
                              of
                              > payment.
                              >
                              > If someone has CDP1854's (UART) or CDP1861's (VDC), we may be
                              able to
                              > trade. CDP1851's are also iof interest.
                              >
                              > --John
                            • John Chris Wren
                              Just browsing through the tubes at a local electronics dealer. I know they had been there for at least a year, thinking back on it. Probably longer. I just
                              Message 14 of 29 , May 6, 2002
                              • 0 Attachment
                                Just browsing through the tubes at a local electronics dealer. I know
                                they had been there for at least a year, thinking back on it. Probably
                                longer. I just never really gave a thought to messing with them back then.

                                --John
                                -----Original Message-----
                                From: oopic_developer [mailto:scott.savage@...]
                                Sent: Monday, May 06, 2002 13:37 PM
                                To: cosmacelf@yahoogroups.com
                                Subject: [cosmacelf] Re: Score! CDP1802ACE



                                Cool!
                                I will take 2.

                                How did you find them?

                                -Scott

                                --- In cosmacelf@y..., "John Chris Wren" <jcwren@j...> wrote:
                                > I've got 90 CDP1802ACE that are in tubes, and don't appear to
                                be pulls. If
                                > anyone is interested, $3 USD ea + shipping (cheapest is probably
                                Priority
                                > Mail at $3.50, but I'd have to check to prove that). If anyone is
                                > interested, email me at jcwren@j... Paypal, check, money orders,
                                > gold bullion, and virgins (female, 18-24) are all acceptable forms
                                of
                                > payment.
                                >
                                > If someone has CDP1854's (UART) or CDP1861's (VDC), we may be
                                able to
                                > trade. CDP1851's are also iof interest.
                                >
                                > --John


                                Yahoo! Groups Sponsor
                                ADVERTISEMENT





                                ==================================================
                                Visit the COSMAC ELF website at www.cosmacelf.com.

                                To unsubscribe from this group, send an email to:
                                cosmacelf-unsubscribe@yahoogroups.com



                                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                [Non-text portions of this message have been removed]
                              • John Chris Wren
                                Another score: http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=1728230388 [Non-text portions of this message have been removed]
                                Message 15 of 29 , May 6, 2002
                                • 0 Attachment
                                  Another score: http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=1728230388

                                  [Non-text portions of this message have been removed]
                                • s_brune2001
                                  Hello all: I see you found my site on MSN communities. I have not done much with it because Microsoft changed their policy. You used to be able to post 30Mb of
                                  Message 16 of 29 , May 8, 2002
                                  • 0 Attachment
                                    Hello all:

                                    I see you found my site on MSN communities. I have not done much with
                                    it because Microsoft changed their policy. You used to be able to
                                    post 30Mb of information for free. Now they changed it to 3Mb and I'm
                                    not sure I can do anything useful with 3Mb. I would be glad to link
                                    to add links to your sites just let me know at s_brune@...
                                    and I will put them on the site.

                                    The ELF II was the first computer I owned and I have many fond
                                    memories of programming it. I still have a lot of the manuals, parts
                                    and newsletters from then.

                                    I recently bought a vintage RCA Studio II video game on eBay. It also
                                    uses the 1802 to power it. That's why I set aside space on the
                                    website for it.

                                    Steve

                                    --- In cosmacelf@y..., Dave Ruske <dave@r...> wrote:
                                    > Just added a link from cosmacelf.com's "Links" page. Thanks for the
                                    pointer!
                                    >
                                    > That photo labeled "Quest" looks to me like an early ELF II, the
                                    one with the
                                    > pushbuttons instead of toggle switches...
                                    >
                                    > I would've requested a reciprocal link, but when I tried to create
                                    a Passport
                                    > account (with bogus info, of course) it whined about my browser.
                                    Apparently
                                    > Microsoft has something against Mozilla. Go figure. Should I refuse
                                    to link
                                    > to an MSN site on principle? ;)
                                    >
                                    > Dave
                                  • Gemeny, Steve
                                    I picked up 4 of these widgets... Not a bad deal. Mine appear to have the following Stuff : Board 1 16K - 22K RAM board (mine s 22K) in 2Kx8 chips (Hitachi
                                    Message 17 of 29 , May 14, 2002
                                    • 0 Attachment
                                      I picked up 4 of these widgets... Not a bad deal.

                                      Mine appear to have the following "Stuff":
                                      Board 1 16K - 22K RAM board (mine's 22K) in 2Kx8 chips (Hitachi 27069 ? !
                                      ?)
                                      Board 2 1802 and some glue logic, Bus drivers, and a 15 pin I/O (scanner
                                      gone)
                                      4013, 4009, 74C174, 74C374, 4024, 4093, 4049, 74C08
                                      a ROM that appears to be 2764 pinout (27884 ? ! ?)
                                      Board 3 10K -12 K RAM board (mine's 10 K) with Toshiba 5517s (2Kx8)
                                      Board 4 seems to be all Keyboard and display logic.
                                      Board 5 is the keyboard

                                      Interesting method of interconnecting the boards via L O N G pin headers
                                      (0.1 inch spaced X 16 pins) that pass through multiple boards, some connect
                                      some just keep going on though the next. 4 such sets of "Vertical Busses"
                                      between all but Board 5... Looks like 2 busses are for memory (Address, Data
                                      & selects), the other pair seems to be I/O related.

                                      Boards have a label of Ditronics MSI/88e Web search seems to find a
                                      DVD/home Cinema company in UK named Ditronics... Doubt if they'll be any
                                      help.

                                      I've removed the ROM and hope to read it (may be some recon to be had
                                      disassembling parts of it) next chance I get at the PROM Burner.

                                      It might be nice to stick some code into a 2764 and see if I can learn
                                      anything about the memory & I/O map... I'll think about that and accept
                                      comments for a while.

                                      As a minimum, it should be possible to usurp the Q and an EFx for Tiny Basic
                                      to use for IO and slam Lee's copy (looks like it's Orged to H0000) and have
                                      Tiny running in a hand held board with a bunch of RAM.

                                      Anyone else get any of these? Anyone else working these issues?

                                      Safety and productivity in numbers...

                                      Later,
                                      Steve
                                      aka aa3nm{at}amsat.org





                                      -----Original Message-----
                                      From: John Chris Wren [mailto:jcwren@...]
                                      Sent: Friday, April 26, 2002 5:05 PM
                                      To: cosmacelf@yahoogroups.com
                                      Subject: [cosmacelf] Cheap widget with CDP1802ACE inside


                                      Saw these at GoldMine Electronics (www.goldmine-elec.com, however, these
                                      items are not in the web catalog). 1-800-445-0697, Scottsdale AZ 85261

                                      MSI/88e Portable Barcode Computer Terminal -- The cases show signs of wear
                                      including sctratches, cracks and dirty keyboards. We are selling them "as
                                      is" for the circuit boards with components inside. The unit we opened had 5
                                      circuit boards, a keyboard with 27 keyswitches, a display board with a 16
                                      character alphanumeric LED display and 9 ICs including CMOS and display
                                      drivers, a 16K data RAM board with 1K x 4K chips including 16 MWS5114E ICs,
                                      2 more RAM boards with 24 TC5514P-1 ICs 8K-24K on each board and one CPU
                                      board with a CPU IC type CDP1802ACE, a 26043IC, a 26045 IC and various other
                                      ICs. Another unit we opened used Japan 8050 24560-00-00A RAM ICs on the RAM
                                      boards, so there is some variance, however, each unit will have 3 RAM
                                      boards, 1 display board, a keyboard, and a CPU board. Operates from 4 "AA"
                                      batteries (not included). Size: 7 3/4" x 3 1/2" x 2 1/2". We have absolutely
                                      no data or info of any kind on these and we are not selling them as working.
                                      They are being sold "AS IS" only-no returns. G8007 Sale! $3.00 ea.


                                      [Non-text portions of this message have been removed]



                                      ==================================================
                                      Visit the COSMAC ELF website at www.cosmacelf.com.

                                      To unsubscribe from this group, send an email to:
                                      cosmacelf-unsubscribe@yahoogroups.com



                                      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
                                      <http://docs.yahoo.com/info/terms/> .




                                      [Non-text portions of this message have been removed]
                                    • victor baca
                                      Another common probllem would be the comar I dont see that the 1802 has one? how does the rca book or some say how to do this . Does it involve subtraction.
                                      Message 18 of 29 , May 18, 2002
                                      • 0 Attachment
                                        Another common probllem would be the comar I dont see that the 1802
                                        has one? how does the rca book or some say how to do this . Does it
                                        involve subtraction.
                                        thanx vic

                                        dave@... wrote:

                                        > I don't know about "most used"; there were several techniques one
                                        > could
                                        > implement depending on how they wanted to trade off speed, register
                                        > dedication, and ease of use. The Standard Call and Return Technique
                                        > enjoyed quite a bit of popularity because it was very general-purpose,
                                        >
                                        > but it also tied up R4, R5, and R6, and was relatively slow and
                                        > complex.
                                        >
                                        > In programs with one or two subroutines, it was more efficient (and
                                        > very
                                        > fast!) to dedicate a register to the call, then invoke with SEP when
                                        > needed.
                                        > To return, the subroutine would usually jump back to just before its
                                        > first
                                        > instruction and SEP back to the main PC; this would leave the
                                        > subroutine's
                                        > PC register set up for the next call. Note that this doesn't even use
                                        > a stack
                                        > because the return address is in a register, but it presumes that the
                                        > subroutine knows the PC of its caller, which doesn't lend the
                                        > technique to
                                        > nesting. But how many CPUs of the day could call a subroutine in just
                                        > two
                                        > machine cycles, and return with two more?
                                        >
                                        > Several other techniques were detailed in RCA's manual, falling
                                        > between
                                        > these two in complexity and speed, but I forget what they were. I
                                        > think
                                        > the two techniques mentioned above were probably the most common.
                                        >
                                        > Dave
                                        >
                                        > > What's the most common idiom for implementing subroutine type
                                        > > functionality on a 1802? I see the 1805/06 has an actuall call
                                        > instruction,
                                        > > which would be nice.
                                        > >
                                        > > And do people tend to mess around with actually changing the
                                        > register
                                        > > used for the PC, or stick to R0?
                                        >
                                        >
                                        > Yahoo! Groups Sponsor
                                        ADVERTISEMENT


                                        >
                                        > ==================================================
                                        > Visit the COSMAC ELF website at www.cosmacelf.com.
                                        >
                                        > To unsubscribe from this group, send an email to:
                                        > cosmacelf-unsubscribe@yahoogroups.com
                                        >
                                        >
                                        >
                                        > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

                                        --
                                        Registered Linux user #270618
                                        Stand up and be counted.

                                        HTTP://counter.li.org



                                        [Non-text portions of this message have been removed]
                                      • druske
                                        I don t think the 1802 has a comar, either! :) (Um, at the risk of looking foolish, what *is* a comar , anyway?) Dave
                                        Message 19 of 29 , May 20, 2002
                                        • 0 Attachment
                                          I don't think the 1802 has a comar, either! :)

                                          (Um, at the risk of looking foolish, what *is* a "comar", anyway?)

                                          Dave

                                          --- In cosmacelf@y..., victor baca <vbaca@e...> wrote:
                                          > Another common probllem would be the comar I dont see that the 1802
                                          > has one? how does the rca book or some say how to do this . Does it
                                          > involve subtraction.
                                          > thanx vic
                                        • victor baca
                                          OK OK OK OK a compair sorry ... ADVERTISEMENT ... -- Registered Linux user #270618 Stand up and be counted. HTTP://counter.li.org [Non-text portions of this
                                          Message 20 of 29 , May 20, 2002
                                          • 0 Attachment
                                            OK OK OK OK

                                            a compair
                                            sorry


                                            druske wrote:

                                            > I don't think the 1802 has a comar, either! :)
                                            >
                                            > (Um, at the risk of looking foolish, what *is* a "comar", anyway?)
                                            >
                                            > Dave
                                            >
                                            > --- In cosmacelf@y..., victor baca <vbaca@e...> wrote:
                                            > > Another common probllem would be the comar I dont see that the
                                            > 1802
                                            > > has one? how does the rca book or some say how to do this . Does it
                                            > > involve subtraction.
                                            > > thanx vic
                                            >
                                            >
                                            >
                                            > Yahoo! Groups Sponsor
                                            ADVERTISEMENT


                                            >
                                            > ========================================================
                                            > Visit the COSMAC ELF website at http://www.cosmacelf.com
                                            >
                                            > To unsubscribe from this group, send an email to:
                                            > cosmacelf-unsubscribe@yahoogroups.com
                                            >
                                            >
                                            >
                                            > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

                                            --
                                            Registered Linux user #270618
                                            Stand up and be counted.

                                            HTTP://counter.li.org



                                            [Non-text portions of this message have been removed]
                                          • J.C. Wren
                                            compare , maybe? --John ... From: victor baca [mailto:vbaca@enter.net] Sent: Monday, May 20, 2002 18:45 To: cosmacelf@yahoogroups.com Subject: Re: [cosmacelf]
                                            Message 21 of 29 , May 20, 2002
                                            • 0 Attachment
                                              "compare", maybe?

                                              --John
                                              -----Original Message-----
                                              From: victor baca [mailto:vbaca@...]
                                              Sent: Monday, May 20, 2002 18:45
                                              To: cosmacelf@yahoogroups.com
                                              Subject: Re: [cosmacelf] Re: Common Subroutine Idiom


                                              OK OK OK OK

                                              a compair
                                              sorry


                                              druske wrote:

                                              > I don't think the 1802 has a comar, either! :)
                                              >
                                              > (Um, at the risk of looking foolish, what *is* a "comar", anyway?)
                                              >
                                              > Dave
                                              >
                                              > --- In cosmacelf@y..., victor baca <vbaca@e...> wrote:
                                              > > Another common probllem would be the comar I dont see that the
                                              > 1802
                                              > > has one? how does the rca book or some say how to do this . Does it
                                              > > involve subtraction.
                                              > > thanx vic
                                              >
                                              >
                                              >
                                              > Yahoo! Groups Sponsor
                                              ADVERTISEMENT


                                              >
                                              > ========================================================
                                              > Visit the COSMAC ELF website at http://www.cosmacelf.com
                                              >
                                              > To unsubscribe from this group, send an email to:
                                              > cosmacelf-unsubscribe@yahoogroups.com
                                              >
                                              >
                                              >
                                              > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

                                              --
                                              Registered Linux user #270618
                                              Stand up and be counted.

                                              HTTP://counter.li.org



                                              [Non-text portions of this message have been removed]


                                              Yahoo! Groups Sponsor
                                              ADVERTISEMENT




                                              ========================================================
                                              Visit the COSMAC ELF website at http://www.cosmacelf.com

                                              To unsubscribe from this group, send an email to:
                                              cosmacelf-unsubscribe@yahoogroups.com



                                              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                              [Non-text portions of this message have been removed]
                                            • Dave Ruske
                                              Sorry, Victor, I should ve guessed compare by the reference to subtraction in your message. Some days my brain needs a little extra help! Yes, you re right,
                                              Message 22 of 29 , May 20, 2002
                                              • 0 Attachment
                                                Sorry, Victor, I should've guessed "compare" by the reference to subtraction
                                                in your message. Some days my brain needs a little extra help!

                                                Yes, you're right, there's no compare instruction as such. Subtraction would
                                                be the closest thing. Not really a huge deal, though, because with the 1802
                                                the result always ends up in D and you're usually loading D up with something
                                                new anyway. Or if you're doing a series of comparisons (say, against 2, then
                                                5, then 7) you could write it instead as a series of subtractions (subtract
                                                2, then 3 more, then 2 more).

                                                Dave

                                                On Monday 20 May 2002 05:45 pm, you wrote:
                                                > OK OK OK OK
                                                >
                                                > a compair
                                                > sorry
                                              Your message has been successfully submitted and would be delivered to recipients shortly.