Howdy, Stranger!

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

Categories

how to check a memory byte if the value is multiple of ten?

hi,
I want to check a number in a memory if it is multiple of ten or not? how can i do that? thanks...

Comments

  • korkor Member Posts: 198
    : hi,
    : I want to check a number in a memory if it is multiple of ten or not? how can i do that? thanks...
    :
    :
    On which processor? Which assembler? got docs? just want theory, or actual code?
  • phantom_okanphantom_okan Member Posts: 4
    on 68hc11 and I only need theory... what should I do? a 1 byte number...
  • rollerolle Member Posts: 115
    : on 68hc11 and I only need theory... what should I do? a 1 byte number...
    :
    [green]1. Copy the byte into another byte to work with.
    2. Divide copy by 10, throw away any remainder.
    3. Multiply copy by 10.
    4. Compare copy and original.[/green]
  • blipblip Member Posts: 756
    Or just do steps 1 and 2 and if the remainder is zero, it is a mulitple of ten.

    : [green]1. Copy the byte into another byte to work with.
    : 2. Divide copy by 10, throw away any remainder.
    : 3. Multiply copy by 10.
    : 4. Compare copy and original.[/green]
    :

Sign In or Register to comment.