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

Re: [cosmacelf] Common Subroutine Idiom

Expand Messages
  • 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 1 of 29 , May 18 5:17 PM
    • 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 2 of 29 , May 20 1:46 PM
      • 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 3 of 29 , May 20 3:45 PM
        • 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 4 of 29 , May 20 3:53 PM
          • 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 5 of 29 , May 20 8:11 PM
            • 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.