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!)
To: Dimensio
Ah...
I see your intent (maybe).
It is kinda like DNA: these rudimentary, basic functions.
Without the comments, it would be as we find ourselves at this early stage of trying to understand DNA 'instructions'.
We have a finished unit, can see how it operates (a little) and are trying to reverse engineer the code.
Cool!!
701 posted on
02/23/2005 4:01:54 PM PST by
Elsie
(Heck is where people, who don't believe in Gosh, think they are not going....)
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson