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

Re: Syntax variations between assemblers

Expand Messages
  • bill_rowe_ottawa
    So for store, maybe the line store: db 0 is the simplest approach. The org $ at the end is odd - I could speculate but if it were me I d just comment it out
    Message 1 of 9 , Oct 21, 2008
    • 0 Attachment
      So for store, maybe the line "store: db 0" is the simplest approach.
      The org $ at the end is odd - I could speculate but if it were me I'd
      just comment it out for now.

      for the ldi of the top part of the address i'd try "ldi store/256".
      the bottom part would be just "ldi store".

      There is a risk that you're going to end up with a syntactically
      correct program but incorrect code. Does the original listing show
      the object code for you to compare it to? If not, consider posting
      your resulting listing or mail it to me and i'll have a look.
      --- In cosmacelf@yahoogroups.com, "john_apw" <infomagician@...> wrote:
      >
      > Hi Bill,
      >
      > Thanks for the inquiry.
      >
      > The original line:
      > STORE: ORG *
      >
      > is the last line before the END instruction. There are no other
      > storage bytes, just the last lines of code.
      >
      > From a reading of the listing, STORE: serves as a single byte
      storage
      > location.
      >
      > There is no ORG at the beginning of the listing, so I'd conclude
      that
      > there is an implied origin of 0000 (I've verified this...)
      >
      > I was pretty sure the * represents the current value of the program
      > counter. Turns out I had to change the * to a $
      >
      > STORE: EQU $
      > ORG $
      > END
      >
      > asw now gets through to Pass2, so I know it's OK.
      >
      > However, I don't understand the purpose of the ORG * at the end. I
      > agree that the usage is odd... But I think I've gotten past that
      > problem.
      >
      > =====================
      >
      > A new wrinkle: now that I can get through to Pass2, my change from
      > LDI A.1 (STORE)
      > to
      > LDI STORE.1
      > is generating "undefined symbol" errors.
      >
      > I'm not sure how to tell the assembler to reference only the upper
      or
      > lower 8-bit byte of the address of the label, and not the whole 16
      > bits.
      >
      > Any hints?
      >
      > -JohnM
      >
      >
      > --- In cosmacelf@yahoogroups.com, "bill_rowe_ottawa" <bill_rowe@>
      > wrote:
      > >
      > > maybe take it from the angle of "what is STORE supposed to do
      and
      > > how do i code that?". it looks like it's supposed to be a label
      > for
      > > a block of memory, maybe the stack or something. is there an area
      > of
      > > non-code just before it? DB's or DW's or something? Just make
      it
      > a
      > > label and see what happens. What error messages do you get?
      > >
      > > The only other thought I have is just odd: Some assemblers have a
      > > construct at the end that says where execution starts.
      >
      >
      >
      >
      >
      > > --- In cosmacelf@yahoogroups.com, "john_apw" <infomagician@>
      wrote:
      > > >
      > > > It's been years since I've done any assembly-language
      > programming,
      > > so
      > > > I'm not completely ignorant, I just need some "re-education".
      > > >
      > > > As I've been trying to re-learn, I used "Macro Assembler AS
      > V1.42"
      > > to
      > > > assemble code from the original RCA 1800 "User Manual for the
      > > CDP1802
      > > > COSMAC Microprocessor".
      > > >
      > > > I found some variations between the syntax in assembly listings
      > > > versus syntax the assembler recognizes. For example, listings
      > that
      > > > indicate comments with two dots instead of a semicolon... Such
      > > > superficial changes are easy to recognize and edit.
      > > >
      > > >
      > > > But the one that's got me is this:
      > > >
      > > > At the end of the listing is this line:
      > > > STORE ORG *
      > > >
      > > > So I figured out how to change lines at the begining of the
      > listing
      > > > from:
      > > > REQ
      > > > LDI A.1 (STORE)
      > > > PHI R2
      > > > GO: LDI A.0 (STORE)
      > > > PLO R2
      > > >
      > > > to:
      > > > REQ
      > > > LDI STORE.1
      > > > PHI R2
      > > > GO: LDI STORE.0
      > > > PLO R2
      > > >
      > > > But I haven't been able to fix that line at the end of the
      > listing.
      > > >
      > > > I tried variations of this:
      > > > STORE EQU *
      > > > ORG *
      > > >
      > > > but I continue to get errors...
      > > >
      > > > Can anyone shed some light on this for me?
      > > >
      > > > Thanks!
      > > > -JohnM
      > > >
      > >
      >
    • rileym65
      What assembler are you using? Mike
      Message 2 of 9 , Oct 21, 2008
      • 0 Attachment
        What assembler are you using?
        Mike


        > =====================
        >
        > A new wrinkle: now that I can get through to Pass2, my change from
        > LDI A.1 (STORE)
        > to
        > LDI STORE.1
        > is generating "undefined symbol" errors.
        >
        > I'm not sure how to tell the assembler to reference only the upper or
        > lower 8-bit byte of the address of the label, and not the whole 16
        > bits.
        >
        > Any hints?
        >
        > -JohnM
      • rileym65
        In Rc/Asm, these are all valid ways to do it: STORE: EQU $ LDI STORE.1 LDI (STORE).1 LDI HIGH STORE LDI STORE.0 LDI (STORE).0 LDI
        Message 3 of 9 , Oct 21, 2008
        • 0 Attachment
          In Rc/Asm, these are all valid ways to do it:

          STORE: EQU $
          LDI STORE.1
          LDI (STORE).1
          LDI HIGH STORE

          LDI STORE.0
          LDI (STORE).0
          LDI LOW STORE

          other assemblers may support any of these methods but not necesarily
          all of them.

          Mike

          --- In cosmacelf@yahoogroups.com, rileym65 <no_reply@...> wrote:
          >
          > What assembler are you using?
          > Mike
          >
          >
          > > =====================
          > >
          > > A new wrinkle: now that I can get through to Pass2, my change from
          > > LDI A.1 (STORE)
          > > to
          > > LDI STORE.1
          > > is generating "undefined symbol" errors.
          > >
          > > I'm not sure how to tell the assembler to reference only the upper or
          > > lower 8-bit byte of the address of the label, and not the whole 16
          > > bits.
          > >
          > > Any hints?
          > >
          > > -JohnM
          >
        • Richard
          this would be the equivilate STORE: DB 0 It just set this byte aside for usage, the only difference here would be it is now has a predefined start value. ...
          Message 4 of 9 , Oct 22, 2008
          • 0 Attachment
            this would be the equivilate

            STORE: DB 0

            It just set this byte aside for usage, the only difference here would be it
            is now has a predefined start value.


            ----- Original Message -----
            From: "john_apw" <infomagician@...>
            To: <cosmacelf@yahoogroups.com>
            Sent: Monday, October 20, 2008 10:03 PM
            Subject: [cosmacelf] Re: Syntax variations between assemblers


            > Hi Bill,
            >
            > Thanks for the inquiry.
            >
            > The original line:
            > STORE: ORG *
            >
            > is the last line before the END instruction. There are no other
            > storage bytes, just the last lines of code.
            >
            > From a reading of the listing, STORE: serves as a single byte storage
            > location.
            >
            > There is no ORG at the beginning of the listing, so I'd conclude that
            > there is an implied origin of 0000 (I've verified this...)
            >
            > I was pretty sure the * represents the current value of the program
            > counter. Turns out I had to change the * to a $
            >
            > STORE: EQU $
            > ORG $
            > END
            >
            > asw now gets through to Pass2, so I know it's OK.
            >
            > However, I don't understand the purpose of the ORG * at the end. I
            > agree that the usage is odd... But I think I've gotten past that
            > problem.
            >
            > =====================
            >
            > A new wrinkle: now that I can get through to Pass2, my change from
            > LDI A.1 (STORE)
            > to
            > LDI STORE.1
            > is generating "undefined symbol" errors.
            >
            > I'm not sure how to tell the assembler to reference only the upper or
            > lower 8-bit byte of the address of the label, and not the whole 16
            > bits.
            >
            > Any hints?
            >
            > -JohnM
            >
            >
            > --- In cosmacelf@yahoogroups.com, "bill_rowe_ottawa" <bill_rowe@...>
            > wrote:
            > >
            > > maybe take it from the angle of "what is STORE supposed to do and
            > > how do i code that?". it looks like it's supposed to be a label
            > for
            > > a block of memory, maybe the stack or something. is there an area
            > of
            > > non-code just before it? DB's or DW's or something? Just make it
            > a
            > > label and see what happens. What error messages do you get?
            > >
            > > The only other thought I have is just odd: Some assemblers have a
            > > construct at the end that says where execution starts.
            >
            >
            >
            >
            >
            > > --- In cosmacelf@yahoogroups.com, "john_apw" <infomagician@> wrote:
            > > >
            > > > It's been years since I've done any assembly-language
            > programming,
            > > so
            > > > I'm not completely ignorant, I just need some "re-education".
            > > >
            > > > As I've been trying to re-learn, I used "Macro Assembler AS
            > V1.42"
            > > to
            > > > assemble code from the original RCA 1800 "User Manual for the
            > > CDP1802
            > > > COSMAC Microprocessor".
            > > >
            > > > I found some variations between the syntax in assembly listings
            > > > versus syntax the assembler recognizes. For example, listings
            > that
            > > > indicate comments with two dots instead of a semicolon... Such
            > > > superficial changes are easy to recognize and edit.
            > > >
            > > >
            > > > But the one that's got me is this:
            > > >
            > > > At the end of the listing is this line:
            > > > STORE ORG *
            > > >
            > > > So I figured out how to change lines at the begining of the
            > listing
            > > > from:
            > > > REQ
            > > > LDI A.1 (STORE)
            > > > PHI R2
            > > > GO: LDI A.0 (STORE)
            > > > PLO R2
            > > >
            > > > to:
            > > > REQ
            > > > LDI STORE.1
            > > > PHI R2
            > > > GO: LDI STORE.0
            > > > PLO R2
            > > >
            > > > But I haven't been able to fix that line at the end of the
            > listing.
            > > >
            > > > I tried variations of this:
            > > > STORE EQU *
            > > > ORG *
            > > >
            > > > but I continue to get errors...
            > > >
            > > > Can anyone shed some light on this for me?
            > > >
            > > > Thanks!
            > > > -JohnM
            > > >
            > >
            >
            >
            >
            > ------------------------------------
            >
            > ========================================================
            > Visit the COSMAC ELF website at http://www.cosmacelf.comYahoo! Groups
            Links
            >
            >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.