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
    74.7 KB · Views: 162
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…