Professional Documents
Culture Documents
N0:
EXPERIMENT-4
To perform 1. logical shift and rotate operations, 2. Conversion of packed BCD to unpacked
EQUIPMENT REQUIRED:
Theory :
PROCEDURE:
2. Then a command window is opened, then type cmd in the text box and press ok.
4. CD TASM
6. Write program using respective commands and save the program with .ASM extension and quit.
9. td filename //to debug the executable file and to see the RESULT of the operation.
PROGRAMS:
LOGICAL OPERATIONS:
AND:
ASSUME CS:CODE
CODE SEGMENT
START:
MOV AX,1439H
MOV BX,1234H
AND AX,BX
INT 03H
CODE ENDS
END START
END
OUTPUT:
BEFORE EXECUTION: c=0 z=0 s=0 o=0 p=0 a=0 i=1 d=0
AFTER EXECUTION: c=0 z=0 s=0 o=0 p=1 a=0 i=1 d=0
ax=1030 bx=1234 cx= 0000 dx=0000 si=0000 di =0000 bp=0000 sp=0000 ds=4E77
ASSUME CS:CODE
CODE SEGMENT
START:
MOV AX,1439H
MOV BX,1234H
OR AX,BX
INT 03H
CODE ENDS
END START
END
OUTPUT:
BEFORE EXECUTION: c=0 z=0 s=0 o=0 p=0 a=0 i=1 d=0
AFTER EXECUTION: c=0 z=0 s=0 o=0 p=0 a=0 i=1 d=0
ax=163D bx=1234 cx= 0000 dx=0000 si=0000 di =0000 bp=0000 sp=0000 ds=4E77
ASSUME CS:CODE
CODE SEGMENT
START:
MOV AX,1439H
NOT AX
INT 03H
CODE ENDS
END START
END
OUTPUT:
BEFORE EXECUTION: c=0 z=0 s=0 o=0 p=0 a=0 i=1 d=0
AFTER EXECUTION: c=0 z=0 s=0 o=0 p=0 a=0 i=1 d=0
ax=EBC6 bx=0000 cx= 0000 dx=0000 si=0000 di =0000 bp=0000 sp=0000 ds=4E77
ASSUME CS:CODE
CODE SEGMENT
START:
MOV AX,1439H
MOV BX,1234H
XOR AX,BX
INT 03H
CODE ENDS
END START
END
OUTPUT:
BEFORE EXECUTION: c=0 z=0 s=0 o=0 p=0 a=0 i=1 d=0
AFTER EXECUTION: c=0 z=0 s=0 o=0 p=0 a=0 i=1 d=0
ax=060D bx=1234 cx= 0000 dx=0000 si=0000 di =0000 bp=0000 sp=0000 ds=4E77 es=4E77
ss=4E87 cs= 4E87 ip=0008
SHIFT RIGHT:
ASSUME CS:CODE
CODE SEGMENT
START:
MOV AX,1439H
SHR AX,03H
INT 03H
CODE ENDS
END START
END
OUTPUT:
BEFORE EXECUTION: c=0 z=0 s=0 o=0 p=0 a=0 i=1 d=0
AFTER EXECUTION: c=0 z=0 s=0 o=0 p=1 a=0 i=1 d=0
ax=0287 bx=0000 cx= 0000 dx=0000 si=0000 di =0000 bp=0000 sp=0000 ds=4E77
ASSUME CS:CODE
CODE SEGMENT
START:
MOV AX,1439H
SHL AX,03H
INT 03H
CODE ENDS
END START
END
OUTPUT:
BEFORE EXECUTION: c=0 z=0 s=0 o=0 p=0 a=0 i=1 d=0
AFTER EXECUTION: c=0 z=0 s=1 o=1 p=0 a=0 i=1 d=0
ax=A1C8 bx=0000 cx= 0000 dx=0000 si=0000 di =0000 bp=0000 sp=0000 ds=4E77
ASSUME CS:CODE
CODE SEGMENT
START:
MOV AX,1439H
ROR AX,03H
INT 03H
CODE ENDS
END START
END
OUTPUT:
BEFORE EXECUTION: c=0 z=0 s=0 o=0 p=0 a=0 i=1 d=0
AFTER EXECUTION: c=0 z=0 s=0 o=0 p=0 a=0 i=1 d=0
ax=2287 bx=0000 cx= 0000 dx=0000 si=0000 di =0000 bp=0000 sp=0000 ds=4E77
CODE SEGMENT
START:
INT 03H
CODE ENDS
END START
END
OUTPUT:
BEFORE EXECUTION: c=0 z=0 s=0 o=0 p=0 a=0 i=1 d=0
AFTER EXECUTION: c=0 z=0 s=0 o=1 p=0 a=0 i=1 d=0
ax=A1C8 bx=0000 cx= 0000 dx=0000 si=0000 di =0000 bp=0000 sp=0000 ds=4E77
CODE SEGMENT
START:
INT 03H
CODE ENDS
END START
END
OUTPUT:
BEFORE EXECUTION: c=0 z=0 s=0 o=0 p=0 a=0 i=1 d=0
AFTER EXECUTION: c=0 z=0 s=0 o=l p=0 a=0 i=1 d=0
ax=4287 bx=0000 cx= 0000 dx=0000 si=0000 di =0000 bp=0000 sp=0000 ds=4E77
CODE SEGMENT
START:
INT 03H
CODE ENDS
END START
END
OUTPUT:
BEFORE EXECUTION: c=0 z=0 s=0 o=0 p=0 a=0 i=1 d=0
AFTER EXECUTION: c=0 z=0 s=0 o=l p=0 a=0 i=1 d=0
ax=A1C8 bx=0000 cx= 0000 dx=0000 si=0000 di =0000 bp=0000 sp=0000 ds=4E77
ASSUME CS:CODE
CODE SEGMENT
START:
MOV AL,56H
MOV AH,AL
SHR AH,04H
AND AX,0F0FH
INT 03H
CODE ENDS
END START
END
OUTPUT:
BEFORE EXECUTION: c=0 z=0 s=0 o=0 p=0 a=0 i=1 d=0
AFTER EXECUTION: c=0 z=0 s=0 o=0 p=1 a=0 i=1 d=0
ax=0506 bx=0000 cx= 0000 dx=0000 si=0000 di =0000 bp=0000 sp=0000 ds=4E77
ASSUME CS:CODE
CODE SEGMENT
START:
MOV AL,56H
MOV AH,AL
SHR AH,04H
AND AX,0F0FH
OR AX,3030H
INT 03H
CODE ENDS
END START
END
OUTPUT:
BEFORE EXECUTION: c=0 z=0 s=0 o=0 p=0 a=0 i=1 d=0
AFTER EXECUTION: c=0 z=0 s=0 o=0 p=1 a=0 i=1 d=0
ax=3536 bx=0000 cx= 0000 dx=0000 si=0000 di =0000 bp=0000 sp=0000 ds=4E77
RESULT:
The basic logical operations and shift operations and bcd packed to unpacked conversion
and bcd to ascii conversions are performed by using TASM soft ware.