CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2012
    Posts
    3

    68hc11 programming

    Hi all, I recently started taking a course called microprocessors and it involves a lot of programming, which is a new field for me. As you've guessed, it's pretty tough and I can't seem to get my head around the logic. We currently use hexadecimal notations to write our programs and the textbook I'm using is not comprehensive enough for me.
    I have a few questions due next week that I'm working on. We are asked to write a program that transfers 400bytes of memory from $C000 to $D000. This is what I've been able to come up with but it's not working as intended.

    LDX #0X3000
    LDY #0X4000
    LDAB 0190
    LOOP:
    LDAA 0X00,X
    STAA 0X00,Y
    INX
    INY
    CPX 0190
    BNE LOOP
    BRA

    so, I've been told that this will only count to 256 instead of 400. I've tried to do some research and there isn't any material out there that does it justice. Any help will be appreciated.

  2. #2
    Join Date
    Feb 2002
    Posts
    4,640

    Re: 68hc11 programming

    This is really assembly language programming (specifically, the assembly that the 68hc11 supports). While the X and Y registers are 16 bits wide, you might want to check how the CPX instruction works. I haven't had to work with this in a LOOOONNNNGGGG time, but my bet is that it's related to this instruction. Or the increment instruction(s).

    I would assume you have a reference book on the instruction set?

    Viggy

  3. #3
    Join Date
    Jan 2012
    Posts
    3

    Re: 68hc11 programming

    I do have a reference manual and I think it should be CMPB instead of CPX. My new build looks like this:

    LDX 0X3000
    LDY 0X4000
    LDAB #0X0190
    LOOP:
    LDAA 0X00,X
    STAA 0X00,Y
    INX
    INY
    DECB
    CMPB
    BNE LOOP
    BRA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured