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

; Q 9>
;   a>      Determine the range of signed numbers the uP can handle
    SW          2000h
                [2000h]     =   (ans)       ; Minimum signed number
                [2002h]     =   (ans)       ; Maximum signed number
                .

      A
      1000h
          mov      cl, 04h
          mov      ax, 0008h
          loop_min:
          or       ax, ax
          js       num_min
          shl      ax, cl
          jmp      loop_min
          num_min:
          mov      [2000h], ax
          not      ax
          mov      [2002h], ax
          hlt
          .

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

      SW           2000h                                        ; ans = 8000h => -32768
      SW           2002h                                        ; ans = 7FFFh => 32767
      .




;     b>    Determine the range of unsigned numbers the uP can handle
      SW        2000h
                [2000h]     =   (ans)       ; Minimum unsigned number
                [2002h]     =   (ans)       ; Maximum unsigned number
                .

      A
      1000h
          mov            ax, 0000h
          mov            [2000h], ax
          not            ax
          mov            [2002h], ax
          hlt
          .

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

      SW           2000h                                        ; ans = 00000h => 0
      SW           2002h                                        ; ans = 0FFFFh => 65535
      .

                                                                             -1-

More Related Content

What's hot

8086 instructions
8086 instructions8086 instructions
8086 instructions
Ravi Anand
 
Assembly language (addition and subtraction)
Assembly language (addition and subtraction)Assembly language (addition and subtraction)
Assembly language (addition and subtraction)
Muhammad Umar Farooq
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 Microprocessor
Ashita Agrawal
 
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
warda aziz
 
Assembly Language Lecture 4
Assembly Language Lecture 4Assembly Language Lecture 4
Assembly Language Lecture 4
Motaz Saad
 
instruction set of 8086
instruction set of 8086instruction set of 8086
instruction set of 8086
muneer.k
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
Tirumalesh Nizampatnam
 
8086 instruction set
8086 instruction set8086 instruction set
8086 instruction set
Sazzad Hossain
 
Logical Instructions used in 8086 microprocessor
Logical Instructions used in 8086 microprocessorLogical Instructions used in 8086 microprocessor
Logical Instructions used in 8086 microprocessor
Rabin BK
 
Push down automata
Push down automataPush down automata
Push down automata
Ratnakar Mikkili
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 80869840596838
 
8086 instruction set
8086 instruction set8086 instruction set
8086 instruction set
Alamin Hossain Miraje
 
10 8086 instruction set
10 8086 instruction set10 8086 instruction set
10 8086 instruction setShivam Singhal
 
Ascii adjust & decimal adjust
Ascii adjust & decimal adjustAscii adjust & decimal adjust
Ascii adjust & decimal adjustTech_MX
 
Microprocessor 8086 instructions
Microprocessor 8086 instructionsMicroprocessor 8086 instructions
Microprocessor 8086 instructions
Ravi Anand
 
Pda
PdaPda
8086 instruction set
8086 instruction set8086 instruction set
8086 instruction setjemimajerome
 
Push down automata
Push down automataPush down automata
Push down automataSomya Bagai
 
8086 microprocessor instruction set by Er. Swapnil Kaware
8086 microprocessor instruction set by Er. Swapnil Kaware8086 microprocessor instruction set by Er. Swapnil Kaware
8086 microprocessor instruction set by Er. Swapnil KawareProf. Swapnil V. Kaware
 
Binary and hex input/output (in 8086 assembuly langyage)
Binary and hex input/output (in 8086 assembuly langyage)Binary and hex input/output (in 8086 assembuly langyage)
Binary and hex input/output (in 8086 assembuly langyage)
Bilal Amjad
 

What's hot (20)

8086 instructions
8086 instructions8086 instructions
8086 instructions
 
Assembly language (addition and subtraction)
Assembly language (addition and subtraction)Assembly language (addition and subtraction)
Assembly language (addition and subtraction)
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 Microprocessor
 
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
 
Assembly Language Lecture 4
Assembly Language Lecture 4Assembly Language Lecture 4
Assembly Language Lecture 4
 
instruction set of 8086
instruction set of 8086instruction set of 8086
instruction set of 8086
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
8086 instruction set
8086 instruction set8086 instruction set
8086 instruction set
 
Logical Instructions used in 8086 microprocessor
Logical Instructions used in 8086 microprocessorLogical Instructions used in 8086 microprocessor
Logical Instructions used in 8086 microprocessor
 
Push down automata
Push down automataPush down automata
Push down automata
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
8086 instruction set
8086 instruction set8086 instruction set
8086 instruction set
 
10 8086 instruction set
10 8086 instruction set10 8086 instruction set
10 8086 instruction set
 
Ascii adjust & decimal adjust
Ascii adjust & decimal adjustAscii adjust & decimal adjust
Ascii adjust & decimal adjust
 
Microprocessor 8086 instructions
Microprocessor 8086 instructionsMicroprocessor 8086 instructions
Microprocessor 8086 instructions
 
Pda
PdaPda
Pda
 
8086 instruction set
8086 instruction set8086 instruction set
8086 instruction set
 
Push down automata
Push down automataPush down automata
Push down automata
 
8086 microprocessor instruction set by Er. Swapnil Kaware
8086 microprocessor instruction set by Er. Swapnil Kaware8086 microprocessor instruction set by Er. Swapnil Kaware
8086 microprocessor instruction set by Er. Swapnil Kaware
 
Binary and hex input/output (in 8086 assembuly langyage)
Binary and hex input/output (in 8086 assembuly langyage)Binary and hex input/output (in 8086 assembuly langyage)
Binary and hex input/output (in 8086 assembuly langyage)
 

Similar to Up 8086 q9

[ASM]Lab7
[ASM]Lab7[ASM]Lab7
[ASM]Lab7
Nora Youssef
 
鉛蓄電池のスパイスモデル
鉛蓄電池のスパイスモデル鉛蓄電池のスパイスモデル
鉛蓄電池のスパイスモデル
Tsuyoshi Horigome
 
C for Microcontrollers
C for MicrocontrollersC for Microcontrollers
C for Microcontrollers
LloydMoore
 

Similar to Up 8086 q9 (10)

Up 8086 q2
Up 8086 q2Up 8086 q2
Up 8086 q2
 
Up 8086 q6
Up 8086 q6Up 8086 q6
Up 8086 q6
 
Up 8086 q3
Up 8086 q3Up 8086 q3
Up 8086 q3
 
Up 8086 q1
Up 8086 q1Up 8086 q1
Up 8086 q1
 
Up 8086 q4
Up 8086 q4Up 8086 q4
Up 8086 q4
 
Up 8086 q7
Up 8086 q7Up 8086 q7
Up 8086 q7
 
[ASM]Lab7
[ASM]Lab7[ASM]Lab7
[ASM]Lab7
 
鉛蓄電池のスパイスモデル
鉛蓄電池のスパイスモデル鉛蓄電池のスパイスモデル
鉛蓄電池のスパイスモデル
 
8255
82558255
8255
 
C for Microcontrollers
C for MicrocontrollersC for Microcontrollers
C for Microcontrollers
 

More from Subhajit Sahu

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

More from Subhajit Sahu (20)

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

Up 8086 q9

  • 1. C:HomeNIT0_ClassAutumn 2012Microprocessor Labup Programs8086up_8086_Q9.asm 05 August 2012 15:40 ; Q 9> ; a> Determine the range of signed numbers the uP can handle SW 2000h [2000h] = (ans) ; Minimum signed number [2002h] = (ans) ; Maximum signed number . A 1000h mov cl, 04h mov ax, 0008h loop_min: or ax, ax js num_min shl ax, cl jmp loop_min num_min: mov [2000h], ax not ax mov [2002h], ax hlt . GO 1000h INT ;(try '.' here) SW 2000h ; ans = 8000h => -32768 SW 2002h ; ans = 7FFFh => 32767 . ; b> Determine the range of unsigned numbers the uP can handle SW 2000h [2000h] = (ans) ; Minimum unsigned number [2002h] = (ans) ; Maximum unsigned number . A 1000h mov ax, 0000h mov [2000h], ax not ax mov [2002h], ax hlt . GO 1000h INT ;(try '.' here) SW 2000h ; ans = 00000h => 0 SW 2002h ; ans = 0FFFFh => 65535 . -1-