??? 09/11/06 08:26 Read: times |
#124023 - Many ways to skin a cat Responding to: ???'s previous message |
The 4bit mode was discussed here. I presented a method that allows you to use any port pin in any order. http://www.8052.com/forum/read.phtml?id=120300 This removes the need to and & or bits. This is using the 8051 bit features - it is also very obvious what the code is doing. However, it is always good practice to be fluent with anding and oring. Some other hints - when you start to write larger assembler programs, you start running out of registers. I tend to choose a 'c' compiler and use its rules for passing parameters. For example: byte - Acc word R7:R6 long R7:R6:R5:R4 Storing temps in registers ends up creating more problems than it solves. Best to push Acc if a routine to be called trashes it rather than copy to R3 as you do. Not that this solves your immediate problem. |