sample program format for map manual completion

Upload: ubaid-saudagar

Post on 27-Feb-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 Sample Program format for MAP manual completion

    1/2

    Computer Department Quality Manual A R Kalsekar Polytechnic

    9| P a g e b y U b a i d S a u d a g a r

    Program No. 2a

    Write an assembly language program to add two 16 bit numbers

    Refer: prog2a.asm

    Tools: Turbo Assembler (TASM) 1.4

    Program:

    assume cs : code

    assume ds : data

    data segment

    a dw 1191h

    b dw 2272h

    sum dw ?

    data ends

    code segment

    start:

    mov ax,data

    mov ds,ax

    mov ax,0000h

    mov ax,a

    mov bx,b

    add ax,bx

    mov sum,ax

    int 3

    code ends

    end start

  • 7/25/2019 Sample Program format for MAP manual completion

    2/2

    Computer Department Quality Manual A R Kalsekar Polytechnic

    10| P a g e b y U b a i d S a u d a g a r

    Observation:

    Conclusion:

    We observe that after adding the two 16 bit numbers, the result is stored in the

    AX register which is the destination register which is also of 16 bits.

    Since result is not generating carry, the carry flag is in reset state i.e. C=0.

    When the 16 bit result is stored in the memory, it will be stored as 03 34, this is

    because the lower byte of the AX register gets stored first and then the higher

    byte.