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

Re: [Tomy Tutor ] Anyone know how the BASIC ROM works?

Expand Messages
  • Neil Morrison
    Study books on the TRS-80 Basic Rom. Those guys figured out a lot of how MSoft Basic works, which includes stuff like jumping into the middle of instructions
    Message 1 of 4 , Apr 16, 2003
    • 0 Attachment
      Study books on the TRS-80 Basic Rom. Those guys figured out a lot of
      how MSoft Basic works, which includes stuff like jumping into the
      middle of instructions to save a byte.

      Neil

      ----- Original Message -----
      From: "spirantho" <IanG@...>


      > Assuming the ROM dump I have is correct (and it seems ok), there is
      a
      > routine which takes commands from R11 (the program counter after
      > calling the routine in other words) and then parameters if
      necessary
      > from after that. The routine then appears to do various things
      > according to the command before looping back round again. The loop
      > appears to be begin at >5380.
      >
      > The problem is the "command" with the value F322 - it seems
      invalid,
      > but it appears in a place which looks good (directly after a valid
      > command) and is repeated with a different operand. The problem is
      that
      > the routine takes a jump address from the (command & >01e0) >> 5
      added
      > to a lookup table at >584c. This would be great but F322 & 01E0 =
      0110
      > and 0110 >> 5 is 3 - which is ODD! Not surprisingly this jumps
      > merrily into the location straddling two routines in the lookup
      table,
      > and gets lost by jumping to >6855.
    • spirantho
      ... Hmm.. I might take a look but the problem is a lot more focussed than trying to understand the whole BASIC. Essentially I have what seems clearly right
      Message 2 of 4 , Apr 17, 2003
      • 0 Attachment
        --- In tomytutor@yahoogroups.com, "Neil Morrison" <neilsmorr@h...>
        wrote:


        >


        > Study books on the TRS-80 Basic Rom. Those guys figured out a lot of


        > how MSoft Basic works, which includes stuff like jumping into the


        > middle of instructions to save a byte.




        Hmm.. I might take a look but the problem is a lot more focussed than
        trying to understand the whole BASIC. Essentially I have what seems
        clearly right resulting in something clearly wrong. Very strange.


        Jumping into an instruction makes sense in Z80, by the way - you can
        have, for instance




        DD212301 means LD IX, (0123) or something (off the top of my head) and


        212301 means LD HL, (0123).




        However, the TMS9995 is a 16-bit CPU so jumping to the middle of a
        word will just nuke the machine completely. AFAIK even reading on an
        odd boundary will confuse the machine no end, which is how I can be
        sure it's not right.




        Very frustrating, this - it all seems to work fine except this problem
        deep into the BASIC initialiser.


        Incidentally, am I correct in thinking the second ROM is in locations
        >8000 onwards? There seem to be references within that block to that
        area of memory. I wish I knew why the ROM keeps trying to write to
        location >8000, though - maybe a RAM expansion test...?




        If nothing else I have the only Tomy Tutor graphics editor emulator in
        the world! (emulator, not simulator!)
      • Neil Morrison
        ... From: spirantho ... than ... seems ... can ... and ... an ... That s certainly true for the 68000. I just wanted to make the point
        Message 3 of 4 , Apr 17, 2003
        • 0 Attachment
          ----- Original Message -----
          From: "spirantho" <IanG@...>

          > Hmm.. I might take a look but the problem is a lot more focussed
          than
          > trying to understand the whole BASIC. Essentially I have what
          seems
          > clearly right resulting in something clearly wrong. Very strange.
          >
          > Jumping into an instruction makes sense in Z80, by the way - you
          can
          > have, for instance
          > DD212301 means LD IX, (0123) or something (off the top of my head)
          and
          > 212301 means LD HL, (0123).
          > However, the TMS9995 is a 16-bit CPU so jumping to the middle of a
          > word will just nuke the machine completely. AFAIK even reading on
          an
          > odd boundary will confuse the machine no end, which is how I can be
          > sure it's not right.

          That's certainly true for the 68000. I just wanted to make the point
          that Microsoft (and I assume that's whose basic it is) are likely to
          do dirty tricks like that. You have to have your mind open to all
          sorts of possibilities. I remember the story of one programmer who
          wrote stuff on an old mainframe that relied on counting instruction
          cycles and matching them to the rotational speed of the drum memory.
          Obviously the Tomy works, the question is how?


          Regards,

          Neil

          http://coco_docs.tripod.com/

          http://mymc10.tripod.com/

          http://groups.yahoo.com/group/ColorComputer

          http://groups.yahoo.com/group/TRS-80

          http://groups.yahoo.com/group/PocketComp
        • emucompboy
          It may be that writing those locations will either bank switch (a la Commodore 64), or activate a pre-stored bank switched configuration (a la Commodore 128).
          Message 4 of 4 , Apr 21, 2003
          • 0 Attachment
            It may be that writing those locations will either bank switch (a la
            Commodore 64), or activate a pre-stored bank switched configuration
            (a la Commodore 128).

            I'd bet that the BASIC ROM is at least partly bank-switched.



            --- In tomytutor@yahoogroups.com, "spirantho" <IanG@a...> wrote:

            > Incidentally, am I correct in thinking the second ROM is in
            locations
            > >8000 onwards? There seem to be references within that block to
            that
            > area of memory. I wish I knew why the ROM keeps trying to write to
            > location >8000, though - maybe a RAM expansion test...?
          Your message has been successfully submitted and would be delivered to recipients shortly.