SlideShare a Scribd company logo
1 of 21
Download to read offline
Assembly Language Programs



                  1) PROGRAM TO EXCHANGE TWO 16 BIT NUMBERS




Sl no.   ADDRESS         HEX CODE       LABEL     MNEMONICS            COMMENTS
   1       8000           2A,00,F0                 LHLD F000 Load memory from specified
                                                             locations.
  2       8003              EB                       XCHG    Exchange contents of HL & DE
                                                             pairs.
  3       8004            2A,00,F1                 LHLD F100 Load memory from specified
                                                             locations.
  4       8007            22,00,F0                 SHLD F000 Store memory to specified
                                                             locations.
  5       800A              EB                       XCHG    Exchange contents of HL & DE
                                                             pairs.
  6       800B            22,00,F1                 SHLD F200 Store memory to specified
                                                             locations.
  7       800E              CF                       RST 1   Restart




                                 INPUT (Before execution)
                                  F001 ; F000 F101 ; F100
                                  12 ; AB 3C ; DE

                                 OUTPUT(After execution)
                                  F001 ; F000 F101 ; F100
                                  3C ; DE 12 ; AB




           K. Adisesha                           1
Assembly Language Programs




             2) PROGRAM TO ADD OR SUBTRACT TWO 8 BIT NUMBERS



Sl no.   ADDRESS     HEX CODE        LABEL     MNEMONICS COMMENTS
   1       8000        3E, XX                   MVI A, XX Move immediately to [A] the data
                                                           XX
  2       8002           06, YY                 MVI B, YY  Move immediately to [B] the data
                                                           YY
  3       8004           80/(90)               ADD B/SUB B Add(or subtract) [B] with [A]

  4       8005           32,00,F0                STA F000    Store contents of [A] in specified
                                                             location
  5       8008           D2,10,80              JNC (Ahead 1) Jump on no carry to specified
                                                             location
  6       800B            3E,01                  MVIA, 01    Move immediately to [A] the
                                                             data(01)H
  7       800D           C3,12,80              JMP(Ahead 2) Jump unconditionally ahead

  8       8010            3E,00      Ahead 1        MVIA, 00   Move immediately to [A] the
                                                               data(00)H
  9       8012           32,01,F0    Ahead 2     STA F001      Store contents of [A] in specified
                                                               location
  10      8015             CF                        RST1      Restart



           INPUT : XX, YY
                 1) 2B, 1A
                 2) 2B, FA

                    OUTPUT
                      TRIAL         Addition (XX+YY) Subtraction    (XX-YY)
                     ADDRESS             F001: F000        F001: F000
                        1                  00 : 45            00 : 25
                        2                  01 : 25            01 : 31




           K. Adisesha                          2
Assembly Language Programs


                         3) PROGRAM TO ADD TWO 16 BIT NUMBERS




Sl no.   ADDRESS         HEX CODE       LABEL   MNEMONICS                  COMMENTS
  1        8000             AF                    XRA A             Clear accumulator and Flag

  2       8001           2A, 00, F0                 LHLD F000      Load memory from specified
                                                                            locations
  3       8004              EB                        XCHG        Exchange contents of HL & DE
                                                                              pairs
  4       8005           2A,00,F1                   LHLD F100      Load memory from specified
                                                                            locations
  5       8008              19                        DAD D            Add HL & DE pairs

  6       8009            22,00,F2                  SHLD F200        Store memory to specified
                                                                              locations
  7       800C            D2,10,80                  JNC (Ahead)      Jump on no carry to ahead
                                                                               address
  8       800F              3C                        INR A             Increment contents of
                                                                         accumulator by one
  9       8010            32,02,F2      Ahead        STA F202     Store contents of [A] in specified
                                                                               location
 10       8013              CF                         RST1                     Restart




           F001: F000 (X)            4A : 2C
           F101: F100 (Y)            ED : 5B
           F202:F201: F200 (X+Y) 01 : 37 : 87




           K. Adisesha                          3
Assembly Language Programs


           4) PROGRAM TO SUBTRACT TWO 16 BIT NUMBERS (X>Y)




Sl no.   ADDRESS         HEX CODE       LABEL      MNEMONICS           COMMENTS
   1       8000           2A,00,F0                  LHLD F000    Load memory from specified
                                                                          locations
  2       8003              EB                       XCHG       Exchange contents of HL & DE
                                                                            pairs
  3       8004            2A,00,F1                  LHLD F100    Load memory from specified
                                                                          locations
  4       8007              7D                      MOV A, L     Move contents of [L] to [A]

  5       8008              93                       SUB E           Subtract [E] from [A]

  6       8009            32,00,F2                  STA F200    Store result in specified location

  7       800C              7C                      MOV A, H      Move contents of [H] to [A]

  8       800D              9A                       SBB D        Subtract [D] from [A] with
                                                                              borrow
  9       800E            32,01,F2                  STA F201    Store result in specified location

 10       8011              CF                        RST 1                  Restart



           F001: F000 (X)                FA : 2C
           F101: F100 (Y)                BD : 5B
           F202:F201: F200 (X-Y)         3C : D1




           K. Adisesha                          4
Assembly Language Programs


         5) PROGRAM TO ADD TWO N BYTE NUMBERS




Sl no. ADDRESS         HEX CODE       LABEL     MNEMONICS                      COMMENTS
  1     8000            21,00,F0                     LXIH F000         Load HL pair with specified data

 2      8003            01,00,F1                     LXIB F100         Load BC pair with specified data

 3      8006            11,00,F2                     LXID F200         Load DE pair with specified data

 4      8009            3E,(NN)                     MVI A, (NN)          Specify the number of bytes

 5      800B            32,00,81      LOOP            STA 8100                  Save the count

 6      800E              AF                           XRA A             Clear accumulator and flags

 7      800F              0A                          LDAX B           Load [A] indirectly from address
                                                                             specified by BC pair
 8      8010              8E                           ADC M            Add memory to [A] with carry

 9      8011              12                          STAX D          Store contents of [A] indirectly in
                                                                        location specified by DE pair
 10     8012              23                           INX H                   Update memory

 11     8013              03                           INX B               Update BC register pair

 12     8014              13                           INX D               Update DE register pair

 13     8015            3A,00,81                     LDA 8100          Load [A] from specified location

 14     8018              3D                           DCR A                   Decrement count

 15     8019            C2,0B,80                    JNZ (LOOP)         Jump on no zero to perform loop

 16     801C            D2,24,80                    JNC (Ahead 1)     Jump on no carry to ahead address

 17     801F             3E,01                       MVI A, 01          Move immediately to [A] the
                                                                                 data(01)H
 18     8021            C3,26,80                    JMP (Ahead 2)   Jump unconditionally to ahead address

 19     8024             3E,00        Ahead 1        MVI A, 00           Move immediately to [A] the
                                                                                   data(00)H
 20     8026              12          Ahead 2         STAX D        Store contents of [A] indirectly in
                                                                    address specified by DE pair
 21     8027              CF                           RST 1                        Restart
         K. Adisesha                            5
Assembly Language Programs




INPUT(X)               F103 : F102 : F101 : F100       A4 : E6 : F3 : D7
INPUT(Y)               F003 : F002 : F001 : F000       C3 : 54 : A2 : 1B
OUTPUT(X+Y)       F204:F203 : F202 : F201 : F200   01: 68 : 3B: 95: F2




K. Adisesha                        6
Assembly Language Programs


                              6) PROGRAM FOR BLOCK TRANSFER




Sl no.   ADDRESS           HEX CODE       LABEL   MNEMONICS                 COMMENTS
   1       8000              16,10                MVI D, (10)H              Set count in [D]

  2         8002            21,00,81                  LXIH 8100     Load HL pair with specified
                                                                              address
  3         8005            01,00,82                  LXIB 8200     Load BC pair with specified
                                                                              address
  4         8008              7E          LOOP        MOV A,M      Move contents of memory to [A]

  5         8009              02                       STAX B      Store contents of [A] indirectly
                                                                   to location specified by BC pair
  6         800A              23                        INX H               Update memory

  7         800B              03                        INX B              Update BC pair

  8         800C              15                        DCR D          Decrement count in [D]

  9         800D            C2,08,80                  JNZ (LOOP)   Jump on no zero to perform the
                                                                               loop
 10         8010              CF                        RST1                  Restart

             INPUT
      8100:810:8102:8103:8104:8105:8106:8107:8108:8109:810A:810B:810C:810D:810E:810F
       00 : 01: 02 : 03 : 04 : 05 : 06 : 07 : 08 : 09 : 0A : 0B : 0C : 0D : 0E : 0F

             OUTPUT
      8200:8201:8202:8203:8204:8205:8206:8207:8208:8209:820A:820B:820C:820D:820E:820F
       00 : 01: 02 : 03 : 04 : 05 : 06 : 07 : 08 : 09 : 0A : 0B : 0C : 0D : 0E : 0F




             K. Adisesha                          7
Assembly Language Programs


            7) PROGRAM TO BLOCK TRANSFER IN REVERSE ORDER




Sl no.   ADDRESS          HEX CODE       LABEL   MNEMONICS                 COMMENTS
   1       8000             16,10                MVI D, (10)H              Set count in [D]

  2        8002            21,00,81                  LXIH 8100     Load HL pair with specified
                                                                             address
  3        8005            01,0F,82                  LXIB 820F     Load BC pair with specified
                                                                             address
  4        8008              7E          LOOP        MOV A,M      Move contents of memory to [A]

  5        8009              02                       STAX B      Store contents of [A] indirectly
                                                                  to location specified by BC pair
  6        800A              23                        INX H               Update memory

  7        800B              0B                        DCX B         Decrement BC pair by one

  8        800C              15                        DCR D          Decrement count in [D]

  9        800D            C2,08,80                  JNZ (LOOP)   Jump on no zero to perform the
                                                                              loop
 10        8010              CF                        RST1                  Restart


            INPUT
         8100:810:8102:8103:8104:8105:8106:8107:8108:8109:810A:810B:810C:810D:810E:810F
          00 : 01: 02 : 03 : 04 : 05 : 06 : 07 : 08 : 09 : 0A : 0B : 0C : 0D : 0E : 0F

            OUTPUT
         820F:820E:820D:820C:820B:820A:8209:8208:8207:8206:8205:8204:8203:8202:8201:8200
          0F : 0E : 0D : 0C : 0B : 0A : 09 : 08 : 07 : 06 : 05 : 04 : 03 : 02 : 01 : 00




            K. Adisesha                          8
Assembly Language Programs


           8) PROGRAM TO ADD N DECIMAL NUMBERS (N= 10)
           INPUT                                            OUTPUT
           8100:810:8102:8103:8104:8105:8106:8107:8108:8109 F201 F200
            00 : 01: 02 : 03 : 04 : 05 : 06 : 07 : 08 : 09    00   45

Sl no.   ADDRESS         HEX CODE       LABEL   MNEMONICS COMMENTS

  1       8000              AF                         XRA A       Clear accumulator and flags

  2       8001             0E,0A                    MVI C, (0A)H   Set N count in [C]

  3       8003             16,00                     MVI D , 00    Clear [D]

  4       8005            21,00,81                   LXIH 8100     Load HL pair with specified data

  5       8008              86          LOOP          ADD M        Add memory to [A]

  6       8009              27                         DAA         Decimal adjust accumulator

  7       800A           D2,0E,80                   JNC(Ahead)     Jump on no carry to ahead
                                                                   address
  8       800D              14                         INR D       Increment [D] by one

  9       800E              23          Ahead          INX H       Update memory

 10       800F              0D                        DCR C        Decrement count

 11       8010            C2,08,80                  JNZ(LOOP)      Jump on no zero to perform loop

 12       8013              6F                       MOV L,A       Move [A] to [L]

 13       8014              62                       MOV H,D       Move [D] to [H]

 14       8015            22,00,F2                  SHLD F200      Store contents of HL pair to
                                                                   specified consecutive locations
 15       8018              CF                         RST 1       Restart




           K. Adisesha                          9
Assembly Language Programs


             9) PROGRAM FOR ADDITION OF HEXA-DECIMAL NUMBERS
                         UNTILL ‘FF’ IS ENCOUNTERED




Sl no.   ADDRESS     HEX CODE       LABEL       MNEMONICS        COMMENTS
   1       8000         AF                        XRA A          Clear accumulator and flags

  2       8001           32,F9,FF   LOOP            STA FFF9     Store contents of accumulator in
                                                                 specified location
  3       8004             F5                    PUSH PSW        Push [A] and flags to stack

  4       8005           CD,D3,06              CALL(UPDDT)       Call display subroutine for data
                                                                 field
  5       8008           11,FF,FF                LXID FFFF
                                                                 Implement a delay of 0.5 s using
  6       800B           CD,BE,04              CALL(DELAY)       monitor delay subroutine

  7       800E             F1                       POP PSW      Pop[A] and flags off stack

  8       800F             3C                        INR A       Increment contents of [A] by one

  9       8010           C2,01,80                JNZ (LOOP)      Perform the loop until [A]
                                                                 becomes zero
 10       8013              76                        HLT        Halt


           OUTPUT: ‘00’ up to ‘FF’ is displayed in data field.




           K. Adisesha                         10
Assembly Language Programs


           10) PROGRAM FOR FOUR DIGIT BCD ADDITION


Sl no.   ADDRESS         HEX CODE       LABEL          MNEMONICS       COMMENTS
   1       8000           21,00,F0                      LXIH F000      Load HL pair with specified data

  2        8003           01,00,F1                      LXIB F100      Load BC pair with specified data

  3        8006           11,00,F2                      LXID F200      Load DE pair with specified data

  4        8009            3E,02                        MVI A, (02)    Specify the number of bytes

  5       800B            32,00,81      LOOP             STA 8100      Save the count

  6       800E              0A                           LDAX B        Load [A] indirectly from address
                                                                       specified by BC pair
  7       800F              8E                            ADC M        Add memory to [A] with carry

  8        8010             27                             DAA         Decimal adjust accumulator

  9        8011             12                           STAX D        Store contents of [A] indirectly in
                                                                       location specified by DE pair
  10       8012             23                            INX H        Update memory

  11       8013             03                            INX B        Update BC register pair

  12       8014             13                            INX D        Update DE register pair

  13       8015           3A,00,81                       LDA 8100      Load [A] from specified location

  14       8018             3D                            DCR A        Decrement count

  15       8019           C2,0B,80                     JNZ (LOOP)      Jump on no zero to perform loop

  16      801C            D2,24,80                     JNC (Ahead 1)   Jump on no carry to ahead address
                                                                       Move immediately to [A] the
  17      801F             3E,01                        MVI A, 01      data(01)H
                                                                       Jump unconditionally to ahead
  18       8021           C3,26,80                  JMP (Ahead 2)      address
                                                                       Move immediately to [A] the
  19       8024            3E,00        Ahead 1         MVI A, 00      data(00)H
                                                                       Store contents of [A] indirectly in
  20       8026             12          Ahead 2          STAX D        address specified by DE pair
                                                                       Restart
  21       8027             CF                            RST 1



           K. Adisesha                            11
Assembly Language Programs




INPUT(X)                      F101 : F100       57 : 93
INPUT(Y)                      F001 : F000      64 : 21
OUTPUT(X+Y)            F202 : F201 : F200   01: 22 : 14




K. Adisesha                        12
Assembly Language Programs




           11) PROGRAM TO FIND 2`S COMPLEMENT OF 8 BIT/ 16 BIT
                               NUMBER
Sl no. ADDRESS    HEX CODE          LABEL      MNEMONICS                 COMMENTS


 1      8000           06,01/(02)              MVI B,01/(02) Move to [B] (01) for 8-bit & (02)
                                                             for 16-bit complement of data
 2      8002           11,01,00                 LXID 0001    Load DE pair with specified data

 3      8005           21,00,F0                    LXIH F000    Load HL pair with specified data

 4      8008              7E          LOOP         MOV A,M      Copy contents of memory to [A]

 5      8009              2F                         CMA          Complement contents of [A]

 6     800A               77                       MOV M,A      Copy contents of [A] to memory

 7      800B               05                       DCR B            Decrement [B] by one

 8      800C           CA, 13,80                   JZ (Ahead)   Jump on zero to ahead address

 9      800F              23                         INX H              Update memory

 10     8010           C3,08,80                    JMP(Loop)    Jump unconditionally to perform
                                                                             loop
 11     8013           2A,00,F0       Ahead        LHLD F000     Load contents of HL pair from
                                                                      specified locations
 12     8016              19                        DAD D       Add HL and DE pair of registers

 13     8017           22,00,F1                    SHLD F100      Store contents of HL pair to
                                                                      specified locations
 14    801A               CF                         RST 1                  Restart



        DATA              INPUT               OUTPUT(2`s complement)


         K. Adisesha                          13
Assembly Language Programs


        8-Bit        F000 : 7A             F100 : 87
        16-Bit       F001 : F000 :: 1A: 26 F101 : F100 :: E5: DA
              12) PROGRAM FOR SUB TRACTION OF TWO 16-BIT BCD
                                    NUMBERS (X>Y)

Sl no. ADDRESS    HEX CODE         LABEL      MNEMONICS               COMMENTS
   1     8000      11,86,97                    LXID(9786)       Load DE pair with specified
                                                                           data
 2      8003           01,59,32                   LXIB(3259)    Load BC pair with specified
                                                                           data
 3      8006           CD,20, 80             CALL(Sub-BCD)       Call subroutine for BCD
                                                                        subtraction
 4      8009              6F                      MOV L,A       Copy contents of [A] to [L]

 5      800C              5A                      MOV E,D       Copy contents of [D] to [E]

 6     800D               48                      MOV C,B       Copy contents of [B] to [C]

 7      800E           CD,20,80              CALL(Sub-BCD)       Call subroutine for BCD
                                                                        subtraction
 8      800F              67                      MOV H,A       Copy contents of [A] to [H]

 9      8012           22,00,F0                   SHLD F000     Store contents of HL pair to
                                                                     specified locations
 10     8013             CF                        RST 1                   Restart
 12     8020            3E,99      Sub-BCD        MVI A,99      Move to [A] the given data to
                                                               subtract using 99` complement
 13     8017              93                        SUB E          Subtract [E] from [A]

 14     8018              3C                        INR A           Increment [A] by 1

 15     8019              81                       ADD C              Add [C] to [A]

 16    801A               27                        DAA         Decimal adjust accumulator

 17     801B              C9                         RET          Return from subroutine
                                                                     unconditionally




         K. Adisesha                         14
Assembly Language Programs


             OUTPUT
             F001: F000 :: 65 : 27
                                          13) PROGRAM FOR BLOCK EXCHANGE



Sl no.   ADDRESS       HEX CODE       LABEL     MNEMONICS                COMMENTS
   1       8000         21,00,F0                 LXIH F000        Load HL pair with specified
                                                                             address
  2         8003           11,00,F1              LXID F100        Load HL pair with specified
                                                                             address
  3         8006            0E,10                MVI C,(10)H     Set counter in [C] for N counts

  4         8008             1A       LOOP           LDAX D         Load [A] indirectly from
                                                                  address indicated by DE pair
  5         8009             46                      MOV B,M     Copy contents of memory to[B]

  6         800A             77                      MOV M,A     Copy contents of [A] to memory

  7         800B             78                      MOV A,B       Copy contents of [B] to [A]

  8         800C             12                      STAX D      Store contents of [A] indirectly
                                                                     onto address in DE pair
  9         800D             23                       INX H             Update memory

 10         800E             13                       INX D          Update DE register pair

 11         800F             0D                       DCR C            Decrement [C] by 1

 12         8010           C2,08,80                  JNZ(Loop)      Perform the loop until [C]
                                                                          becomes zero
 13         8013             CF                       RST 1                  Restart




             INPUT
      F000:F001:F002:F003:F004:F005:F006:F007:F008:F009:F00A:F00B:F00C:F00D:F00E:F00F
       00 : 01 : 02 : 03 : 04 : 05 : 06 : 07 : 08 : 09 : 0A : 0B : 0C : 0D : 0E : 0F
      F100:F101:F102:F103:F104:F105:F106:F107:F108:F109:F10A:F10B:F10C:F10D:F10E:F10F


             K. Adisesha                        15
Assembly Language Programs


 10 : 11 : 12 : 13 : 14 : 15 : 16 : 17 : 18 : 19 : 1A : 1B : 1C : 1D : 1E : 1F
F000:F001:F002:F003:F004:F005:F006:F007:F008:F009:F00A:F00B:F00C:F00D:F00E:F00F
 10 : 11 : 12 : 13 : 14 : 15 : 16 : 17 : 18 : 19 : 1A : 1B : 1C : 1D : 1E : 1F
F100:F101:F102:F103:F104:F105:F106:F107:F108:F109:F10A:F10B:F10C:F10D:F10E:F10F
 00 : 01 : 02 : 03 : 04 : 05 : 06 : 07 : 08 : 09 : 0A : 0B : 0C : 0D : 0E : 0F
       OUTPUT




       K. Adisesha                    16
Assembly Language Programs



 14) PROGRAM FOR SORTING AN ARRAY OF ‘N-NUMBERS’ IN
                  ASCENDING ORDER




K. Adisesha                  17
Assembly Language Programs




             INPUT
      F100:F101:F102:F103:F104:F105:F106:F107:F108:F109
       0A : 01 : 09 : 05 : 03 : 06 : 08 : 07 : 04 : 02

Sl no.   ADDRESS       HEX CODE       LABE    MNEMONICS                   COMMENTS
                                        L
  1         8000             AF                     XRA A            Clear accumulator & flags

  2         8001            06,0B                  MVI B,0B         Move a count (N+1) in [B]

  3         8003             48       START        MOV C,B          Copy contents of [B] to [C]

  4         8004             0D                     DCR C        Decrement contents of [C] by one

  5         8005           21,00,F1                LXIH F100   Load the specified address in HL pair

  6         8008             7E       LOOP         MOV A,M          Copy contents of [M] to [A]

  7         8009             23                     INX H                 Update memory

  8         800A             BE                     CMP M       Compare memory with accumulator

  9         800B           DA,13,80            JC (AHEAD)         Jump on carry to ahead address

  10        800E             56                    MOV D,M          Copy contents of [M] to [D]

  11        800F             77                    MOV M,A          Copy contents of [A] to [M]

  12        8010             2B                     DCX H           Decrement HL pair by one

  13        8011             72                    MOV M,D          Copy contents of [D] to [M]

  14        8012             23                     INX H      Increment contents of HL pair by one

  15        8013             0D       AHEAD         DCR C        Decrement contents of [C] by one

  16        8014           C2,08,80            JNZ (LOOP)       Jump on no zero to perform the loop

  17        8017             05                     DCR B      Decrement count in [B]

  18        8018           C2,03,80           JNZ (START)       Jump on no zero to specified address

  19        801B             CF                      RST 1                    Restart



             K. Adisesha                      18
Assembly Language Programs

       OUTPUT
F100:F101:F102:F103:F104:F105:F106:F107:F108:F109
 01 : 02 : 03 : 04 : 05 : 06 : 07 : 08 : 09 : 0A




                     15) PROGRAM TO CHECK 2-OUT-OF-5 CODE




       K. Adisesha                     19
Assembly Language Programs




 Sl no.    ADDRESS       HEX CODE       LABEL     MNEMONICS                 COMMENTS
Sl no.    ADDRESS        HEX CODE       LABEL     MNEMONICS                  COMMENTS
  1         8000           3A,00,F0                     LDA F000     Load data into accumulator from
                                                                            specified location
  2         8003            0E,05                      MVI C,05    Move a count (05)H in [C]

  3         8005            16,00                      MVI D,00            Clear contents of [D]

  4         8007            E6,E0                       ANI E0         Logical AND (E0) H with [A]

  5         8009           C2,23,80               JNZ (AHEAD 1)    Jump on no zero to specified address

  6         800C           3A,00,F0                    LDA F000      Load data into accumulator from
                                                                            specified location
  7         800F             0F         LOOP             RRC          Rotate contents of [A] to right

  8         8010           D2,14,80               JNC(AHEAD 2)       Jump on no carry to ahead address

  9         8013             14                          INR D            Increment count in [D]

  10        8014             0D         AHEAD 2         DCR C        Decrement contents of [C] by one

  11       80015           C2,0F,80                    JNZ(LOOP)    Jump on no zero to perform the loop

  12        8018             7A                        MOV A,D          Copy contents of [D] to [A]

  13        8019            FE,02                       CPI ,02    Compare (02) H immediately with [A]

  14        801B           C2,23,80               JNZ(AHEAD 1)     Jump on no zero to specified address

  15        801E            3E,FF                      MVI A, FF   Move ‘FF’ to [A] immediately

  16        8020           C2,25,80               JMP(AHEAD 3)          Jump to specified location
                                                                              unconditionally
  17        8023            3E,00       AHEAD 1        MVI A, 00   Move ‘00’ to [A] immediately

  18        8025           32,00,F1     AHEAD 3        STA F100      Store data from accumulator into
                                                                            specified location
  19        8028             CF                          RST 1                    Restart

               INPUT         OUTPUT
              F000: 11       F100: FF
              F000: 13       F100: 00
                          16) PROGRAM TO MULTIPLY TWO DIGIT BCD


            K. Adisesha                           20
Assembly Language Programs


1    8000          21,00,00                 LXIH (0000 )H   Move a count (0000)H in HL pair

2    8003          3A,00,F0                  LDA F000         Load data into accumulator from
                                                                     specified location
3    8006            47                      MOV B,A            Copy contents of [A] to [B]

4    8007          3A,01,F0                  LDA F001         Load data into accumulator from
                                                                     specified location
5    800A            4F                      MOV C,A            Copy contents of [A] to [C]

6    800B            79       START          MOV A,C             Copy contents of [C] to [A]

7    800C            85                          ADD L             Add [L] to accumulator

8    800D            27                           DAA                Decimal adjust [A]

9    800E            6F                      MOV L,A             Copy contents of [A] to [L]

10   800F           3E,00                    MVI A,00               Clear contents of [A]

11   80011           8C                          ADC H           Add contents of [H] to [A]

12   8012            27                           DAA                Decimal adjust [A]

13   8013            67                      MOV H,A        Copy contents of [A] to [H]

14   8014            78                      MOV A,B        Copy contents of [B] to [A]

15   8015           C6,99                        ADI ,99    Add immediately to accumulator 99

16   8017            27                           DAA       Decimal adjust [A]

17   8018            47                      MOV B,A        Copy contents of [A] to [B]

18   8019          C2,0B,80                 JNZ(START)      Jump on no zero to specified address

19   801C          22,00,F1                 SHLD(F100)      Store data from HL pair onto specified
                                                                           location
20   801F            CF                          RST 1                      Restart

               INPUT            OUTPUT
             F001: F000        F101: F100
              11 : 12            01 : 32




     K. Adisesha                            21

More Related Content

What's hot

Microprocessor square wave
Microprocessor square waveMicroprocessor square wave
Microprocessor square waveFthi Arefayne
 
Instruction Set 8085
Instruction Set 8085Instruction Set 8085
Instruction Set 8085Stupidsid.com
 
8085 microprocessor lab manual
8085 microprocessor lab manual8085 microprocessor lab manual
8085 microprocessor lab manualNithin Mohan
 
Micro Processor Lab Manual!
Micro Processor Lab Manual!Micro Processor Lab Manual!
Micro Processor Lab Manual!PRABHAHARAN429
 
microprocessor Laboratory experiments manual
microprocessor Laboratory experiments manualmicroprocessor Laboratory experiments manual
microprocessor Laboratory experiments manualAnkit Kumar
 
Ec2308 microprocessor and_microcontroller__lab1
Ec2308 microprocessor and_microcontroller__lab1Ec2308 microprocessor and_microcontroller__lab1
Ec2308 microprocessor and_microcontroller__lab1v1i7n9i2
 
Microprocessor lab
Microprocessor labMicroprocessor lab
Microprocessor labkpaulraj
 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction setSaumitra Rukmangad
 
Stack in 8085 microprocessor
Stack in 8085 microprocessorStack in 8085 microprocessor
Stack in 8085 microprocessorhepzijustin
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction setJLoknathDora
 
Ee2356 lab manual
Ee2356 lab manualEe2356 lab manual
Ee2356 lab manualdhameee
 
8085 instruction set (detailed)
8085 instruction set (detailed)8085 instruction set (detailed)
8085 instruction set (detailed)Ravi Anand
 
Instruction set of 8085
Instruction set  of 8085Instruction set  of 8085
Instruction set of 8085shiji v r
 
8086 labmanual
8086 labmanual8086 labmanual
8086 labmanualiravi9
 
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareInstruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareProf. Swapnil V. Kaware
 

What's hot (17)

Microprocessor square wave
Microprocessor square waveMicroprocessor square wave
Microprocessor square wave
 
Instruction Set 8085
Instruction Set 8085Instruction Set 8085
Instruction Set 8085
 
8085 microprocessor lab manual
8085 microprocessor lab manual8085 microprocessor lab manual
8085 microprocessor lab manual
 
Micro Processor Lab Manual!
Micro Processor Lab Manual!Micro Processor Lab Manual!
Micro Processor Lab Manual!
 
microprocessor Laboratory experiments manual
microprocessor Laboratory experiments manualmicroprocessor Laboratory experiments manual
microprocessor Laboratory experiments manual
 
Microprocessor File
Microprocessor FileMicroprocessor File
Microprocessor File
 
Ec2308 microprocessor and_microcontroller__lab1
Ec2308 microprocessor and_microcontroller__lab1Ec2308 microprocessor and_microcontroller__lab1
Ec2308 microprocessor and_microcontroller__lab1
 
Microprocessor lab
Microprocessor labMicroprocessor lab
Microprocessor lab
 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
 
Stack in 8085 microprocessor
Stack in 8085 microprocessorStack in 8085 microprocessor
Stack in 8085 microprocessor
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
Ee2356 lab manual
Ee2356 lab manualEe2356 lab manual
Ee2356 lab manual
 
8085 instruction set (detailed)
8085 instruction set (detailed)8085 instruction set (detailed)
8085 instruction set (detailed)
 
Instruction set of 8085
Instruction set  of 8085Instruction set  of 8085
Instruction set of 8085
 
8086 labmanual
8086 labmanual8086 labmanual
8086 labmanual
 
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareInstruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
 

Viewers also liked

Unit 2 assembly language programming
Unit 2   assembly language programmingUnit 2   assembly language programming
Unit 2 assembly language programmingKartik Sharma
 
Programming basic computer
Programming basic computerProgramming basic computer
Programming basic computerMartial Kouadio
 
Unit 3 – assembly language programming
Unit 3 – assembly language programmingUnit 3 – assembly language programming
Unit 3 – assembly language programmingKartik Sharma
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085techbed
 
Intel 8080 8085 assembly language programming 1977 intel
Intel 8080 8085 assembly language programming 1977 intelIntel 8080 8085 assembly language programming 1977 intel
Intel 8080 8085 assembly language programming 1977 intelOmar Alkinani
 
Assembly language 8086
Assembly language 8086Assembly language 8086
Assembly language 8086John Cutajar
 
IGNOU Assembly Language Programming
IGNOU Assembly Language ProgrammingIGNOU Assembly Language Programming
IGNOU Assembly Language ProgrammingDr. Loganathan R
 
Microprocessor chapter 9 - assembly language programming
Microprocessor  chapter 9 - assembly language programmingMicroprocessor  chapter 9 - assembly language programming
Microprocessor chapter 9 - assembly language programmingWondeson Emeye
 
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMINGChapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMINGFrankie Jones
 
Intel 8085-programs-final
Intel 8085-programs-finalIntel 8085-programs-final
Intel 8085-programs-finaljaspreet16
 
Programming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacingProgramming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacingAmitabh Shukla
 
C – A Programming Language- I
C – A Programming Language- IC – A Programming Language- I
C – A Programming Language- IGagan Deep
 
Computer Organization and Assembly Language
Computer Organization and Assembly LanguageComputer Organization and Assembly Language
Computer Organization and Assembly Languagefasihuddin90
 
microprocessor 8086 lab manual !!
microprocessor 8086 lab manual !!microprocessor 8086 lab manual !!
microprocessor 8086 lab manual !!Sushil Mishra
 
assembly language programming and organization of IBM PC" by YTHA YU
assembly language programming and organization of IBM PC" by YTHA YUassembly language programming and organization of IBM PC" by YTHA YU
assembly language programming and organization of IBM PC" by YTHA YUEducation
 

Viewers also liked (20)

Unit 2 assembly language programming
Unit 2   assembly language programmingUnit 2   assembly language programming
Unit 2 assembly language programming
 
Programming basic computer
Programming basic computerProgramming basic computer
Programming basic computer
 
Unit 3 – assembly language programming
Unit 3 – assembly language programmingUnit 3 – assembly language programming
Unit 3 – assembly language programming
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085
 
Intel 8080 8085 assembly language programming 1977 intel
Intel 8080 8085 assembly language programming 1977 intelIntel 8080 8085 assembly language programming 1977 intel
Intel 8080 8085 assembly language programming 1977 intel
 
Assembly language 8086
Assembly language 8086Assembly language 8086
Assembly language 8086
 
IGNOU Assembly Language Programming
IGNOU Assembly Language ProgrammingIGNOU Assembly Language Programming
IGNOU Assembly Language Programming
 
Microprocessor chapter 9 - assembly language programming
Microprocessor  chapter 9 - assembly language programmingMicroprocessor  chapter 9 - assembly language programming
Microprocessor chapter 9 - assembly language programming
 
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMINGChapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
 
List of 8085 programs
List of 8085 programsList of 8085 programs
List of 8085 programs
 
Intel 8085-programs-final
Intel 8085-programs-finalIntel 8085-programs-final
Intel 8085-programs-final
 
Lec03
Lec03Lec03
Lec03
 
Programming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacingProgramming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacing
 
C – A Programming Language- I
C – A Programming Language- IC – A Programming Language- I
C – A Programming Language- I
 
Computer Organization and Assembly Language
Computer Organization and Assembly LanguageComputer Organization and Assembly Language
Computer Organization and Assembly Language
 
Delay routine
Delay routineDelay routine
Delay routine
 
Mp lab manual
Mp lab manualMp lab manual
Mp lab manual
 
microprocessor 8086 lab manual !!
microprocessor 8086 lab manual !!microprocessor 8086 lab manual !!
microprocessor 8086 lab manual !!
 
assembly language programming and organization of IBM PC" by YTHA YU
assembly language programming and organization of IBM PC" by YTHA YUassembly language programming and organization of IBM PC" by YTHA YU
assembly language programming and organization of IBM PC" by YTHA YU
 
Programming with 8085
Programming with 8085Programming with 8085
Programming with 8085
 

Similar to Assembly language programming

Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareInstruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareProf. Swapnil V. Kaware
 
Instructionsetof8085 120415220437-phpapp02
Instructionsetof8085 120415220437-phpapp02Instructionsetof8085 120415220437-phpapp02
Instructionsetof8085 120415220437-phpapp02Satsang Yadav
 
10. 8085 programming example ii
10. 8085 programming example ii10. 8085 programming example ii
10. 8085 programming example iisandip das
 
8085_MicroelectronicAndMicroprocess.pdf
8085_MicroelectronicAndMicroprocess.pdf8085_MicroelectronicAndMicroprocess.pdf
8085_MicroelectronicAndMicroprocess.pdfFloraKara
 

Similar to Assembly language programming (7)

Instruction set
Instruction setInstruction set
Instruction set
 
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareInstruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
 
Instructionsetof8085 120415220437-phpapp02
Instructionsetof8085 120415220437-phpapp02Instructionsetof8085 120415220437-phpapp02
Instructionsetof8085 120415220437-phpapp02
 
Up 8086 q2
Up 8086 q2Up 8086 q2
Up 8086 q2
 
10. 8085 programming example ii
10. 8085 programming example ii10. 8085 programming example ii
10. 8085 programming example ii
 
1.pdf
1.pdf1.pdf
1.pdf
 
8085_MicroelectronicAndMicroprocess.pdf
8085_MicroelectronicAndMicroprocess.pdf8085_MicroelectronicAndMicroprocess.pdf
8085_MicroelectronicAndMicroprocess.pdf
 

More from Prof. Dr. K. Adisesha

Software Engineering notes by K. Adisesha.pdf
Software Engineering notes by K. Adisesha.pdfSoftware Engineering notes by K. Adisesha.pdf
Software Engineering notes by K. Adisesha.pdfProf. Dr. K. Adisesha
 
Software Engineering-Unit 1 by Adisesha.pdf
Software Engineering-Unit 1 by Adisesha.pdfSoftware Engineering-Unit 1 by Adisesha.pdf
Software Engineering-Unit 1 by Adisesha.pdfProf. Dr. K. Adisesha
 
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdfSoftware Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdfProf. Dr. K. Adisesha
 
Software Engineering-Unit 3 "System Modelling" by Adi.pdf
Software Engineering-Unit 3 "System Modelling" by Adi.pdfSoftware Engineering-Unit 3 "System Modelling" by Adi.pdf
Software Engineering-Unit 3 "System Modelling" by Adi.pdfProf. Dr. K. Adisesha
 
Software Engineering-Unit 4 "Architectural Design" by Adi.pdf
Software Engineering-Unit 4 "Architectural Design" by Adi.pdfSoftware Engineering-Unit 4 "Architectural Design" by Adi.pdf
Software Engineering-Unit 4 "Architectural Design" by Adi.pdfProf. Dr. K. Adisesha
 
Software Engineering-Unit 5 "Software Testing"by Adi.pdf
Software Engineering-Unit 5 "Software Testing"by Adi.pdfSoftware Engineering-Unit 5 "Software Testing"by Adi.pdf
Software Engineering-Unit 5 "Software Testing"by Adi.pdfProf. Dr. K. Adisesha
 
Computer Networks Notes by -Dr. K. Adisesha
Computer Networks Notes by -Dr. K. AdiseshaComputer Networks Notes by -Dr. K. Adisesha
Computer Networks Notes by -Dr. K. AdiseshaProf. Dr. K. Adisesha
 
CCN Unit-1&2 Data Communication &Networking by K. Adiaesha
CCN Unit-1&2 Data Communication &Networking by K. AdiaeshaCCN Unit-1&2 Data Communication &Networking by K. Adiaesha
CCN Unit-1&2 Data Communication &Networking by K. AdiaeshaProf. Dr. K. Adisesha
 
CCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. AdiseshaCCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. AdiseshaProf. Dr. K. Adisesha
 
CCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. AdiseshaCCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. AdiseshaProf. Dr. K. Adisesha
 
CCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdfCCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdfProf. Dr. K. Adisesha
 

More from Prof. Dr. K. Adisesha (20)

Software Engineering notes by K. Adisesha.pdf
Software Engineering notes by K. Adisesha.pdfSoftware Engineering notes by K. Adisesha.pdf
Software Engineering notes by K. Adisesha.pdf
 
Software Engineering-Unit 1 by Adisesha.pdf
Software Engineering-Unit 1 by Adisesha.pdfSoftware Engineering-Unit 1 by Adisesha.pdf
Software Engineering-Unit 1 by Adisesha.pdf
 
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdfSoftware Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
 
Software Engineering-Unit 3 "System Modelling" by Adi.pdf
Software Engineering-Unit 3 "System Modelling" by Adi.pdfSoftware Engineering-Unit 3 "System Modelling" by Adi.pdf
Software Engineering-Unit 3 "System Modelling" by Adi.pdf
 
Software Engineering-Unit 4 "Architectural Design" by Adi.pdf
Software Engineering-Unit 4 "Architectural Design" by Adi.pdfSoftware Engineering-Unit 4 "Architectural Design" by Adi.pdf
Software Engineering-Unit 4 "Architectural Design" by Adi.pdf
 
Software Engineering-Unit 5 "Software Testing"by Adi.pdf
Software Engineering-Unit 5 "Software Testing"by Adi.pdfSoftware Engineering-Unit 5 "Software Testing"by Adi.pdf
Software Engineering-Unit 5 "Software Testing"by Adi.pdf
 
Computer Networks Notes by -Dr. K. Adisesha
Computer Networks Notes by -Dr. K. AdiseshaComputer Networks Notes by -Dr. K. Adisesha
Computer Networks Notes by -Dr. K. Adisesha
 
CCN Unit-1&2 Data Communication &Networking by K. Adiaesha
CCN Unit-1&2 Data Communication &Networking by K. AdiaeshaCCN Unit-1&2 Data Communication &Networking by K. Adiaesha
CCN Unit-1&2 Data Communication &Networking by K. Adiaesha
 
CCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. AdiseshaCCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. Adisesha
 
CCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. AdiseshaCCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. Adisesha
 
CCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdfCCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdf
 
Introduction to Computers.pdf
Introduction to Computers.pdfIntroduction to Computers.pdf
Introduction to Computers.pdf
 
R_Programming.pdf
R_Programming.pdfR_Programming.pdf
R_Programming.pdf
 
Scholarship.pdf
Scholarship.pdfScholarship.pdf
Scholarship.pdf
 
Operating System-2 by Adi.pdf
Operating System-2 by Adi.pdfOperating System-2 by Adi.pdf
Operating System-2 by Adi.pdf
 
Operating System-1 by Adi.pdf
Operating System-1 by Adi.pdfOperating System-1 by Adi.pdf
Operating System-1 by Adi.pdf
 
Operating System-adi.pdf
Operating System-adi.pdfOperating System-adi.pdf
Operating System-adi.pdf
 
Data_structure using C-Adi.pdf
Data_structure using C-Adi.pdfData_structure using C-Adi.pdf
Data_structure using C-Adi.pdf
 
JAVA PPT -2 BY ADI.pdf
JAVA PPT -2 BY ADI.pdfJAVA PPT -2 BY ADI.pdf
JAVA PPT -2 BY ADI.pdf
 
JAVA PPT -5 BY ADI.pdf
JAVA PPT -5 BY ADI.pdfJAVA PPT -5 BY ADI.pdf
JAVA PPT -5 BY ADI.pdf
 

Recently uploaded

MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 

Recently uploaded (20)

MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 

Assembly language programming

  • 1. Assembly Language Programs 1) PROGRAM TO EXCHANGE TWO 16 BIT NUMBERS Sl no. ADDRESS HEX CODE LABEL MNEMONICS COMMENTS 1 8000 2A,00,F0 LHLD F000 Load memory from specified locations. 2 8003 EB XCHG Exchange contents of HL & DE pairs. 3 8004 2A,00,F1 LHLD F100 Load memory from specified locations. 4 8007 22,00,F0 SHLD F000 Store memory to specified locations. 5 800A EB XCHG Exchange contents of HL & DE pairs. 6 800B 22,00,F1 SHLD F200 Store memory to specified locations. 7 800E CF RST 1 Restart INPUT (Before execution) F001 ; F000 F101 ; F100 12 ; AB 3C ; DE OUTPUT(After execution) F001 ; F000 F101 ; F100 3C ; DE 12 ; AB K. Adisesha 1
  • 2. Assembly Language Programs 2) PROGRAM TO ADD OR SUBTRACT TWO 8 BIT NUMBERS Sl no. ADDRESS HEX CODE LABEL MNEMONICS COMMENTS 1 8000 3E, XX MVI A, XX Move immediately to [A] the data XX 2 8002 06, YY MVI B, YY Move immediately to [B] the data YY 3 8004 80/(90) ADD B/SUB B Add(or subtract) [B] with [A] 4 8005 32,00,F0 STA F000 Store contents of [A] in specified location 5 8008 D2,10,80 JNC (Ahead 1) Jump on no carry to specified location 6 800B 3E,01 MVIA, 01 Move immediately to [A] the data(01)H 7 800D C3,12,80 JMP(Ahead 2) Jump unconditionally ahead 8 8010 3E,00 Ahead 1 MVIA, 00 Move immediately to [A] the data(00)H 9 8012 32,01,F0 Ahead 2 STA F001 Store contents of [A] in specified location 10 8015 CF RST1 Restart INPUT : XX, YY 1) 2B, 1A 2) 2B, FA OUTPUT TRIAL Addition (XX+YY) Subtraction (XX-YY) ADDRESS F001: F000 F001: F000 1 00 : 45 00 : 25 2 01 : 25 01 : 31 K. Adisesha 2
  • 3. Assembly Language Programs 3) PROGRAM TO ADD TWO 16 BIT NUMBERS Sl no. ADDRESS HEX CODE LABEL MNEMONICS COMMENTS 1 8000 AF XRA A Clear accumulator and Flag 2 8001 2A, 00, F0 LHLD F000 Load memory from specified locations 3 8004 EB XCHG Exchange contents of HL & DE pairs 4 8005 2A,00,F1 LHLD F100 Load memory from specified locations 5 8008 19 DAD D Add HL & DE pairs 6 8009 22,00,F2 SHLD F200 Store memory to specified locations 7 800C D2,10,80 JNC (Ahead) Jump on no carry to ahead address 8 800F 3C INR A Increment contents of accumulator by one 9 8010 32,02,F2 Ahead STA F202 Store contents of [A] in specified location 10 8013 CF RST1 Restart F001: F000 (X) 4A : 2C F101: F100 (Y) ED : 5B F202:F201: F200 (X+Y) 01 : 37 : 87 K. Adisesha 3
  • 4. Assembly Language Programs 4) PROGRAM TO SUBTRACT TWO 16 BIT NUMBERS (X>Y) Sl no. ADDRESS HEX CODE LABEL MNEMONICS COMMENTS 1 8000 2A,00,F0 LHLD F000 Load memory from specified locations 2 8003 EB XCHG Exchange contents of HL & DE pairs 3 8004 2A,00,F1 LHLD F100 Load memory from specified locations 4 8007 7D MOV A, L Move contents of [L] to [A] 5 8008 93 SUB E Subtract [E] from [A] 6 8009 32,00,F2 STA F200 Store result in specified location 7 800C 7C MOV A, H Move contents of [H] to [A] 8 800D 9A SBB D Subtract [D] from [A] with borrow 9 800E 32,01,F2 STA F201 Store result in specified location 10 8011 CF RST 1 Restart F001: F000 (X) FA : 2C F101: F100 (Y) BD : 5B F202:F201: F200 (X-Y) 3C : D1 K. Adisesha 4
  • 5. Assembly Language Programs 5) PROGRAM TO ADD TWO N BYTE NUMBERS Sl no. ADDRESS HEX CODE LABEL MNEMONICS COMMENTS 1 8000 21,00,F0 LXIH F000 Load HL pair with specified data 2 8003 01,00,F1 LXIB F100 Load BC pair with specified data 3 8006 11,00,F2 LXID F200 Load DE pair with specified data 4 8009 3E,(NN) MVI A, (NN) Specify the number of bytes 5 800B 32,00,81 LOOP STA 8100 Save the count 6 800E AF XRA A Clear accumulator and flags 7 800F 0A LDAX B Load [A] indirectly from address specified by BC pair 8 8010 8E ADC M Add memory to [A] with carry 9 8011 12 STAX D Store contents of [A] indirectly in location specified by DE pair 10 8012 23 INX H Update memory 11 8013 03 INX B Update BC register pair 12 8014 13 INX D Update DE register pair 13 8015 3A,00,81 LDA 8100 Load [A] from specified location 14 8018 3D DCR A Decrement count 15 8019 C2,0B,80 JNZ (LOOP) Jump on no zero to perform loop 16 801C D2,24,80 JNC (Ahead 1) Jump on no carry to ahead address 17 801F 3E,01 MVI A, 01 Move immediately to [A] the data(01)H 18 8021 C3,26,80 JMP (Ahead 2) Jump unconditionally to ahead address 19 8024 3E,00 Ahead 1 MVI A, 00 Move immediately to [A] the data(00)H 20 8026 12 Ahead 2 STAX D Store contents of [A] indirectly in address specified by DE pair 21 8027 CF RST 1 Restart K. Adisesha 5
  • 6. Assembly Language Programs INPUT(X) F103 : F102 : F101 : F100 A4 : E6 : F3 : D7 INPUT(Y) F003 : F002 : F001 : F000 C3 : 54 : A2 : 1B OUTPUT(X+Y) F204:F203 : F202 : F201 : F200 01: 68 : 3B: 95: F2 K. Adisesha 6
  • 7. Assembly Language Programs 6) PROGRAM FOR BLOCK TRANSFER Sl no. ADDRESS HEX CODE LABEL MNEMONICS COMMENTS 1 8000 16,10 MVI D, (10)H Set count in [D] 2 8002 21,00,81 LXIH 8100 Load HL pair with specified address 3 8005 01,00,82 LXIB 8200 Load BC pair with specified address 4 8008 7E LOOP MOV A,M Move contents of memory to [A] 5 8009 02 STAX B Store contents of [A] indirectly to location specified by BC pair 6 800A 23 INX H Update memory 7 800B 03 INX B Update BC pair 8 800C 15 DCR D Decrement count in [D] 9 800D C2,08,80 JNZ (LOOP) Jump on no zero to perform the loop 10 8010 CF RST1 Restart INPUT 8100:810:8102:8103:8104:8105:8106:8107:8108:8109:810A:810B:810C:810D:810E:810F 00 : 01: 02 : 03 : 04 : 05 : 06 : 07 : 08 : 09 : 0A : 0B : 0C : 0D : 0E : 0F OUTPUT 8200:8201:8202:8203:8204:8205:8206:8207:8208:8209:820A:820B:820C:820D:820E:820F 00 : 01: 02 : 03 : 04 : 05 : 06 : 07 : 08 : 09 : 0A : 0B : 0C : 0D : 0E : 0F K. Adisesha 7
  • 8. Assembly Language Programs 7) PROGRAM TO BLOCK TRANSFER IN REVERSE ORDER Sl no. ADDRESS HEX CODE LABEL MNEMONICS COMMENTS 1 8000 16,10 MVI D, (10)H Set count in [D] 2 8002 21,00,81 LXIH 8100 Load HL pair with specified address 3 8005 01,0F,82 LXIB 820F Load BC pair with specified address 4 8008 7E LOOP MOV A,M Move contents of memory to [A] 5 8009 02 STAX B Store contents of [A] indirectly to location specified by BC pair 6 800A 23 INX H Update memory 7 800B 0B DCX B Decrement BC pair by one 8 800C 15 DCR D Decrement count in [D] 9 800D C2,08,80 JNZ (LOOP) Jump on no zero to perform the loop 10 8010 CF RST1 Restart INPUT 8100:810:8102:8103:8104:8105:8106:8107:8108:8109:810A:810B:810C:810D:810E:810F 00 : 01: 02 : 03 : 04 : 05 : 06 : 07 : 08 : 09 : 0A : 0B : 0C : 0D : 0E : 0F OUTPUT 820F:820E:820D:820C:820B:820A:8209:8208:8207:8206:8205:8204:8203:8202:8201:8200 0F : 0E : 0D : 0C : 0B : 0A : 09 : 08 : 07 : 06 : 05 : 04 : 03 : 02 : 01 : 00 K. Adisesha 8
  • 9. Assembly Language Programs 8) PROGRAM TO ADD N DECIMAL NUMBERS (N= 10) INPUT OUTPUT 8100:810:8102:8103:8104:8105:8106:8107:8108:8109 F201 F200 00 : 01: 02 : 03 : 04 : 05 : 06 : 07 : 08 : 09 00 45 Sl no. ADDRESS HEX CODE LABEL MNEMONICS COMMENTS 1 8000 AF XRA A Clear accumulator and flags 2 8001 0E,0A MVI C, (0A)H Set N count in [C] 3 8003 16,00 MVI D , 00 Clear [D] 4 8005 21,00,81 LXIH 8100 Load HL pair with specified data 5 8008 86 LOOP ADD M Add memory to [A] 6 8009 27 DAA Decimal adjust accumulator 7 800A D2,0E,80 JNC(Ahead) Jump on no carry to ahead address 8 800D 14 INR D Increment [D] by one 9 800E 23 Ahead INX H Update memory 10 800F 0D DCR C Decrement count 11 8010 C2,08,80 JNZ(LOOP) Jump on no zero to perform loop 12 8013 6F MOV L,A Move [A] to [L] 13 8014 62 MOV H,D Move [D] to [H] 14 8015 22,00,F2 SHLD F200 Store contents of HL pair to specified consecutive locations 15 8018 CF RST 1 Restart K. Adisesha 9
  • 10. Assembly Language Programs 9) PROGRAM FOR ADDITION OF HEXA-DECIMAL NUMBERS UNTILL ‘FF’ IS ENCOUNTERED Sl no. ADDRESS HEX CODE LABEL MNEMONICS COMMENTS 1 8000 AF XRA A Clear accumulator and flags 2 8001 32,F9,FF LOOP STA FFF9 Store contents of accumulator in specified location 3 8004 F5 PUSH PSW Push [A] and flags to stack 4 8005 CD,D3,06 CALL(UPDDT) Call display subroutine for data field 5 8008 11,FF,FF LXID FFFF Implement a delay of 0.5 s using 6 800B CD,BE,04 CALL(DELAY) monitor delay subroutine 7 800E F1 POP PSW Pop[A] and flags off stack 8 800F 3C INR A Increment contents of [A] by one 9 8010 C2,01,80 JNZ (LOOP) Perform the loop until [A] becomes zero 10 8013 76 HLT Halt OUTPUT: ‘00’ up to ‘FF’ is displayed in data field. K. Adisesha 10
  • 11. Assembly Language Programs 10) PROGRAM FOR FOUR DIGIT BCD ADDITION Sl no. ADDRESS HEX CODE LABEL MNEMONICS COMMENTS 1 8000 21,00,F0 LXIH F000 Load HL pair with specified data 2 8003 01,00,F1 LXIB F100 Load BC pair with specified data 3 8006 11,00,F2 LXID F200 Load DE pair with specified data 4 8009 3E,02 MVI A, (02) Specify the number of bytes 5 800B 32,00,81 LOOP STA 8100 Save the count 6 800E 0A LDAX B Load [A] indirectly from address specified by BC pair 7 800F 8E ADC M Add memory to [A] with carry 8 8010 27 DAA Decimal adjust accumulator 9 8011 12 STAX D Store contents of [A] indirectly in location specified by DE pair 10 8012 23 INX H Update memory 11 8013 03 INX B Update BC register pair 12 8014 13 INX D Update DE register pair 13 8015 3A,00,81 LDA 8100 Load [A] from specified location 14 8018 3D DCR A Decrement count 15 8019 C2,0B,80 JNZ (LOOP) Jump on no zero to perform loop 16 801C D2,24,80 JNC (Ahead 1) Jump on no carry to ahead address Move immediately to [A] the 17 801F 3E,01 MVI A, 01 data(01)H Jump unconditionally to ahead 18 8021 C3,26,80 JMP (Ahead 2) address Move immediately to [A] the 19 8024 3E,00 Ahead 1 MVI A, 00 data(00)H Store contents of [A] indirectly in 20 8026 12 Ahead 2 STAX D address specified by DE pair Restart 21 8027 CF RST 1 K. Adisesha 11
  • 12. Assembly Language Programs INPUT(X) F101 : F100 57 : 93 INPUT(Y) F001 : F000 64 : 21 OUTPUT(X+Y) F202 : F201 : F200 01: 22 : 14 K. Adisesha 12
  • 13. Assembly Language Programs 11) PROGRAM TO FIND 2`S COMPLEMENT OF 8 BIT/ 16 BIT NUMBER Sl no. ADDRESS HEX CODE LABEL MNEMONICS COMMENTS 1 8000 06,01/(02) MVI B,01/(02) Move to [B] (01) for 8-bit & (02) for 16-bit complement of data 2 8002 11,01,00 LXID 0001 Load DE pair with specified data 3 8005 21,00,F0 LXIH F000 Load HL pair with specified data 4 8008 7E LOOP MOV A,M Copy contents of memory to [A] 5 8009 2F CMA Complement contents of [A] 6 800A 77 MOV M,A Copy contents of [A] to memory 7 800B 05 DCR B Decrement [B] by one 8 800C CA, 13,80 JZ (Ahead) Jump on zero to ahead address 9 800F 23 INX H Update memory 10 8010 C3,08,80 JMP(Loop) Jump unconditionally to perform loop 11 8013 2A,00,F0 Ahead LHLD F000 Load contents of HL pair from specified locations 12 8016 19 DAD D Add HL and DE pair of registers 13 8017 22,00,F1 SHLD F100 Store contents of HL pair to specified locations 14 801A CF RST 1 Restart DATA INPUT OUTPUT(2`s complement) K. Adisesha 13
  • 14. Assembly Language Programs 8-Bit F000 : 7A F100 : 87 16-Bit F001 : F000 :: 1A: 26 F101 : F100 :: E5: DA 12) PROGRAM FOR SUB TRACTION OF TWO 16-BIT BCD NUMBERS (X>Y) Sl no. ADDRESS HEX CODE LABEL MNEMONICS COMMENTS 1 8000 11,86,97 LXID(9786) Load DE pair with specified data 2 8003 01,59,32 LXIB(3259) Load BC pair with specified data 3 8006 CD,20, 80 CALL(Sub-BCD) Call subroutine for BCD subtraction 4 8009 6F MOV L,A Copy contents of [A] to [L] 5 800C 5A MOV E,D Copy contents of [D] to [E] 6 800D 48 MOV C,B Copy contents of [B] to [C] 7 800E CD,20,80 CALL(Sub-BCD) Call subroutine for BCD subtraction 8 800F 67 MOV H,A Copy contents of [A] to [H] 9 8012 22,00,F0 SHLD F000 Store contents of HL pair to specified locations 10 8013 CF RST 1 Restart 12 8020 3E,99 Sub-BCD MVI A,99 Move to [A] the given data to subtract using 99` complement 13 8017 93 SUB E Subtract [E] from [A] 14 8018 3C INR A Increment [A] by 1 15 8019 81 ADD C Add [C] to [A] 16 801A 27 DAA Decimal adjust accumulator 17 801B C9 RET Return from subroutine unconditionally K. Adisesha 14
  • 15. Assembly Language Programs OUTPUT F001: F000 :: 65 : 27 13) PROGRAM FOR BLOCK EXCHANGE Sl no. ADDRESS HEX CODE LABEL MNEMONICS COMMENTS 1 8000 21,00,F0 LXIH F000 Load HL pair with specified address 2 8003 11,00,F1 LXID F100 Load HL pair with specified address 3 8006 0E,10 MVI C,(10)H Set counter in [C] for N counts 4 8008 1A LOOP LDAX D Load [A] indirectly from address indicated by DE pair 5 8009 46 MOV B,M Copy contents of memory to[B] 6 800A 77 MOV M,A Copy contents of [A] to memory 7 800B 78 MOV A,B Copy contents of [B] to [A] 8 800C 12 STAX D Store contents of [A] indirectly onto address in DE pair 9 800D 23 INX H Update memory 10 800E 13 INX D Update DE register pair 11 800F 0D DCR C Decrement [C] by 1 12 8010 C2,08,80 JNZ(Loop) Perform the loop until [C] becomes zero 13 8013 CF RST 1 Restart INPUT F000:F001:F002:F003:F004:F005:F006:F007:F008:F009:F00A:F00B:F00C:F00D:F00E:F00F 00 : 01 : 02 : 03 : 04 : 05 : 06 : 07 : 08 : 09 : 0A : 0B : 0C : 0D : 0E : 0F F100:F101:F102:F103:F104:F105:F106:F107:F108:F109:F10A:F10B:F10C:F10D:F10E:F10F K. Adisesha 15
  • 16. Assembly Language Programs 10 : 11 : 12 : 13 : 14 : 15 : 16 : 17 : 18 : 19 : 1A : 1B : 1C : 1D : 1E : 1F F000:F001:F002:F003:F004:F005:F006:F007:F008:F009:F00A:F00B:F00C:F00D:F00E:F00F 10 : 11 : 12 : 13 : 14 : 15 : 16 : 17 : 18 : 19 : 1A : 1B : 1C : 1D : 1E : 1F F100:F101:F102:F103:F104:F105:F106:F107:F108:F109:F10A:F10B:F10C:F10D:F10E:F10F 00 : 01 : 02 : 03 : 04 : 05 : 06 : 07 : 08 : 09 : 0A : 0B : 0C : 0D : 0E : 0F OUTPUT K. Adisesha 16
  • 17. Assembly Language Programs 14) PROGRAM FOR SORTING AN ARRAY OF ‘N-NUMBERS’ IN ASCENDING ORDER K. Adisesha 17
  • 18. Assembly Language Programs INPUT F100:F101:F102:F103:F104:F105:F106:F107:F108:F109 0A : 01 : 09 : 05 : 03 : 06 : 08 : 07 : 04 : 02 Sl no. ADDRESS HEX CODE LABE MNEMONICS COMMENTS L 1 8000 AF XRA A Clear accumulator & flags 2 8001 06,0B MVI B,0B Move a count (N+1) in [B] 3 8003 48 START MOV C,B Copy contents of [B] to [C] 4 8004 0D DCR C Decrement contents of [C] by one 5 8005 21,00,F1 LXIH F100 Load the specified address in HL pair 6 8008 7E LOOP MOV A,M Copy contents of [M] to [A] 7 8009 23 INX H Update memory 8 800A BE CMP M Compare memory with accumulator 9 800B DA,13,80 JC (AHEAD) Jump on carry to ahead address 10 800E 56 MOV D,M Copy contents of [M] to [D] 11 800F 77 MOV M,A Copy contents of [A] to [M] 12 8010 2B DCX H Decrement HL pair by one 13 8011 72 MOV M,D Copy contents of [D] to [M] 14 8012 23 INX H Increment contents of HL pair by one 15 8013 0D AHEAD DCR C Decrement contents of [C] by one 16 8014 C2,08,80 JNZ (LOOP) Jump on no zero to perform the loop 17 8017 05 DCR B Decrement count in [B] 18 8018 C2,03,80 JNZ (START) Jump on no zero to specified address 19 801B CF RST 1 Restart K. Adisesha 18
  • 19. Assembly Language Programs OUTPUT F100:F101:F102:F103:F104:F105:F106:F107:F108:F109 01 : 02 : 03 : 04 : 05 : 06 : 07 : 08 : 09 : 0A 15) PROGRAM TO CHECK 2-OUT-OF-5 CODE K. Adisesha 19
  • 20. Assembly Language Programs Sl no. ADDRESS HEX CODE LABEL MNEMONICS COMMENTS Sl no. ADDRESS HEX CODE LABEL MNEMONICS COMMENTS 1 8000 3A,00,F0 LDA F000 Load data into accumulator from specified location 2 8003 0E,05 MVI C,05 Move a count (05)H in [C] 3 8005 16,00 MVI D,00 Clear contents of [D] 4 8007 E6,E0 ANI E0 Logical AND (E0) H with [A] 5 8009 C2,23,80 JNZ (AHEAD 1) Jump on no zero to specified address 6 800C 3A,00,F0 LDA F000 Load data into accumulator from specified location 7 800F 0F LOOP RRC Rotate contents of [A] to right 8 8010 D2,14,80 JNC(AHEAD 2) Jump on no carry to ahead address 9 8013 14 INR D Increment count in [D] 10 8014 0D AHEAD 2 DCR C Decrement contents of [C] by one 11 80015 C2,0F,80 JNZ(LOOP) Jump on no zero to perform the loop 12 8018 7A MOV A,D Copy contents of [D] to [A] 13 8019 FE,02 CPI ,02 Compare (02) H immediately with [A] 14 801B C2,23,80 JNZ(AHEAD 1) Jump on no zero to specified address 15 801E 3E,FF MVI A, FF Move ‘FF’ to [A] immediately 16 8020 C2,25,80 JMP(AHEAD 3) Jump to specified location unconditionally 17 8023 3E,00 AHEAD 1 MVI A, 00 Move ‘00’ to [A] immediately 18 8025 32,00,F1 AHEAD 3 STA F100 Store data from accumulator into specified location 19 8028 CF RST 1 Restart INPUT OUTPUT F000: 11 F100: FF F000: 13 F100: 00 16) PROGRAM TO MULTIPLY TWO DIGIT BCD K. Adisesha 20
  • 21. Assembly Language Programs 1 8000 21,00,00 LXIH (0000 )H Move a count (0000)H in HL pair 2 8003 3A,00,F0 LDA F000 Load data into accumulator from specified location 3 8006 47 MOV B,A Copy contents of [A] to [B] 4 8007 3A,01,F0 LDA F001 Load data into accumulator from specified location 5 800A 4F MOV C,A Copy contents of [A] to [C] 6 800B 79 START MOV A,C Copy contents of [C] to [A] 7 800C 85 ADD L Add [L] to accumulator 8 800D 27 DAA Decimal adjust [A] 9 800E 6F MOV L,A Copy contents of [A] to [L] 10 800F 3E,00 MVI A,00 Clear contents of [A] 11 80011 8C ADC H Add contents of [H] to [A] 12 8012 27 DAA Decimal adjust [A] 13 8013 67 MOV H,A Copy contents of [A] to [H] 14 8014 78 MOV A,B Copy contents of [B] to [A] 15 8015 C6,99 ADI ,99 Add immediately to accumulator 99 16 8017 27 DAA Decimal adjust [A] 17 8018 47 MOV B,A Copy contents of [A] to [B] 18 8019 C2,0B,80 JNZ(START) Jump on no zero to specified address 19 801C 22,00,F1 SHLD(F100) Store data from HL pair onto specified location 20 801F CF RST 1 Restart INPUT OUTPUT F001: F000 F101: F100 11 : 12 01 : 32 K. Adisesha 21