SlideShare a Scribd company logo
1 of 3
Needs to be in ARM Assembly language (using Keil uVision5), Please Help!!
To practice with conditional branch instructions, write an ARM Assembly program counts the
number of negative, zero, and positive non-zero numbers in a list of 20 signed 32-bit integers,
and also find the minimum and maximum values. As shown below, the list is to be stored in
RAM beginning at location LIST1. Write the number of zero, negative, and positive non-zero
values to 8-bit variables NZER1, NNEG1, and NPOS1, respectively, and write the minimum and
maximum values in 32-bit variables MIN1 and MAX1, respectively. You should be able to
determine all five values within a single program loop, with the loop repeated 20 times.
Test data:
LIST1 dcd 5,-8,20,15,-20,83,125,-107,0,35,14,-19,-30,0,35,-8,-6,22,0,-1
MIN1 dcd 0
MAX1 dcd 0
NZER1 dcb 0
NNEG1 dcb 0
NPOS1 dcb 0
Please, Please help if you can!! Thank You!
Solution
data segment
list1 equ 2000h
nzer1dw 0000h
npos1 dw 0000h
nneg1 dw 0000h
max db ?
min db ?
data ends
code segment
assume cs: code, ds:data
org 1000
start:
mov si,list1
mov cl,[si]
mov dl,[si]
next :inc si
inc si
mov al,[si]
cmp al,0
jnc pos
jc neg
inc nzer1
dec cl
jnz next
jmp last
pos: inc npos1
loop next jmp last
neg: inc nneg1
loop next
mov si,list1
mov max,[si]
mov min,[si]
nexttt: inc si
inc si
cmp max,[si]
jnc large
cmp min ,[si]
jc small
dec dl
jnz nexttt
jmp last
large: mov max,[si]
small: mov min,[si]

More Related Content

More from altonm

Nuclear disarmament should result in the retrieval of large amounts of.docx
Nuclear disarmament should result in the retrieval of large amounts of.docxNuclear disarmament should result in the retrieval of large amounts of.docx
Nuclear disarmament should result in the retrieval of large amounts of.docx
altonm
 
Often in science it is helpful to talk about a representative example.docx
Often in science it is helpful to talk about a representative example.docxOften in science it is helpful to talk about a representative example.docx
Often in science it is helpful to talk about a representative example.docx
altonm
 

More from altonm (20)

Nuclear disarmament should result in the retrieval of large amounts of.docx
Nuclear disarmament should result in the retrieval of large amounts of.docxNuclear disarmament should result in the retrieval of large amounts of.docx
Nuclear disarmament should result in the retrieval of large amounts of.docx
 
Nomenclature Practice Problems Ch 20 Part I For compounds represented.docx
Nomenclature Practice Problems Ch 20 Part I For compounds represented.docxNomenclature Practice Problems Ch 20 Part I For compounds represented.docx
Nomenclature Practice Problems Ch 20 Part I For compounds represented.docx
 
NO2 is a yellow gas responsible for the brownish haze that builds up p.docx
NO2 is a yellow gas responsible for the brownish haze that builds up p.docxNO2 is a yellow gas responsible for the brownish haze that builds up p.docx
NO2 is a yellow gas responsible for the brownish haze that builds up p.docx
 
No need for any sort of explanation- Please only a straightforward ans.docx
No need for any sort of explanation- Please only a straightforward ans.docxNo need for any sort of explanation- Please only a straightforward ans.docx
No need for any sort of explanation- Please only a straightforward ans.docx
 
No copy and paste from other website- must be in your own words- Thank.docx
No copy and paste from other website- must be in your own words- Thank.docxNo copy and paste from other website- must be in your own words- Thank.docx
No copy and paste from other website- must be in your own words- Thank.docx
 
nidly s wht is ment the er SolutionThe branch of science and technolog.docx
nidly s wht is ment the er SolutionThe branch of science and technolog.docxnidly s wht is ment the er SolutionThe branch of science and technolog.docx
nidly s wht is ment the er SolutionThe branch of science and technolog.docx
 
Newton Inc- uses a calendar year for financial reporting- The company (1).docx
Newton Inc- uses a calendar year for financial reporting- The company (1).docxNewton Inc- uses a calendar year for financial reporting- The company (1).docx
Newton Inc- uses a calendar year for financial reporting- The company (1).docx
 
olecular Forces liquid and sold states- molecules are held together by.docx
olecular Forces liquid and sold states- molecules are held together by.docxolecular Forces liquid and sold states- molecules are held together by.docx
olecular Forces liquid and sold states- molecules are held together by.docx
 
Okay- so I understand questions 1- however I don-'t get how to find ou.docx
Okay- so I understand questions 1- however I don-'t get how to find ou.docxOkay- so I understand questions 1- however I don-'t get how to find ou.docx
Okay- so I understand questions 1- however I don-'t get how to find ou.docx
 
ofa fallowing sormally wuma vp faest wee heot in appliod A) water B) w.docx
ofa fallowing sormally wuma vp faest wee heot in appliod A) water B) w.docxofa fallowing sormally wuma vp faest wee heot in appliod A) water B) w.docx
ofa fallowing sormally wuma vp faest wee heot in appliod A) water B) w.docx
 
Often in science it is helpful to talk about a representative example.docx
Often in science it is helpful to talk about a representative example.docxOften in science it is helpful to talk about a representative example.docx
Often in science it is helpful to talk about a representative example.docx
 
Obstacles in EHRs Implementation Discuss the major local- national- an.docx
Obstacles in EHRs Implementation Discuss the major local- national- an.docxObstacles in EHRs Implementation Discuss the major local- national- an.docx
Obstacles in EHRs Implementation Discuss the major local- national- an.docx
 
o be (11) Explain why an object (like a pencil) that is partially subm.docx
o be (11) Explain why an object (like a pencil) that is partially subm.docxo be (11) Explain why an object (like a pencil) that is partially subm.docx
o be (11) Explain why an object (like a pencil) that is partially subm.docx
 
Numerical Analysis- (Matlab) Write a program that computes an integral.docx
Numerical Analysis- (Matlab) Write a program that computes an integral.docxNumerical Analysis- (Matlab) Write a program that computes an integral.docx
Numerical Analysis- (Matlab) Write a program that computes an integral.docx
 
Yvon- an accountant- is charged with negligence by Zesty Sauce- Inc--.docx
Yvon- an accountant- is charged with negligence by Zesty Sauce- Inc--.docxYvon- an accountant- is charged with negligence by Zesty Sauce- Inc--.docx
Yvon- an accountant- is charged with negligence by Zesty Sauce- Inc--.docx
 
Your host has automatically received an IPv6 address working in conjun.docx
Your host has automatically received an IPv6 address working in conjun.docxYour host has automatically received an IPv6 address working in conjun.docx
Your host has automatically received an IPv6 address working in conjun.docx
 
Your community has decided to construct a hazardous waste facility for.docx
Your community has decided to construct a hazardous waste facility for.docxYour community has decided to construct a hazardous waste facility for.docx
Your community has decided to construct a hazardous waste facility for.docx
 
Young Corporation incurred research and development costs of $500-000.docx
Young Corporation incurred research and development costs of $500-000.docxYoung Corporation incurred research and development costs of $500-000.docx
Young Corporation incurred research and development costs of $500-000.docx
 
You work for a small city IT department- and you are reviewing compute.docx
You work for a small city IT department- and you are reviewing compute.docxYou work for a small city IT department- and you are reviewing compute.docx
You work for a small city IT department- and you are reviewing compute.docx
 
Your CEO is from the old school- What steps would you take to entice h.docx
Your CEO is from the old school- What steps would you take to entice h.docxYour CEO is from the old school- What steps would you take to entice h.docx
Your CEO is from the old school- What steps would you take to entice h.docx
 

Recently uploaded

會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
中 央社
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
中 央社
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
heathfieldcps1
 
IATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdffIATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdff
17thcssbs2
 
Financial Accounting IFRS, 3rd Edition-dikompresi.pdf
Financial Accounting IFRS, 3rd Edition-dikompresi.pdfFinancial Accounting IFRS, 3rd Edition-dikompresi.pdf
Financial Accounting IFRS, 3rd Edition-dikompresi.pdf
MinawBelay
 

Recently uploaded (20)

Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the life
 
factors influencing drug absorption-final-2.pptx
factors influencing drug absorption-final-2.pptxfactors influencing drug absorption-final-2.pptx
factors influencing drug absorption-final-2.pptx
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
Word Stress rules esl .pptx
Word Stress rules esl               .pptxWord Stress rules esl               .pptx
Word Stress rules esl .pptx
 
An Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptxAn Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptx
 
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
 
Post Exam Fun(da) Intra UEM General Quiz - Finals.pdf
Post Exam Fun(da) Intra UEM General Quiz - Finals.pdfPost Exam Fun(da) Intra UEM General Quiz - Finals.pdf
Post Exam Fun(da) Intra UEM General Quiz - Finals.pdf
 
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
 
....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
 
Essential Safety precautions during monsoon season
Essential Safety precautions during monsoon seasonEssential Safety precautions during monsoon season
Essential Safety precautions during monsoon season
 
Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024
 
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 
IATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdffIATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdff
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
Financial Accounting IFRS, 3rd Edition-dikompresi.pdf
Financial Accounting IFRS, 3rd Edition-dikompresi.pdfFinancial Accounting IFRS, 3rd Edition-dikompresi.pdf
Financial Accounting IFRS, 3rd Edition-dikompresi.pdf
 
Discover the Dark Web .pdf InfosecTrain
Discover the Dark Web .pdf  InfosecTrainDiscover the Dark Web .pdf  InfosecTrain
Discover the Dark Web .pdf InfosecTrain
 

Needs to be in ARM Assembly language (using Keil uVision5)- Please Hel.docx

  • 1. Needs to be in ARM Assembly language (using Keil uVision5), Please Help!! To practice with conditional branch instructions, write an ARM Assembly program counts the number of negative, zero, and positive non-zero numbers in a list of 20 signed 32-bit integers, and also find the minimum and maximum values. As shown below, the list is to be stored in RAM beginning at location LIST1. Write the number of zero, negative, and positive non-zero values to 8-bit variables NZER1, NNEG1, and NPOS1, respectively, and write the minimum and maximum values in 32-bit variables MIN1 and MAX1, respectively. You should be able to determine all five values within a single program loop, with the loop repeated 20 times. Test data: LIST1 dcd 5,-8,20,15,-20,83,125,-107,0,35,14,-19,-30,0,35,-8,-6,22,0,-1 MIN1 dcd 0 MAX1 dcd 0 NZER1 dcb 0 NNEG1 dcb 0 NPOS1 dcb 0 Please, Please help if you can!! Thank You! Solution data segment list1 equ 2000h nzer1dw 0000h npos1 dw 0000h nneg1 dw 0000h max db ? min db ? data ends
  • 2. code segment assume cs: code, ds:data org 1000 start: mov si,list1 mov cl,[si] mov dl,[si] next :inc si inc si mov al,[si] cmp al,0 jnc pos jc neg inc nzer1 dec cl jnz next jmp last pos: inc npos1 loop next jmp last neg: inc nneg1 loop next mov si,list1 mov max,[si] mov min,[si] nexttt: inc si inc si cmp max,[si] jnc large cmp min ,[si] jc small
  • 3. dec dl jnz nexttt jmp last large: mov max,[si] small: mov min,[si]