SlideShare a Scribd company logo
C:HomeNIT0_ClassAutumn 2012Microprocessor Labup Programs8086up_8086_Q7.asm   05 August 2012 15:08

; Q 7>      Multiplication of 2 32bit signed numbers
    SW          2000h
                [2000h]     =   05EE0h      ; A = -500000
                [2002h]     =   0FFF8h      ;
                [2004h]     =   04240h      ; B = 1000000
                [2006h]     =   0000Fh      ;
                [2008h]     =   (ans)       ; C = (A * B)
                [200Ah]     =   (ans)       ;
                [200Ch]     =   (ans)       ;
                [200Eh]     =   (ans)       ;
                .

      A
      1000h
          mov            ax, 0000h
          mov            ax, [2000h]
          mov            bx, [2004h]
          imul           bx
          mov            [2008h], ax
          mov            [200Ah], dx
          mov            cl, 08h
          sar            dx, cl
          mov            dl, dh
          mov            [200Ch], dx
          mov            [200Eh], dx
          mov            ax, [2000h]
          mov            bx, [2006h]
          imul           bx
          add            [200Ah], ax
          adc            [200Ch], dx
          sar            dx, cl
          mov            dl, dh
          adc            [200Eh], dx
          mov            ax, [2002h]
          mov            bx, [2004h]
          imul           bx
          add            [200Ah], ax
          adc            [200Ch], dx
          sar            dx, cl
          mov            dl, dh
          adc            [200Eh], dx
          mov            ax, [2002h]
          mov            bx, [2006h]
          imul           bx
          add            [200Ch], ax
          adc            [200Eh], dx
          hlt
          .

      GO           1000h
      INT                                    ;(try '.' here)

      SW           2008h                                        ; ans = 07800h

                                                                             -1-
C:HomeNIT0_ClassAutumn 2012Microprocessor Labup Programs8086up_8086_Q7.asm     05 August 2012 15:08

      SW           200Ah                                        ;   ans = 095ADh
      SW           200Ch                                        ;   ans = 0FF8Bh
      SW           200Eh                                        ;   ans = 0FFFFh
      .                                                         ;   => -500000000000




                                                                             -2-

More Related Content

PDF
Up 8086 q3
PDF
Up 8086 q2
PDF
Up 8086 q6
PDF
National Examinations 2010, QAAET, Bahrain, Maths, G6, paper 1 Q
PDF
National Examinations 2010, Arabic,QAAET,Bahrain, G6, paper 2 Q
PDF
National Examinations 2010, QAAET, Bahrain, Science, grade 6, paper 2
PDF
National Examinaitons 2010, QAAET, Bahrain, Science, grade 6, paper 1 Q
PDF
National Examinations 2010, QAAET, Bahrain, Arabic, grade 9 ,paper 2
Up 8086 q3
Up 8086 q2
Up 8086 q6
National Examinations 2010, QAAET, Bahrain, Maths, G6, paper 1 Q
National Examinations 2010, Arabic,QAAET,Bahrain, G6, paper 2 Q
National Examinations 2010, QAAET, Bahrain, Science, grade 6, paper 2
National Examinaitons 2010, QAAET, Bahrain, Science, grade 6, paper 1 Q
National Examinations 2010, QAAET, Bahrain, Arabic, grade 9 ,paper 2

More from Subhajit Sahu (20)

PDF
About TrueTime, Spanner, Clock synchronization, CAP theorem, Two-phase lockin...
PDF
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
PDF
Adjusting Bitset for graph : SHORT REPORT / NOTES
PDF
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
PDF
Adjusting primitives for graph : SHORT REPORT / NOTES
PDF
Experiments with Primitive operations : SHORT REPORT / NOTES
PDF
PageRank Experiments : SHORT REPORT / NOTES
PDF
Algorithmic optimizations for Dynamic Monolithic PageRank (from STICD) : SHOR...
PDF
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
PDF
word2vec, node2vec, graph2vec, X2vec: Towards a Theory of Vector Embeddings o...
PDF
DyGraph: A Dynamic Graph Generator and Benchmark Suite : NOTES
PDF
Shared memory Parallelism (NOTES)
PDF
A Dynamic Algorithm for Local Community Detection in Graphs : NOTES
PDF
Scalable Static and Dynamic Community Detection Using Grappolo : NOTES
PDF
Application Areas of Community Detection: A Review : NOTES
PDF
Community Detection on the GPU : NOTES
PDF
Survey for extra-child-process package : NOTES
PDF
Dynamic Batch Parallel Algorithms for Updating PageRank : POSTER
PDF
Abstract for IPDPS 2022 PhD Forum on Dynamic Batch Parallel Algorithms for Up...
PDF
Fast Incremental Community Detection on Dynamic Graphs : NOTES
About TrueTime, Spanner, Clock synchronization, CAP theorem, Two-phase lockin...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Adjusting Bitset for graph : SHORT REPORT / NOTES
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Adjusting primitives for graph : SHORT REPORT / NOTES
Experiments with Primitive operations : SHORT REPORT / NOTES
PageRank Experiments : SHORT REPORT / NOTES
Algorithmic optimizations for Dynamic Monolithic PageRank (from STICD) : SHOR...
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
word2vec, node2vec, graph2vec, X2vec: Towards a Theory of Vector Embeddings o...
DyGraph: A Dynamic Graph Generator and Benchmark Suite : NOTES
Shared memory Parallelism (NOTES)
A Dynamic Algorithm for Local Community Detection in Graphs : NOTES
Scalable Static and Dynamic Community Detection Using Grappolo : NOTES
Application Areas of Community Detection: A Review : NOTES
Community Detection on the GPU : NOTES
Survey for extra-child-process package : NOTES
Dynamic Batch Parallel Algorithms for Updating PageRank : POSTER
Abstract for IPDPS 2022 PhD Forum on Dynamic Batch Parallel Algorithms for Up...
Fast Incremental Community Detection on Dynamic Graphs : NOTES
Ad

Up 8086 q7

  • 1. C:HomeNIT0_ClassAutumn 2012Microprocessor Labup Programs8086up_8086_Q7.asm 05 August 2012 15:08 ; Q 7> Multiplication of 2 32bit signed numbers SW 2000h [2000h] = 05EE0h ; A = -500000 [2002h] = 0FFF8h ; [2004h] = 04240h ; B = 1000000 [2006h] = 0000Fh ; [2008h] = (ans) ; C = (A * B) [200Ah] = (ans) ; [200Ch] = (ans) ; [200Eh] = (ans) ; . A 1000h mov ax, 0000h mov ax, [2000h] mov bx, [2004h] imul bx mov [2008h], ax mov [200Ah], dx mov cl, 08h sar dx, cl mov dl, dh mov [200Ch], dx mov [200Eh], dx mov ax, [2000h] mov bx, [2006h] imul bx add [200Ah], ax adc [200Ch], dx sar dx, cl mov dl, dh adc [200Eh], dx mov ax, [2002h] mov bx, [2004h] imul bx add [200Ah], ax adc [200Ch], dx sar dx, cl mov dl, dh adc [200Eh], dx mov ax, [2002h] mov bx, [2006h] imul bx add [200Ch], ax adc [200Eh], dx hlt . GO 1000h INT ;(try '.' here) SW 2008h ; ans = 07800h -1-
  • 2. C:HomeNIT0_ClassAutumn 2012Microprocessor Labup Programs8086up_8086_Q7.asm 05 August 2012 15:08 SW 200Ah ; ans = 095ADh SW 200Ch ; ans = 0FF8Bh SW 200Eh ; ans = 0FFFFh . ; => -500000000000 -2-