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

ROM Bootloader Issues

Expand Messages
  • Kyle Owen
    Hi guys, So I recently copied 8k BASIC to (4) 2kB EEPROMs in hopes that I could make a bootloader to copy the contents into RAM, eliminating the 5 minutes or
    Message 1 of 9 , Jun 2, 2012
    View Source
    • 0 Attachment
      Hi guys,

      So I recently copied 8k BASIC to (4) 2kB EEPROMs in hopes that I could make a bootloader to copy the contents into RAM, eliminating the 5 minutes or so that it would otherwise take to load BASIC via RS-232. 

      Anyways, I'm completely stumped as to why my very simple bootloader isn't working correctly. The code can be found here: http://pastebin.com/jbrTHdnX

      It actually does copy the contents correctly, but fails to exit to the monitor on time. The DEX instruction can only update the zero flag, so I am fairly limited on branches. It should exit the loop as soon as the index register is zero, but instead, it exits well after the index register underflows. 

      Any help would be much appreciated, as always. Thanks!

      Kyle
    • joshbensadon
      Hi Kyle, I might be a little confused so excuse me if I m in left field. Looking at your code, it looks like Z80 right? Doesn t the PUSH put 2 bytes on the
      Message 2 of 9 , Jun 2, 2012
      View Source
      • 0 Attachment
        Hi Kyle,

        I might be a little confused so excuse me if I'm in left field.

        Looking at your code, it looks like Z80 right?
        Doesn't the PUSH put 2 bytes on the stack? Accumulator and PSW??
        Further, the PUSH decrements the places the data.
        So, you should load the stack pointer with RAMEND+1 and after every push, you should INX SP.



        --- In midatlanticretro@yahoogroups.com, Kyle Owen <kylevowen@...> wrote:
        >
        > Hi guys,
        >
        > So I recently copied 8k BASIC to (4) 2kB EEPROMs in hopes that I could make
        > a bootloader to copy the contents into RAM, eliminating the 5 minutes or so
        > that it would otherwise take to load BASIC via RS-232.
        >
        > Anyways, I'm completely stumped as to why my very simple bootloader isn't
        > working correctly. The code can be found here: http://pastebin.com/jbrTHdnX
        >
        > It actually does copy the contents correctly, but fails to exit to the
        > monitor on time. The DEX instruction can only update the zero flag, so I am
        > fairly limited on branches. It should exit the loop as soon as the index
        > register is zero, but instead, it exits well after the index register
        > underflows.
        >
        > Any help would be much appreciated, as always. Thanks!
        >
        > Kyle
        >
      • joshbensadon
        Kyle, oh, I don t think DEX affects the flags...
        Message 3 of 9 , Jun 2, 2012
        View Source
        • 0 Attachment
          Kyle, oh, I don't think DEX affects the flags...

          --- In midatlanticretro@yahoogroups.com, Kyle Owen <kylevowen@...> wrote:
          >
          > Hi guys,
          >
          > So I recently copied 8k BASIC to (4) 2kB EEPROMs in hopes that I could make
          > a bootloader to copy the contents into RAM, eliminating the 5 minutes or so
          > that it would otherwise take to load BASIC via RS-232.
          >
          > Anyways, I'm completely stumped as to why my very simple bootloader isn't
          > working correctly. The code can be found here: http://pastebin.com/jbrTHdnX
          >
          > It actually does copy the contents correctly, but fails to exit to the
          > monitor on time. The DEX instruction can only update the zero flag, so I am
          > fairly limited on branches. It should exit the loop as soon as the index
          > register is zero, but instead, it exits well after the index register
          > underflows.
          >
          > Any help would be much appreciated, as always. Thanks!
          >
          > Kyle
          >
        • joshbensadon
          Kyle, come to think of it, I think there s a CPX instruction to compare X with immediate, so you can affect the flags.
          Message 4 of 9 , Jun 2, 2012
          View Source
          • 0 Attachment
            Kyle, come to think of it, I think there's a CPX instruction to compare X with immediate, so you can affect the flags.

            --- In midatlanticretro@yahoogroups.com, joshbensadon <no_reply@...> wrote:
            >
            > Kyle, oh, I don't think DEX affects the flags...
            >
            > --- In midatlanticretro@yahoogroups.com, Kyle Owen <kylevowen@> wrote:
            > >
            > > Hi guys,
            > >
            > > So I recently copied 8k BASIC to (4) 2kB EEPROMs in hopes that I could make
            > > a bootloader to copy the contents into RAM, eliminating the 5 minutes or so
            > > that it would otherwise take to load BASIC via RS-232.
            > >
            > > Anyways, I'm completely stumped as to why my very simple bootloader isn't
            > > working correctly. The code can be found here: http://pastebin.com/jbrTHdnX
            > >
            > > It actually does copy the contents correctly, but fails to exit to the
            > > monitor on time. The DEX instruction can only update the zero flag, so I am
            > > fairly limited on branches. It should exit the loop as soon as the index
            > > register is zero, but instead, it exits well after the index register
            > > underflows.
            > >
            > > Any help would be much appreciated, as always. Thanks!
            > >
            > > Kyle
            > >
            >
          • Kyle Owen
            The code is 6800 (for my SWTPC 6800, in fact). I failed to include that in my original email, duh! Sorry about that. PSHA will push the contents of accumulator
            Message 5 of 9 , Jun 2, 2012
            View Source
            • 0 Attachment
              The code is 6800 (for my SWTPC 6800, in fact). I failed to include that in my original email, duh! Sorry about that.

              PSHA will push the contents of accumulator A onto the stack and will then decrease the SP by one. PULA will increase the SP by one and pull the byte at the SP into accumulator A. Yeah, I got confused somewhere in there.

              DEX in the 6800 will only affect the zero flag, no others. I'm quite sure of that. The other decrement operands (DEC, DECA, DECB) will affect the negative, zero and overflow flags, however. 

              My latest (working, even!) version is indeed using CPX. In fact, here's the code: http://pastebin.com/VQFsPFqH

              73,

              Kyle

              On Sat, Jun 2, 2012 at 7:06 PM, joshbensadon <no_reply@yahoogroups.com> wrote:
               

              Hi Kyle,

              I might be a little confused so excuse me if I'm in left field.

              Looking at your code, it looks like Z80 right?
              Doesn't the PUSH put 2 bytes on the stack? Accumulator and PSW??
              Further, the PUSH decrements the places the data.
              So, you should load the stack pointer with RAMEND+1 and after every push, you should INX SP.



              --- In midatlanticretro@yahoogroups.com, Kyle Owen <kylevowen@...> wrote:
              >
              > Hi guys,
              >
              > So I recently copied 8k BASIC to (4) 2kB EEPROMs in hopes that I could make
              > a bootloader to copy the contents into RAM, eliminating the 5 minutes or so
              > that it would otherwise take to load BASIC via RS-232.
              >
              > Anyways, I'm completely stumped as to why my very simple bootloader isn't
              > working correctly. The code can be found here: http://pastebin.com/jbrTHdnX
              >
              > It actually does copy the contents correctly, but fails to exit to the
              > monitor on time. The DEX instruction can only update the zero flag, so I am
              > fairly limited on branches. It should exit the loop as soon as the index
              > register is zero, but instead, it exits well after the index register
              > underflows.
              >
              > Any help would be much appreciated, as always. Thanks!
              >
              > Kyle
              >


            • joshbensadon
              Well, there you go, I guessed Z80 code... boy was I ever out in left field! I was thinking it was for your North Star. Hey, talking about SWTPC, there s one
              Message 6 of 9 , Jun 2, 2012
              View Source
              • 0 Attachment
                Well, there you go, I guessed Z80 code... boy was I ever out in left field! I was thinking it was for your North Star.

                Hey, talking about SWTPC, there's one for sale on Ebay right now, but sale is not the word for it, they want near 4G's for it!
                It looks like it has three 3-1/2" drives on the right side?
                Can you explain that?



                --- In midatlanticretro@yahoogroups.com, Kyle Owen <kylevowen@...> wrote:
                >
                > The code is 6800 (for my SWTPC 6800, in fact). I failed to include that in
                > my original email, duh! Sorry about that.
                >
                > PSHA will push the contents of accumulator A onto the stack and will then
                > decrease the SP by one. PULA will increase the SP by one and pull the byte
                > at the SP into accumulator A. Yeah, I got confused somewhere in there.
                >
                > DEX in the 6800 will only affect the zero flag, no others. I'm quite sure
                > of that. The other decrement operands (DEC, DECA, DECB) will affect the
                > negative, zero and overflow flags, however.
                >
                > My latest (working, even!) version is indeed using CPX. In fact, here's the
                > code: http://pastebin.com/VQFsPFqH
                >
                > 73,
                >
                > Kyle
                >
                > On Sat, Jun 2, 2012 at 7:06 PM, joshbensadon <no_reply@yahoogroups.com>wrote:
                >
                > > **
                > >
                > >
                > > Hi Kyle,
                > >
                > > I might be a little confused so excuse me if I'm in left field.
                > >
                > > Looking at your code, it looks like Z80 right?
                > > Doesn't the PUSH put 2 bytes on the stack? Accumulator and PSW??
                > > Further, the PUSH decrements the places the data.
                > > So, you should load the stack pointer with RAMEND+1 and after every push,
                > > you should INX SP.
                > >
                > >
                > > --- In midatlanticretro@yahoogroups.com, Kyle Owen <kylevowen@> wrote:
                > > >
                > > > Hi guys,
                > > >
                > > > So I recently copied 8k BASIC to (4) 2kB EEPROMs in hopes that I could
                > > make
                > > > a bootloader to copy the contents into RAM, eliminating the 5 minutes or
                > > so
                > > > that it would otherwise take to load BASIC via RS-232.
                > > >
                > > > Anyways, I'm completely stumped as to why my very simple bootloader isn't
                > > > working correctly. The code can be found here:
                > > http://pastebin.com/jbrTHdnX
                > > >
                > > > It actually does copy the contents correctly, but fails to exit to the
                > > > monitor on time. The DEX instruction can only update the zero flag, so I
                > > am
                > > > fairly limited on branches. It should exit the loop as soon as the index
                > > > register is zero, but instead, it exits well after the index register
                > > > underflows.
                > > >
                > > > Any help would be much appreciated, as always. Thanks!
                > > >
                > > > Kyle
                > > >
                > >
                > >
                > >
                >
              • Kyle Owen
                Yeah, that particular machine has been listed...over and over and over! Which is no surprise, of course, judging by the price tag. I think it s just a very
                Message 7 of 9 , Jun 2, 2012
                View Source
                • 0 Attachment
                  Yeah, that particular machine has been listed...over and over and over! Which is no surprise, of course, judging by the price tag. I think it's just a very heavily modified 6800. Too modified for most of the purists out there, I guess. There was a 6800 that just recently sold for almost $800. Item number 150817895881. That is more than I expected it to go for, in fact, as maybe 6 months ago, a complete system sold for only $600 or so. I guess they're getting more desirable. 

                  Kyle

                  On Sat, Jun 2, 2012 at 9:12 PM, joshbensadon <no_reply@yahoogroups.com> wrote:
                   

                  Well, there you go, I guessed Z80 code... boy was I ever out in left field! I was thinking it was for your North Star.

                  Hey, talking about SWTPC, there's one for sale on Ebay right now, but sale is not the word for it, they want near 4G's for it!
                  It looks like it has three 3-1/2" drives on the right side?
                  Can you explain that?



                  --- In midatlanticretro@yahoogroups.com, Kyle Owen <kylevowen@...> wrote:
                  >
                  > The code is 6800 (for my SWTPC 6800, in fact). I failed to include that in
                  > my original email, duh! Sorry about that.
                  >
                  > PSHA will push the contents of accumulator A onto the stack and will then
                  > decrease the SP by one. PULA will increase the SP by one and pull the byte
                  > at the SP into accumulator A. Yeah, I got confused somewhere in there.
                  >
                  > DEX in the 6800 will only affect the zero flag, no others. I'm quite sure
                  > of that. The other decrement operands (DEC, DECA, DECB) will affect the
                  > negative, zero and overflow flags, however.
                  >
                  > My latest (working, even!) version is indeed using CPX. In fact, here's the
                  > code: http://pastebin.com/VQFsPFqH
                  >
                  > 73,
                  >
                  > Kyle
                  >
                  > On Sat, Jun 2, 2012 at 7:06 PM, joshbensadon <no_reply@yahoogroups.com>wrote:
                  >
                  > > **

                  > >
                  > >
                  > > Hi Kyle,
                  > >
                  > > I might be a little confused so excuse me if I'm in left field.
                  > >
                  > > Looking at your code, it looks like Z80 right?
                  > > Doesn't the PUSH put 2 bytes on the stack? Accumulator and PSW??
                  > > Further, the PUSH decrements the places the data.
                  > > So, you should load the stack pointer with RAMEND+1 and after every push,
                  > > you should INX SP.
                  > >
                  > >
                  > > --- In midatlanticretro@yahoogroups.com, Kyle Owen <kylevowen@> wrote:
                  > > >
                  > > > Hi guys,
                  > > >
                  > > > So I recently copied 8k BASIC to (4) 2kB EEPROMs in hopes that I could
                  > > make
                  > > > a bootloader to copy the contents into RAM, eliminating the 5 minutes or
                  > > so
                  > > > that it would otherwise take to load BASIC via RS-232.
                  > > >
                  > > > Anyways, I'm completely stumped as to why my very simple bootloader isn't
                  > > > working correctly. The code can be found here:
                  > > http://pastebin.com/jbrTHdnX
                  > > >
                  > > > It actually does copy the contents correctly, but fails to exit to the
                  > > > monitor on time. The DEX instruction can only update the zero flag, so I
                  > > am
                  > > > fairly limited on branches. It should exit the loop as soon as the index
                  > > > register is zero, but instead, it exits well after the index register
                  > > > underflows.
                  > > >
                  > > > Any help would be much appreciated, as always. Thanks!
                  > > >
                  > > > Kyle
                  > > >
                  > >
                  > >
                  > >
                  >


                • joshbensadon
                  I didn t see that $800 SWTPC, I guess my search is limited to what s available to Canada. But that is closer to a fair price compared to $3,800. And that
                  Message 8 of 9 , Jun 2, 2012
                  View Source
                  • 0 Attachment
                    I didn't see that $800 SWTPC, I guess my search is limited to what's available to Canada. But that is closer to a fair price compared to $3,800. And that $3,800 machine is worth closer to $200 imho, since it's modified. I certainly wouldn't buy it, not even at $200.

                    I'm currently looking for a PET 2001... they are some around but non available to Canada. sigh


                    --- In midatlanticretro@yahoogroups.com, Kyle Owen <kylevowen@...> wrote:
                    >
                    > Yeah, that particular machine has been listed...over and over and over!
                    > Which is no surprise, of course, judging by the price tag. I think it's
                    > just a very heavily modified 6800. Too modified for most of the purists out
                    > there, I guess. There was a 6800 that just recently sold for almost $800.
                    > Item number 150817895881. That is more than I expected it to go for, in
                    > fact, as maybe 6 months ago, a complete system sold for only $600 or so. I
                    > guess they're getting more desirable.
                    >
                    > Kyle
                    >
                    > On Sat, Jun 2, 2012 at 9:12 PM, joshbensadon <no_reply@yahoogroups.com>wrote:
                    >
                    > > **
                    > >
                    > >
                    > > Well, there you go, I guessed Z80 code... boy was I ever out in left
                    > > field! I was thinking it was for your North Star.
                    > >
                    > > Hey, talking about SWTPC, there's one for sale on Ebay right now, but sale
                    > > is not the word for it, they want near 4G's for it!
                    > > It looks like it has three 3-1/2" drives on the right side?
                    > > Can you explain that?
                    > >
                    > >
                    > > --- In midatlanticretro@yahoogroups.com, Kyle Owen <kylevowen@> wrote:
                    > > >
                    > > > The code is 6800 (for my SWTPC 6800, in fact). I failed to include that
                    > > in
                    > > > my original email, duh! Sorry about that.
                    > > >
                    > > > PSHA will push the contents of accumulator A onto the stack and will then
                    > > > decrease the SP by one. PULA will increase the SP by one and pull the
                    > > byte
                    > > > at the SP into accumulator A. Yeah, I got confused somewhere in there.
                    > > >
                    > > > DEX in the 6800 will only affect the zero flag, no others. I'm quite sure
                    > > > of that. The other decrement operands (DEC, DECA, DECB) will affect the
                    > > > negative, zero and overflow flags, however.
                    > > >
                    > > > My latest (working, even!) version is indeed using CPX. In fact, here's
                    > > the
                    > > > code: http://pastebin.com/VQFsPFqH
                    > > >
                    > > > 73,
                    > > >
                    > > > Kyle
                    > > >
                    > > > On Sat, Jun 2, 2012 at 7:06 PM, joshbensadon <no_reply@yahoogroups.com
                    > > >wrote:
                    > > >
                    > > > > **
                    > >
                    > > > >
                    > > > >
                    > > > > Hi Kyle,
                    > > > >
                    > > > > I might be a little confused so excuse me if I'm in left field.
                    > > > >
                    > > > > Looking at your code, it looks like Z80 right?
                    > > > > Doesn't the PUSH put 2 bytes on the stack? Accumulator and PSW??
                    > > > > Further, the PUSH decrements the places the data.
                    > > > > So, you should load the stack pointer with RAMEND+1 and after every
                    > > push,
                    > > > > you should INX SP.
                    > > > >
                    > > > >
                    > > > > --- In midatlanticretro@yahoogroups.com, Kyle Owen <kylevowen@> wrote:
                    > > > > >
                    > > > > > Hi guys,
                    > > > > >
                    > > > > > So I recently copied 8k BASIC to (4) 2kB EEPROMs in hopes that I
                    > > could
                    > > > > make
                    > > > > > a bootloader to copy the contents into RAM, eliminating the 5
                    > > minutes or
                    > > > > so
                    > > > > > that it would otherwise take to load BASIC via RS-232.
                    > > > > >
                    > > > > > Anyways, I'm completely stumped as to why my very simple bootloader
                    > > isn't
                    > > > > > working correctly. The code can be found here:
                    > > > > http://pastebin.com/jbrTHdnX
                    > > > > >
                    > > > > > It actually does copy the contents correctly, but fails to exit to
                    > > the
                    > > > > > monitor on time. The DEX instruction can only update the zero flag,
                    > > so I
                    > > > > am
                    > > > > > fairly limited on branches. It should exit the loop as soon as the
                    > > index
                    > > > > > register is zero, but instead, it exits well after the index register
                    > > > > > underflows.
                    > > > > >
                    > > > > > Any help would be much appreciated, as always. Thanks!
                    > > > > >
                    > > > > > Kyle
                    > > > > >
                    > > > >
                    > > > >
                    > > > >
                    > > >
                    > >
                    > >
                    > >
                    >
                  • s100doctor
                    ... Kyle, I m not a 6800 programmer, mostly I m an 8080 programmer. But why use push instructions rather than move and increment instructions, which may
                    Message 9 of 9 , Jun 9, 2012
                    View Source
                    • 0 Attachment
                      joshbensadon <no_reply@...> wrote:
                      >
                      > Kyle, come to think of it, I think there's a CPX instruction to compare X with immediate, so you can affect the flags.
                      >
                      > > Kyle, oh, I don't think DEX affects the flags...
                      > >

                      Kyle, I'm not a 6800 programmer, mostly I'm an 8080 programmer. But why use "push" instructions rather than "move" and "increment" instructions, which may have more explicit effects? If this bit of code is not understandable - it doesn't do what you expect - then rewrite it with more understandable 6800 instructions. That's some general advice, rather than specific debugging suggestions which I can't provide short of my looking up the effects of each instruction in your program.

                      Herb
                    Your message has been successfully submitted and would be delivered to recipients shortly.