![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| Sorry to intrupt. Can anyone help me to solve this question? I was trying to write a macro in ATmega16 assembly language, that will make 76543210 to become 01237654. but i don't know how to write it, can anyone pls help me solve it? thank you. (the number above is the number of bits of the register) Last edited by tuck; 12th November 2007 at 06:20 PM. | |
| |
| | (permalink) |
| I didn't check it but quick and dirty MACRO MAPBITS clr @2 sbrc @1,7 sbr @2,0 sbrc @1,6 sbr @2,1 sbrc @1,5 sbr @2,2 sbrc @1,4 sbr @2,3 sbrc @1,3 sbr @2,7 sbrc @1,2 sbr @2,6 sbrc @1,1 sbr @2,5 sbrc @1,0 sbr @2,4 .ENDMACRO Should work, mapbits @1 @2 The mapped contents of @1 will be in @2 at the end. Both registers need to be between 16 and 31
__________________ "Because I be what I be. I would tell you what you want to know if I could, mum, but I be a cat, and no cat anywhere ever gave anyone a straight answer, har har." Last edited by Sceadwian; 13th November 2007 at 01:11 AM. | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |