St. Francis de Sales College (Autonomous) Computer Architecture Lab Manual BCA 1 st Sem SEP COMPUTER ARCHITECTURE LAB CONTENTS E XPT N O N AME OF THE E XPERIMENT P AGE N O 1 Write an 8085 program to find Addition &Subtraction of two 8 - bit HEX numbers. 2 Write an 8085 program to find Subtraction of two 16 - bit numbers. 3 Write an 8085 program to implement 2out of 5 codes. 4 Write 8085 program generate Fibonacci Series. 5 Write an 8085 program to find the first ten terms of odd and even numbers. 6 Write an 8085 program to find 4 - digit BCD addition. 7 Write an 8085 program to find Multiplication of 2 - digit BCD numbers 8 Write an 8085 program to find division of two 8 - bit N umbers. 9 Write an 8086 program to multiply two numbers St. Francis de Sales College (Autonomous) Computer Architecture Lab Manual BCA 1 st Sem SEP PART B PROGRAMS ( 1 - 10 PROGRAMS) 1. Write an 8085 program to find Addition &Subtraction of two 8 - bit HEX numbers. LHLD 2050 XCHG LHLD 2052 MVI C,00 MOV A,E SUB L STA 2054 MOV A,D ADD H STA 2055 SBB H STA 2056 HLT St. Francis de Sales College (Autonomous) Computer Architecture Lab Manual BCA 1 st Sem SEP 2. Write an 8085 program to find Subtraction of two 16 - bit numbers. LHLD 8000H XCHG LHLD 8002H MVI C,00 MOV A,E SUB L STA 8008H MOV A,D SBB H STA 8009H HLT OUTPUT: 3. Write an 8085 program to implement 2 out of 5 codes. LDA 2500H ANI 1FH MVI C,05H MVI D,00H St. Francis de Sales College (Autonomous) Computer Architecture Lab Manual BCA 1 st Sem SEP LOOP: RRC JNC SKIP INR D SKIP: DCR C JNZ LOOP MVI A,02H CMP D JNZ INVALID MVI A,0FFH JMP STORE INVALID: MVI A,0DDH STORE: STA 2501H HLT St. Francis de Sales College (Autonomous) Computer Architecture Lab Manual BCA 1 st Sem SEP 4. Write an 8085 program to generate Fibonacci series MVI D, 0AH LXI H, 2500H MVI B, 00H MVI C, 01H MOV M, B INX H MOV M, C INX H DCR D LOOP: MOV A, B ADD C MOV M, A INX H MOV B, C MOV C, A DCR D JNZ LOOP HLT St. Francis de Sales College (Autonomous) Computer Architecture Lab Manual BCA 1 st Sem SEP 5. Write an 8085 program to find the first ten terms of odd and even numbers. MVI D, 0AH MVI B, 02H MVI C, 00H MVI A, 00H SUM_EVEN: ADD B MOV C, A INR B INR B DCR D JNZ SUM_EVEN LXI H, 2500H MOV M, C MVI D, 0AH MVI B, 01H MVI C, 00H MVI A, 00H SUM_ODD: ADD B MOV C, A INR B INR B DCR D JNZ SUM_ODD LXI H, 2501H MOV M, C HLT St. Francis de Sales College (Autonomous) Computer Architecture Lab Manual BCA 1 st Sem SEP 6. Write an 8085 program to find 4 - Digit BCD addition MVI C, 00H LDA 2501H MOV B, A LDA 2503H ADD B MOV D, A ; Store first result in D JNC SKIP_CARRY ; Jump if no carry INR C ; Increment C if there was a carry SKIP_CARRY: LDA 2500H MOV B, A LDA 2502H ADC B MOV E, A ; Store second result in E STA 2504H ; Store E at 2504H MOV A, D ; Move D to A for storing STA 2505 H HLT St. Francis de Sales College (Autonomous) Computer Architecture Lab Manual BCA 1 st Sem SEP 7. Write an 8085 program to find Multiplication of 2 - digit BCD numbers MVI C, 07H MVI D, 05H XRA A MOV B, A Loop: ADD C DAA JNC NEXT INR B NEXT: DCR D JNZ Loop STA 2500H MOV A, B STA 2501H HLT 8. Write an 8085 program to find division of two 8 - bitnumbers. LXI H,2500H MOV B,M INX H MOV A, M MOV D, A MVI C, 00H MOV A, B DIV_LOOP: CMP D JC DONE SUB D INR C JMP DIV_LOOP DONE: MOV B, A St. Francis de Sales College (Autonomous) Computer Architecture Lab Manual BCA 1 st Sem SEP LXI H, 2502H MOV M, C INX H MOV M, B HLT St. Francis de Sales College (Autonomous) Computer Architecture Lab Manual BCA 1 st Sem SEP 9. Write an 8086 program to multiply two numbers ORG 100h .CODE MOV AL, 35 MOV BH, 15 MUL BH RET St. Francis de Sales College (Autonomous) Computer Architecture Lab Manual BCA 1 st Sem SEP St. Francis de Sales College (Autonomous) Computer Architecture Lab Manual BCA 1 st Sem SEP 10. WRITE AN 8086 PROGRAM TO REVERSE A STRING include 'emu8086.inc' .model small .stack 100h .data string db 'computer' .code main proc mov ax, @data mov ds, ax mov si, offset string mov cx, 10 loop1: mov bx, [si] push bx inc si loop loop1 mov cx, 10 loop2: pop dx mov ah, 02h int 21h loop loop2 mov ah, 4Ch int 21h main endp end main St. Francis de Sales College (Autonomous) Computer Architecture Lab Manual BCA 1 st Sem SEP