Howdy, Stranger!

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

Categories

divide in BCD code

oferofer Member Posts: 47
The program has two arrays (num1, num2) of about 20 bytes.
each of them represent anumber in BCD code.
I need to write the result of num1/num2 into num3,
using simple commands like mov, add, sub, mul, div.
PLASE!!! help me.

Comments

  • OverflowOverflow Member Posts: 12
    maaaaaan,
    i did that long time ago. I really don't remmber if there was a direct way to do it. But you can certainly use 1 procedure to convert those BCD numbers to Binary numbers and then do ur operations on them!

  • mayank28_80mayank28_80 Member Posts: 22
    : The program has two arrays (num1, num2) of about 20 bytes.
    : each of them represent anumber in BCD code.
    : I need to write the result of num1/num2 into num3,
    : using simple commands like mov, add, sub, mul, div.
    : PLASE!!! help me.
    :

    well u can cwd num1 and cwd num2
    now mov ax,num1
    now div num2
    now mov num3,ax

    so quotient is in num3 but for sake of remainder mov dx to some other var say num4

    happy coding
    mayank28_80


  • MainForzeMainForze Member Posts: 36
    OK, this might seem stupid, but... WHAT THE HECK ARE BCD-CODES?!?!!?

    :-) MainForze :-)

  • OverflowOverflow Member Posts: 12
    : OK, this might seem stupid, but... WHAT THE HECK ARE BCD-CODES?!?!!?
    :
    : :-) MainForze :-)
    :

    Binary Coded in Decimal

    when you enter 123 to the machine it doesnt understand the number 123; rather it elaborates it as the ASCII of 1,2 & 3

    in Assembly, where no INT type is defined. You should be able to work on this type which is in fact regualr characters but you change it to INT to work with numbers!

    Cheers!


Sign In or Register to comment.