New York, NY IMG HI 58° LO 56° Home About Contact
IMG-LOGO
Home Electrical and Electronics Microprocessor & Interfacing Write an assembly language program to find out the 2' S complement.
Microprocessor & Interfacing Lab Experiments

Write an assembly language program to find out the 2' S complement.



Aim

Write an assembly language program to find out the 2' S complement.

Code for display the message “Program for triangular wave generation”

ApparatusDyna 8086 microprocessor kit

Program:

- Press RES

- Press SEG (EB/AX) 0100 then Press INR

- OFF 0100 then Press INR

- Start entering the Op Codes as:

B8 03 03 F7 D8 CC 00

- Press INR after entering each byte.

- The program corresponding to the above mentioned Op Codes is as below:

Address Opcode Mnemonics Remark
0100 B8 03 03 MOV AX, 0303H Load Accumulator with data as 0303H
0103 F7 D8 NEG AX Compute the 2‟s complement of AX and Store in AX
0105 CC HLT (INT 3) Halt the program.

- Press EXEC

- Press GO

- SEG 0100 Press EXEC

- START 0100 Press EXEC

- Br 0105 Press EXEC

- F will be displayed

- View Result in register by pressing REG and AX

Result:

Data Output

0303H FCFDH (2‟s complement of 0303H)