??? 11/16/09 12:06 Read: times |
#170862 - Attempt to fix code Responding to: ???'s previous message |
here is the code again with some minor changes.
BIN_BCD: ;(Convert BIN to BCD then send BCD to BCD_ASCII) MOV A,R0 MOV B,#100 DIV AB MOV R3,A ; R3 CONTAIN HUNDRED NUMBER MOV A,B MOV B,#10 DIV AB MOV R2,A ; R2 CONTAIN TENTH NUMBER MOV R1,B ; R1 CONTAIN LEFT DECIMAL NUMBER LJMP BCD_ASCII RET BCD_ASCII: ; (Convert BCD to ASCII) MOV A, R0 ADD A, #30H MOV A, R1 ADD A, #30H MOV A, R2 ADD A, #30H LJMP ADR_RES RET ADR_RES: ;(MOV each digit of time to address in RAM) MOV A, RO MOV A, #30h MOV A, R1 MOV A, #31h MOV A, R2 MOV A, #32h RET Any thoughts, when i enter it a simulator, it arrives with error, unknown label BIN_BCD... |
Topic | Author | Date |
Convert Binary numbers to symbols to show on a lcd. | 01/01/70 00:00 | |
Have you considered searching? | 01/01/70 00:00 | |
BCD? | 01/01/70 00:00 | |
Quite sure ASCII | 01/01/70 00:00 | |
Yes, BCD | 01/01/70 00:00 | |
Language dependent | 01/01/70 00:00 | |
The *techniques* are not language-dependent | 01/01/70 00:00 | |
Binary to BCD to ascii Assembly code 8051 | 01/01/70 00:00 | |
Step by step... | 01/01/70 00:00 | |
Attempt to fix code | 01/01/70 00:00 | |
What Assembler? What Simulator? | 01/01/70 00:00 | |
EdSim51 | 01/01/70 00:00 | |
please comment and format your "code" | 01/01/70 00:00 | |
Test your code - at least with pen and paper | 01/01/70 00:00 | |
Not strictly true | 01/01/70 00:00 | |
start with C, optimize generated asm later? | 01/01/70 00:00 | |
That still requires... | 01/01/70 00:00 | |
Misplaced focus?![]() | 01/01/70 00:00 |