68HC11 Code for For-loop

Sort of new to 68HC11 code and I'm trying to figure out how to code a simple for-loop that does a simple task such as:

int Y = 0;
for( int x = 1; x < 50; x++)
{
Y = Y + 1;
}

Can anyone help?

Thanks,
John

Comments

  • : Sort of new to 68HC11 code and I'm trying to figure out how to code a simple for-loop that does a simple task such as:
    :
    : int Y = 0;
    : for( int x = 1; x < 50; x++)
    : {
    : Y = Y + 1;
    : }
    :
    : Can anyone help?
    :
    : Thanks,
    : John
    :

    i send to you a simple solution using x and y but you can do it with a and b.

    init ldy #0
    loop ldx #1
    loop0 cpx #50
    beq loop1
    inx
    bra loop0
    loop1 iny
    ...
    bra loop
    Bye,
    Mnemozip




  • : Sort of new to 68HC11 code and I'm trying to figure out how to code a simple for-loop that does a simple task such as:
    :
    : int Y = 0;
    : for( int x = 1; x < 50; x++)
    : {
    : Y = Y + 1;
    : }
    :
    : Can anyone help?
    :
    : Thanks,
    : John
    :

    i send to you a simple solution using x and y but you can do it with a and b.

    init ldy #0
    loop ldx #1
    loop0 cpx #50
    beq loop1
    inx
    bra loop0
    loop1 iny
    ...
    bra loop
    Bye,
    Mnemozip




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion