Free Republic
Browse · Search
News/Activism
Topics · Post Article

To: Dimensio

I looked, and the individual lines of code are fairly well documented as to what is going on, but the overall function of the device was unclear to me.


689 posted on 02/23/2005 1:21:43 PM PST by Elsie (Heck is where people, who don't believe in Gosh, think they are not going....)
[ Post Reply | Private Reply | To 663 | View Replies ]


To: Elsie
I suppose that I should explain the ultimate intent of the code, so that a proper assessment the efficiency and effectiveness. The program was written for a class on computer interfacing. Provided are two debounced pushbuttons, eight logic switches (0-7) and eight LED outputs (two LEDs per output, signifying either logic high or logic low).

The program, at start, will read a binary value from the switches and, if the value is not "00", will output the binary value on the switches in a "marquee" fashion, scrolling the binary value on the LEDs from right to left. If a '00' is read, the program jumps to an error routine.

Upon reading either of the pushbutton inputs, an interrupt is triggered, however the interrupt routine is not to execute until AFTER the pushbutton is released. IF pushbutton 1 is pressed, the program is to 1. determine whether or not the CURRENT switch value is a valid BCD representation (and enter an error routine if it is not), then determine the transpose of the BCD of the switch value, then determine which value is lower (transpose or original), start from the lower and count up to the higher by the magnitude of the two BCD digits from the switches (ie, the magnitude for a read of 24 would be 4-2=2, so it would count up by 2).
If the SECOND pushbutton is displayed, the program is to change the direction of the marquee in the main background program (from left to right to right to left, and vice versa) and change the count order of the first pushbutton routine, either from lower to higher to the other, or from higher to lower to the other.
Once either interrupt routine finishes, the program returns to the background routine of the scrolling marquee (using whatever value it loaded from the switches originally, not any new value).

I should also mention that when wiring things, in addition to the aforementioned hardware, I also made use of one 74LS00 logic chip.

I should strip out the comments to make it an even better analogy, but I'd really like to see someone with no understanding of assembly coding -- or even computer programming at all -- to assess 1) whether or not my program will even do what I just laid out and 2) whether or not my program is efficiently coded for the task.
696 posted on 02/23/2005 1:41:51 PM PST by Dimensio (http://angryflower.com/bobsqu.gif <-- required reading before you use your next apostrophe!)
[ Post Reply | Private Reply | To 689 | View Replies ]

Free Republic
Browse · Search
News/Activism
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson