📄 ks0108test.lss
字号:
ks0108Test.elf: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 000011d0 00000000 00000000 00000074 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .bss 00000009 00800060 00800060 00001244 2**0
ALLOC
2 .stab 00000378 00000000 00000000 00001244 2**2
CONTENTS, READONLY, DEBUGGING
3 .stabstr 00000071 00000000 00000000 000015bc 2**0
CONTENTS, READONLY, DEBUGGING
4 .debug_aranges 00000060 00000000 00000000 0000162d 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_pubnames 00000258 00000000 00000000 0000168d 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_info 00000cf7 00000000 00000000 000018e5 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_abbrev 0000037a 00000000 00000000 000025dc 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_line 00000ce6 00000000 00000000 00002956 2**0
CONTENTS, READONLY, DEBUGGING
9 .debug_frame 000001b0 00000000 00000000 0000363c 2**2
CONTENTS, READONLY, DEBUGGING
10 .debug_str 0000036e 00000000 00000000 000037ec 2**0
CONTENTS, READONLY, DEBUGGING
11 .debug_loc 00000c29 00000000 00000000 00003b5a 2**0
CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:
00000000 <__vectors>:
0: 12 c2 rjmp .+1060 ; 0x426 <__ctors_end>
2: 2c c2 rjmp .+1112 ; 0x45c <__bad_interrupt>
4: 2b c2 rjmp .+1110 ; 0x45c <__bad_interrupt>
6: 2a c2 rjmp .+1108 ; 0x45c <__bad_interrupt>
8: 29 c2 rjmp .+1106 ; 0x45c <__bad_interrupt>
a: 28 c2 rjmp .+1104 ; 0x45c <__bad_interrupt>
c: 27 c2 rjmp .+1102 ; 0x45c <__bad_interrupt>
e: 26 c2 rjmp .+1100 ; 0x45c <__bad_interrupt>
10: 25 c2 rjmp .+1098 ; 0x45c <__bad_interrupt>
12: 24 c2 rjmp .+1096 ; 0x45c <__bad_interrupt>
14: 23 c2 rjmp .+1094 ; 0x45c <__bad_interrupt>
16: 22 c2 rjmp .+1092 ; 0x45c <__bad_interrupt>
18: 21 c2 rjmp .+1090 ; 0x45c <__bad_interrupt>
1a: 20 c2 rjmp .+1088 ; 0x45c <__bad_interrupt>
1c: 1f c2 rjmp .+1086 ; 0x45c <__bad_interrupt>
1e: 1e c2 rjmp .+1084 ; 0x45c <__bad_interrupt>
20: 1d c2 rjmp .+1082 ; 0x45c <__bad_interrupt>
22: 1c c2 rjmp .+1080 ; 0x45c <__bad_interrupt>
24: 1b c2 rjmp .+1078 ; 0x45c <__bad_interrupt>
00000026 <IMAGE>:
26: ff ff ff ff ff ff 7f 7f 7f 7f 7f 7f 7f 7f ff ff ................
36: ff ff 7f 7f 3f bf 3f 1f 3f 3f 3f 7f ff bf 1f 47 ....?.?.???....G
46: 87 07 07 07 27 77 77 67 e7 e7 e7 c7 87 07 07 07 ....'wwg........
56: 07 07 07 07 07 07 07 87 c7 f7 ff ff ff ff ff ff ................
66: ff ff ff ff ff ef ef 7f 7f 7f 7f ff ff ff ff ff ................
76: ff ff ff bf ff ff ff ff 3f 7f 7f 7f 3f 3f 3f 1f ........?...???.
86: 1f 1f 1f 1f 0f 1f 1f 1f 3f 3f 3f 3f 3f 7f 7f 7f ........?????...
96: 7f 3f 3f 7f 7f 7f 7f 7f 7f ff ff ff 7f 7f ff ff .??.............
a6: fe fe fe ff ff ff f8 f8 f0 f0 f8 f8 f8 f8 f8 f8 ................
b6: f0 e0 c0 80 00 00 00 00 00 00 00 00 00 00 00 0c ................
c6: 0c 0e 1c 3f 0f 03 00 04 04 87 cf 9f ff fe fc f8 ...?............
d6: f8 fc fe fe ff ff ff ff ff fd ff ff ff df cf 1f ................
e6: 3f 3f 13 03 01 10 1c 0c 00 00 00 00 00 00 00 00 ??..............
f6: 00 80 80 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
...
116: 00 90 f8 f8 f8 f8 f8 cc e0 f0 f8 f8 f8 fc fc fe ................
126: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
136: ff ff ff ff f8 f0 e0 e0 c0 80 00 00 00 80 c0 c0 ................
146: e0 e0 c0 e0 f0 fc fe fe ff ff ff ff ff ff ff ff ................
156: ff ff ff ff ff ff ff ff ff ff ff 3f 1f 09 01 00 ...........?....
166: 04 06 06 06 0e 1c 1e 18 1c 18 19 19 01 03 00 00 ................
176: 00 07 46 00 00 80 80 80 00 00 00 00 00 00 00 00 ..F.............
...
18e: 00 00 84 fc f8 f4 fe fe f7 fb fe ff ff ff ff ff ................
19e: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
1ae: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
1be: ff ff ff fc fc fc fd f9 f9 f3 ff ff 5f 0f 0f 0f ............_...
1ce: 0f 0f 1f 3f 3f 3f ff ff ff ff ff ff ff ff ff ff ...???..........
1de: ff ff f0 e0 c0 c0 c0 c0 c0 c0 c0 00 00 00 00 00 ................
1ee: 00 00 00 00 00 03 06 00 88 c8 fc fc fe ff ff ff ................
1fe: ff fe f0 e0 f8 fc fe ff fe fc f8 30 30 e0 f6 7f ...........00...
20e: 3f 3f ff ff ff ff ff ff ff ff ff ff ff ff ff ff ??..............
21e: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
22e: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
23e: ff ff ff ff ff ff ff ff ff ff ff fd f0 e0 c0 00 ................
...
256: 01 01 f1 fb ff ff ff ff ff ff ff ff ff ff ff ff ................
266: ff ff ff fe 98 00 00 00 00 00 00 00 80 c0 fe 7f ................
276: 1f df ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
286: ff ff ff fe fc ff ff fe fe 7f 7e 3f 1f 1f 0f 0f ..........~?....
296: 3d 39 19 3b 7f ff ff ff ff ff ff ff ff ff ff ff =9.;............
2a6: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
2b6: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
2c6: ff ff ff ff ff ff 0f 00 00 80 c0 e0 f0 f8 fc fe ................
2d6: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
2e6: ff ff ff ff ff fc f0 f0 f0 f0 f8 fc ff ff ff ff ................
2f6: fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
306: ff ff ff ff ff ff ff ff fc f0 f0 f0 f8 f8 f8 f0 ................
316: f0 e0 c0 c0 e0 f0 ff ff ff ff ff ff 7f ff df ff ................
326: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
336: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
346: ff ff ff ff ff ff f8 f8 ff ff ff ff ff ff ff ff ................
356: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
366: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
376: ff 7f 7f 7f ff ff ff ff ff ff ff ff ff ff 7f 7f ................
386: 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f ................
396: 7f 7f 7f ff ff ff ff ff ff ff ff ff ff ff ff ff ................
3a6: 07 07 07 07 07 07 07 07 07 07 07 07 07 07 03 03 ................
3b6: 03 03 03 03 03 03 03 03 03 03 03 03 03 01 03 03 ................
3c6: 03 03 03 03 03 01 01 00 00 00 07 07 07 07 07 07 ................
3d6: 07 07 07 07 07 07 07 07 07 03 03 01 01 01 01 01 ................
3e6: 01 01 01 01 01 01 01 01 01 01 01 00 00 00 00 00 ................
...
3fe: 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
...
41e: 00 01 05 05 07 07 07 07 ........
00000426 <__ctors_end>:
426: 11 24 eor r1, r1
428: 1f be out 0x3f, r1 ; 63
42a: cf e5 ldi r28, 0x5F ; 95
42c: d4 e0 ldi r29, 0x04 ; 4
42e: de bf out 0x3e, r29 ; 62
430: cd bf out 0x3d, r28 ; 61
00000432 <__do_copy_data>:
432: 10 e0 ldi r17, 0x00 ; 0
434: a0 e6 ldi r26, 0x60 ; 96
436: b0 e0 ldi r27, 0x00 ; 0
438: e0 ed ldi r30, 0xD0 ; 208
43a: f1 e1 ldi r31, 0x11 ; 17
43c: 02 c0 rjmp .+4 ; 0x442 <.do_copy_data_start>
0000043e <.do_copy_data_loop>:
43e: 05 90 lpm r0, Z+
440: 0d 92 st X+, r0
00000442 <.do_copy_data_start>:
442: a0 36 cpi r26, 0x60 ; 96
444: b1 07 cpc r27, r17
446: d9 f7 brne .-10 ; 0x43e <.do_copy_data_loop>
00000448 <__do_clear_bss>:
448: 10 e0 ldi r17, 0x00 ; 0
44a: a0 e6 ldi r26, 0x60 ; 96
44c: b0 e0 ldi r27, 0x00 ; 0
44e: 01 c0 rjmp .+2 ; 0x452 <.do_clear_bss_start>
00000450 <.do_clear_bss_loop>:
450: 1d 92 st X+, r1
00000452 <.do_clear_bss_start>:
452: a9 36 cpi r26, 0x69 ; 105
454: b1 07 cpc r27, r17
456: e1 f7 brne .-8 ; 0x450 <.do_clear_bss_loop>
458: 02 d0 rcall .+4 ; 0x45e <main>
45a: b9 c6 rjmp .+3442 ; 0x11ce <_exit>
0000045c <__bad_interrupt>:
45c: d1 cd rjmp .-1118 ; 0x0 <__vectors>
0000045e <main>:
#include "SC.h"
#include "Bitmap.h"
int main(void) {
45e: 0f 93 push r16
460: cf 93 push r28
462: df 93 push r29
464: cd b7 in r28, 0x3d ; 61
466: de b7 in r29, 0x3e ; 62
468: 22 97 sbiw r28, 0x02 ; 2
46a: 0f b6 in r0, 0x3f ; 63
46c: f8 94 cli
46e: de bf out 0x3e, r29 ; 62
470: 0f be out 0x3f, r0 ; 63
472: cd bf out 0x3d, r28 ; 61
// Wait a little while the display starts up
for(volatile uint16_t i=0; i<15000; i++);
474: 1a 82 std Y+2, r1 ; 0x02
476: 19 82 std Y+1, r1 ; 0x01
478: 05 c0 rjmp .+10 ; 0x484 <__stack+0x25>
47a: 89 81 ldd r24, Y+1 ; 0x01
47c: 9a 81 ldd r25, Y+2 ; 0x02
47e: 01 96 adiw r24, 0x01 ; 1
480: 9a 83 std Y+2, r25 ; 0x02
482: 89 83 std Y+1, r24 ; 0x01
484: 89 81 ldd r24, Y+1 ; 0x01
486: 9a 81 ldd r25, Y+2 ; 0x02
488: 88 59 subi r24, 0x98 ; 152
48a: 9a 43 sbci r25, 0x3A ; 58
48c: b0 f3 brcs .-20 ; 0x47a <__stack+0x1b>
// Initialize the LCD
ks0108Init(0);
48e: 80 e0 ldi r24, 0x00 ; 0
490: 09 d4 rcall .+2066 ; 0xca4 <ks0108Init>
// Select a font
//ks0108SelectFont(Arial_Bold_14, ks0108ReadFontData, BLACK);
// Set a position
//ks0108GotoXY(15,10);
// Print some text
//ks0108Puts_P(PSTR("test"));
// a nice little round rect
//ks0108DrawRoundRect(5, 5, 117, 20, 8, BLACK);
// Once again :)
// Select a font
//ks0108SelectFont(SC, ks0108ReadFontData, BLACK);
// Set a position
//ks0108GotoXY(5,30);
// Print some text
//ks0108Puts("test");
// ks0108DrawLine(0, 0, 100, 50, BLACK);
//ks0108DrawCircle(50, 40, 20, BLACK);
ks0108ClearScreen();
492: 00 e0 ldi r16, 0x00 ; 0
494: 2f e3 ldi r18, 0x3F ; 63
496: 4f e7 ldi r20, 0x7F ; 127
498: 60 e0 ldi r22, 0x00 ; 0
49a: 80 e0 ldi r24, 0x00 ; 0
49c: 74 d3 rcall .+1768 ; 0xb86 <ks0108FillRect>
LoadBitmap(IMAGE);
49e: 86 e2 ldi r24, 0x26 ; 38
4a0: 90 e0 ldi r25, 0x00 ; 0
4a2: 3a d6 rcall .+3188 ; 0x1118 <LoadBitmap>
4a4: ff cf rjmp .-2 ; 0x4a4 <__stack+0x45>
000004a6 <ks0108ReadFontData>:
//
// Font Functions
//
uint8_t ks0108ReadFontData(const uint8_t* ptr) {
4a6: fc 01 movw r30, r24
4a8: 84 91 lpm r24, Z
return pgm_read_byte(ptr);
}
4aa: 99 27 eor r25, r25
4ac: 08 95 ret
000004ae <ks0108SelectFont>:
void ks0108SelectFont(const char* font, ks0108FontCallback callback, uint8_t color) {
4ae: 90 93 68 00 sts 0x0068, r25
4b2: 80 93 67 00 sts 0x0067, r24
ks0108Font = font;
ks0108FontRead = callback;
4b6: 70 93 66 00 sts 0x0066, r23
4ba: 60 93 65 00 sts 0x0065, r22
ks0108FontColor = color;
4be: 40 93 61 00 sts 0x0061, r20
4c2: 08 95 ret
000004c4 <ks0108CharWidth>:
}
int ks0108PutChar(char c) {
uint8_t width = 0;
uint8_t height = ks0108FontRead(ks0108Font+FONT_HEIGHT);
uint8_t bytes = (height+7)/8;
uint8_t firstChar = ks0108FontRead(ks0108Font+FONT_FIRST_CHAR);
uint8_t charCount = ks0108FontRead(ks0108Font+FONT_CHAR_COUNT);
uint16_t index = 0;
uint8_t x = ks0108Coord.x, y = ks0108Coord.y;
if(c < firstChar || c >= (firstChar+charCount)) {
return 1;
}
c-= firstChar;
// read width data, to get the index
for(uint8_t i=0; i<c; i++) {
index += ks0108FontRead(ks0108Font+FONT_WIDTH_TABLE+i);
}
index = index*bytes+charCount+FONT_WIDTH_TABLE;
width = ks0108FontRead(ks0108Font+FONT_WIDTH_TABLE+c);
// last but not least, draw the character
for(uint8_t i=0; i<bytes; i++) {
uint8_t page = i*width;
for(uint8_t j=0; j<width; j++) {
uint8_t data = ks0108FontRead(ks0108Font+index+page+j);
if(height < (i+1)*8) {
data >>= (i+1)*8-height;
}
if(ks0108FontColor == BLACK) {
ks0108WriteData(data);
} else {
ks0108WriteData(~data);
}
}
// 1px gap between chars
if(ks0108FontColor == BLACK) {
ks0108WriteData(0x00);
} else {
ks0108WriteData(0xFF);
}
ks0108GotoXY(x, ks0108Coord.y+8);
}
ks0108GotoXY(x+width+1, y);
return 0;
}
void ks0108Puts(char* str) {
int x = ks0108Coord.x;
while(*str != 0) {
if(*str == '\n') {
ks0108GotoXY(x, ks0108Coord.y+ks0108FontRead(ks0108Font+FONT_HEIGHT));
} else {
ks0108PutChar(*str);
}
str++;
}
}
void ks0108Puts_P(PGM_P str) {
int x = ks0108Coord.x;
while(pgm_read_byte(str) != 0) {
if(pgm_read_byte(str) == '\n') {
ks0108GotoXY(x, ks0108Coord.y+ks0108FontRead(ks0108Font+FONT_HEIGHT));
} else {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -