SlideShare une entreprise Scribd logo
1  sur  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]

Contenu connexe

Plus de 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
 

Plus de 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
 

Dernier

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Dernier (20)

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

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]