??? 10/07/11 13:02 Modified: 10/07/11 13:05 Read: times |
#184127 - Design your code, make it pretty. Responding to: ???'s previous message |
You want to display patterns on 11 LEDs.
If you write each pattern as a 16 bit number, you could call a subroutine with e.g. 'MOV DPTR,#0b10111101010' for each pattern. The subroutine would light the required LEDs and delay function. Likewise the delay function can have a global parameter that you vary by your 'speed' buttons. But the most important job is to design what you want to do with pencil and paper. Then translate into ASM instructions, with an explanatory comment for each subroutine. If you make the code look attractive, it will be easy for you to read. If you don't, people just ignore you. For example, I glanced at your code, thought it looked messy, and made no further effort to read it. There are some excellent students in Indian universities that do exactly this. Follow their example and you will go far !! David. |