??? 06/29/04 15:16 Read: times Msg Score: +1 +1 Good Question |
#73376 - RE: Assemble coding style Responding to: ???'s previous message |
For me this piece looks all terrible.
JNB RI, $ ; Wait for RI to be set (...) RETI Either we wait for RI in main program loop by JNB RI or we process it in interrupts by checking once and if not set, leaving the interrupt (eventually processing TI) - we should finish an interrupt ASAP, not wait indefinitely inside it! If we know TI "shouldn't happen", there's no need to check for RI. If TI can happen, this will stop the program until something arrives. MOV TEMP, SBUF ; Receive data byte & store But besides SM2 (which isn't really meant for such a flag I think) I don't see any sign of marking that the new data has arrived. Unless there is some loop that re-reads TEMP over and over (very inefficient solution) there doesn't seem to be any way to announce arrival of new value to the main program. BTW, could someone explain the use of SCON.7 as framing error bit? On my foldout it looks like it's SM0, just one of UART mode control bits (setting UART to 9-bit mode)... |
Topic | Author | Date |
Assemble coding style | 01/01/70 00:00 | |
RE: Assembler coding style | 01/01/70 00:00 | |
RE: Assemble coding style | 01/01/70 00:00 | |
RE: Assemble coding style | 01/01/70 00:00 | |
RE: Assemble coding style | 01/01/70 00:00 | |
RE: Assemble coding style | 01/01/70 00:00 | |
RE: Assemble coding style![]() | 01/01/70 00:00 |