Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Queue(list) in program

Status
Not open for further replies.

Xoll

New Member
Hello..
I need to use assembly language to finish my project.I want to ask whether there are method to make a queue (list) in program.For example, when button 1 pressed first, it appears on top of the list.The next pressed button appears second and so on.when we press button 1 again, it will disappear and button 2 come to the top list.I just want to display the top list on seven segment.How to make it?
 
Could you use a "Circular Buffer" with a Read_Pointer and a Write_Pointer? The Circular buffer is full when Write_Pointer+1 = Read_Pointer and the buffer is empty when Write_Pointer = Read_Pointer. You'll have two functions, a "Load Buffer" function which places data in the buffer at the Write_Pointer then increments the Write_Pointer, and an "Unload Buffer" function which pulls data from the buffer at the Read_Pointer then increments the Read_Pointer.

Do you need to see a code example?

Mike
 

Attachments

  • Circular Buffer Diagram.JPG
    Circular Buffer Diagram.JPG
    74.7 KB · Views: 162
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top