assembly help

Discussion in 'OT Technology' started by poopies4u, Oct 20, 2003.

  1. poopies4u

    poopies4u Active Member

    Joined:
    Nov 26, 2001
    Messages:
    49,122
    Likes Received:
    3
    Location:
    Baltimore, MD
    I have a test today and I was wondering if you guys could help me understand this a little better. I dont' know how he got this answer

    He's gonna give us an instruction and then have data and we need to find the the result

    example:
    [​IMG]
     
  2. crotchfruit

    crotchfruit Guest

    you have some crazy base notation going on there. i'm guessing that anything starting with a 0 is meant to be hex instead of decimal.

    in the first line, he's moving [DEC]25 into AX, and the "result" is [DEC]25 which is [HEX]19 (i.e. 0019)

    in the second line, AX=0032, or [HEX]32, which is [DEC]50 (in the result column.)

    i'm guessing that the "result" is just what the operation returned? so mov BX, AL will result with whatever AL is. and in the data you say that AL=03, so the result will be 03.
     
  3. poopies4u

    poopies4u Active Member

    Joined:
    Nov 26, 2001
    Messages:
    49,122
    Likes Received:
    3
    Location:
    Baltimore, MD
    prof. was just giving me examples
     
  4. poopies4u

    poopies4u Active Member

    Joined:
    Nov 26, 2001
    Messages:
    49,122
    Likes Received:
    3
    Location:
    Baltimore, MD
    [​IMG]


    does that look right?
     
  5. crotchfruit

    crotchfruit Guest

    looks right to me. 32h = 50. 19h = 25. and the previous value of num1 doesn't affect the result of the function, just like the previous value of BX did not affect the result of "mov BX, AL"
     
  6. poopies4u

    poopies4u Active Member

    Joined:
    Nov 26, 2001
    Messages:
    49,122
    Likes Received:
    3
    Location:
    Baltimore, MD
    he said he's gonna use add and sub statements too, how would I go about doing that. Would they both have to be hex or can you add hex into dec?
     
  7. crotchfruit

    crotchfruit Guest

    keep in mind that there is no "numerical" difference between hex and decimal... they are just ways of writing a number.

    you can add a hex number and a decimal number together. for example,

    10h + 4 = 20
    10h + 4 = 14h

    just be sure that they know which base you're using as your notation. people commonly use a 'h' after a hex number (and nothing after a decimal number.)

    also, the result of an add or sub is simply the number that results from the operation.

    for example:

    add AX, BX; AX = 10h, BX = 10h;

    the "result" is 20h; AX = 20h, BX = 10h.
     

Share This Page