
Fun LED stuff
Dependencies: LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI
Program3_F20_Leong.s@4:69f1e5fa2cb6, 2020-11-16 (annotated)
- Committer:
- kkleong
- Date:
- Mon Nov 16 15:02:45 2020 +0000
- Revision:
- 4:69f1e5fa2cb6
- Parent:
- 2:1be4e7457636
Newe redBlue
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kkleong | 0:e579c6f35abf | 1 | AREA Program3, CODE, READONLY |
kkleong | 0:e579c6f35abf | 2 | GLOBAL getQuad |
kkleong | 0:e579c6f35abf | 3 | ; uint32_t getQuad ( uint16_t x, uint16_t y) |
kkleong | 0:e579c6f35abf | 4 | getQuad CMP R0, #125 |
kkleong | 0:e579c6f35abf | 5 | MOVLT R0, #1 |
kkleong | 0:e579c6f35abf | 6 | MOVGT R0, #2 |
kkleong | 0:e579c6f35abf | 7 | CMP R1, #160 |
kkleong | 0:e579c6f35abf | 8 | ADDGT R0, R0, #2 |
kkleong | 0:e579c6f35abf | 9 | BX LR |
kkleong | 0:e579c6f35abf | 10 | |
kkleong | 0:e579c6f35abf | 11 | GLOBAL swapRedBlue |
kkleong | 0:e579c6f35abf | 12 | ; uint32_t swapRedBlue ( uint32_t color) |
kkleong | 4:69f1e5fa2cb6 | 13 | swapRedBlue AND R1, R0, #0x00FF0000 |
kkleong | 4:69f1e5fa2cb6 | 14 | ASR R1, R1, #16 |
kkleong | 0:e579c6f35abf | 15 | |
kkleong | 4:69f1e5fa2cb6 | 16 | LDR R5, =0x000000FF |
kkleong | 4:69f1e5fa2cb6 | 17 | AND R2, R0, R5 |
kkleong | 4:69f1e5fa2cb6 | 18 | LSL R2, R2, #16 |
kkleong | 0:e579c6f35abf | 19 | |
kkleong | 4:69f1e5fa2cb6 | 20 | LDR R4, =0xFF00FF00 |
kkleong | 4:69f1e5fa2cb6 | 21 | AND R3, R0, R4 |
kkleong | 0:e579c6f35abf | 22 | |
kkleong | 4:69f1e5fa2cb6 | 23 | ORR R0, R1, R2 |
kkleong | 4:69f1e5fa2cb6 | 24 | ORR R0, R0, R3 |
kkleong | 0:e579c6f35abf | 25 | |
kkleong | 0:e579c6f35abf | 26 | GLOBAL toggleAlphaMSB |
kkleong | 0:e579c6f35abf | 27 | ; uint32_t toggleAlphaMSB ( uint32_t color) |
kkleong | 0:e579c6f35abf | 28 | toggleAlphaMSB MVN R1, R0 |
kkleong | 0:e579c6f35abf | 29 | LSR R1, R1, #24 |
kkleong | 0:e579c6f35abf | 30 | LSL R1, R1, #24 |
kkleong | 0:e579c6f35abf | 31 | LSL R0, R0, #8 |
kkleong | 0:e579c6f35abf | 32 | LSR R0, R0, #8 |
kkleong | 0:e579c6f35abf | 33 | ORR R0, R0, R1 |
kkleong | 0:e579c6f35abf | 34 | |
kkleong | 0:e579c6f35abf | 35 | BX LR |
kkleong | 0:e579c6f35abf | 36 | |
kkleong | 0:e579c6f35abf | 37 | GLOBAL rotateRGBBytes |
kkleong | 0:e579c6f35abf | 38 | ; uint32_t rotateRGBBytes ( uint32_t color) |
kkleong | 2:1be4e7457636 | 39 | rotateRGBBytes MOV R1, R0 |
kkleong | 2:1be4e7457636 | 40 | MOV R2, R0 |
kkleong | 2:1be4e7457636 | 41 | MOV R3, R0 |
kkleong | 2:1be4e7457636 | 42 | |
kkleong | 2:1be4e7457636 | 43 | LSR R1, R1, #24 |
kkleong | 2:1be4e7457636 | 44 | LSL R1, R1, #24 |
kkleong | 2:1be4e7457636 | 45 | |
kkleong | 2:1be4e7457636 | 46 | LSL R2, #8 |
kkleong | 2:1be4e7457636 | 47 | LSR R2, #16 |
kkleong | 2:1be4e7457636 | 48 | |
kkleong | 2:1be4e7457636 | 49 | LSL R3, #24 |
kkleong | 2:1be4e7457636 | 50 | LSR R3, #8 |
kkleong | 2:1be4e7457636 | 51 | |
kkleong | 2:1be4e7457636 | 52 | ORR R0, R1, R2 |
kkleong | 2:1be4e7457636 | 53 | ORR R0, R0, R3 |
kkleong | 0:e579c6f35abf | 54 | BX LR |
kkleong | 0:e579c6f35abf | 55 | |
kkleong | 0:e579c6f35abf | 56 | GLOBAL setRGBBits |
kkleong | 0:e579c6f35abf | 57 | ; uint32_t setRGBBits ( uint32_t color, uint8_t n) |
kkleong | 0:e579c6f35abf | 58 | setRGBBits |
kkleong | 0:e579c6f35abf | 59 | BX LR |
kkleong | 0:e579c6f35abf | 60 | |
kkleong | 0:e579c6f35abf | 61 | |
kkleong | 0:e579c6f35abf | 62 | END |