Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

(BEGINNER) Questions regarding PIC Microcontroller

Status
Not open for further replies.

xoxozozo10

Newbie level 1
Joined
Sep 16, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,290
hello, i'm currently taking a course on PIC Microcontroller. Still fresh and new in this so kinda confuse with it...

i've been using this textbook published by THOMSON -DELMARE LEARNING- 'PIC Microcontroller: An Introduction to Software & Hardware Interfacing' by Han-Way Huang

I was asked to write an assembler code in MPLAB software (PIC18F452), i;ve only covered until assembler language so far but havent try any of it on the software... I need some advice on which command should i use to solve this particular problem:-

Use the following 50 8-bit integer values as your data set

130,57,4,188,203,124,63,0,165,216
142,170,242,119,0,23,52,50,155,81
16, 74,69,01,133,0,89,198,64,53
58,18,14,80,44,107,17,8,62,225
36,0,211,61,77,0,9,196,123,88

Put this data set in program memory called DATA_ARR starting from address 0x150

Write a program to sort your data set called DATA_ARR from the biggest value to the smallest value. The DATA_ARR consist of unsigned 8-bit integers. Save the correct data sorting in an array called DATA_HILO at starting address 0x100 in data memory.

I'm really sorry for the trouble... still very new in this and can't find any good help around...

Thanks.
 

Initially do store two values @ a time in two different registers.Compare both of them.Check for the reminder whether +ve(>0) or -ve(<0). Then store the greater values in a location & compare the lesser values with the next number & so on.This sorting is known as BUBBLE SORTING in C++.Do refer to it.This will help you a lot.
Regards,
Jerin. :)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top