📄 main.lss
字号:
return;
}
//############################################################################
//Routine zum lesen eines Blocks(512Byte) von der MMC/SD-Karte
unsigned char mmc_read_sector (unsigned long addr,unsigned char *Buffer)
//############################################################################
{
4ec: e92d4070 stmdb sp!, {r4, r5, r6, lr}
4f0: e24dd008 sub sp, sp, #8 ; 0x8
4f4: e1a04000 mov r4, r0
4f8: e1a06001 mov r6, r1
//Commando 16 zum lesen eines Blocks von der MMC/SD - Karte
unsigned char CMD[] = {0x51,0x00,0x00,0x00,0x00,0xFF};
4fc: e28d5002 add r5, sp, #2 ; 0x2
500: e1a00005 mov r0, r5
504: e59f103c ldr r1, [pc, #60] ; 548 <.text+0x548>
508: e3a02006 mov r2, #6 ; 0x6
50c: eb000509 bl 1938 <memcpy>
/*Die Adressierung der MMC/SD-Karte wird in Bytes angegeben,
addr wird von Blocks zu Bytes umgerechnet danach werden
diese in das Commando eingef黦t*/
addr = addr << 9; //addr = addr * 512
510: e1a04484 mov r4, r4, lsl #9
CMD[1] = ((addr & 0xFF000000) >>24 );
514: e1a03c24 mov r3, r4, lsr #24
518: e5cd3003 strb r3, [sp, #3]
CMD[2] = ((addr & 0x00FF0000) >>16 );
51c: e1a03824 mov r3, r4, lsr #16
520: e5cd3004 strb r3, [sp, #4]
CMD[3] = ((addr & 0x0000FF00) >>8 );
524: e1a04424 mov r4, r4, lsr #8
528: e5cd4005 strb r4, [sp, #5]
MMC_Read_Block(CMD,Buffer,512);
52c: e1a00005 mov r0, r5
530: e1a01006 mov r1, r6
534: e3a02c02 mov r2, #512 ; 0x200
538: ebffffb1 bl 404 <MMC_Read_Block>
return(0);
}
53c: e3a00000 mov r0, #0 ; 0x0
540: e28dd008 add sp, sp, #8 ; 0x8
544: e8bd8070 ldmia sp!, {r4, r5, r6, pc}
548: 00001ba0 andeq r1, r0, r0, lsr #23
0000054c <Read_CID_MMC>:
//############################################################################
//Routine zum lesen des CID Registers von der MMC/SD-Karte (16Bytes)
unsigned char Read_CID_MMC (unsigned char *Buffer)
//############################################################################
{
54c: e92d4030 stmdb sp!, {r4, r5, lr}
550: e24dd008 sub sp, sp, #8 ; 0x8
554: e1a05000 mov r5, r0
//Commando zum lesen des CID Registers
unsigned char CMD[] = {0x4A,0x00,0x00,0x00,0x00,0xFF};
558: e28d4002 add r4, sp, #2 ; 0x2
55c: e1a00004 mov r0, r4
560: e59f1020 ldr r1, [pc, #32] ; 588 <.text+0x588>
564: e3a02006 mov r2, #6 ; 0x6
568: eb0004f2 bl 1938 <memcpy>
MMC_Read_Block(CMD,Buffer,16);
56c: e1a00004 mov r0, r4
570: e1a01005 mov r1, r5
574: e3a02010 mov r2, #16 ; 0x10
578: ebffffa1 bl 404 <MMC_Read_Block>
return(0);
}
57c: e3a00000 mov r0, #0 ; 0x0
580: e28dd008 add sp, sp, #8 ; 0x8
584: e8bd8030 ldmia sp!, {r4, r5, pc}
588: 00001b9a muleq r0, sl, fp
0000058c <Read_CSD_MMC>:
//############################################################################
//Routine zum lesen des CSD Registers von der MMC/SD-Karte (16Bytes)
unsigned char Read_CSD_MMC (unsigned char *Buffer)
//############################################################################
{
58c: e92d4030 stmdb sp!, {r4, r5, lr}
590: e24dd008 sub sp, sp, #8 ; 0x8
594: e1a05000 mov r5, r0
//Commando zum lesen des CSD Registers
unsigned char CMD[] = {0x49,0x00,0x00,0x00,0x00,0xFF};
598: e28d4002 add r4, sp, #2 ; 0x2
59c: e1a00004 mov r0, r4
5a0: e59f1020 ldr r1, [pc, #32] ; 5c8 <.text+0x5c8>
5a4: e3a02006 mov r2, #6 ; 0x6
5a8: eb0004e2 bl 1938 <memcpy>
MMC_Read_Block(CMD,Buffer,16);
5ac: e1a00004 mov r0, r4
5b0: e1a01005 mov r1, r5
5b4: e3a02010 mov r2, #16 ; 0x10
5b8: ebffff91 bl 404 <MMC_Read_Block>
return(0);
}
5bc: e3a00000 mov r0, #0 ; 0x0
5c0: e28dd008 add sp, sp, #8 ; 0x8
5c4: e8bd8030 ldmia sp!, {r4, r5, pc}
5c8: 00001b94 muleq r0, r4, fp
000005cc <mmc_init>:
5cc: e92d4010 stmdb sp!, {r4, lr}
5d0: e24dd008 sub sp, sp, #8 ; 0x8
5d4: e3a0120e mov r1, #-536870912 ; 0xe0000000
5d8: e281290a add r2, r1, #163840 ; 0x28000
5dc: e5923008 ldr r3, [r2, #8]
5e0: e3c33020 bic r3, r3, #32 ; 0x20
5e4: e5823008 str r3, [r2, #8]
5e8: e5923008 ldr r3, [r2, #8]
5ec: e3833010 orr r3, r3, #16 ; 0x10
5f0: e5823008 str r3, [r2, #8]
5f4: e5923008 ldr r3, [r2, #8]
5f8: e3833040 orr r3, r3, #64 ; 0x40
5fc: e5823008 str r3, [r2, #8]
600: e5923008 ldr r3, [r2, #8]
604: e3833b01 orr r3, r3, #1024 ; 0x400
608: e5823008 str r3, [r2, #8]
60c: e5923008 ldr r3, [r2, #8]
610: e3833080 orr r3, r3, #128 ; 0x80
614: e5823008 str r3, [r2, #8]
618: e5923000 ldr r3, [r2]
61c: e3833b01 orr r3, r3, #1024 ; 0x400
620: e5823000 str r3, [r2]
624: e281290b add r2, r1, #180224 ; 0x2c000
628: e5923000 ldr r3, [r2]
62c: e3c33c03 bic r3, r3, #768 ; 0x300
630: e5823000 str r3, [r2]
634: e5923000 ldr r3, [r2]
638: e3833c01 orr r3, r3, #256 ; 0x100
63c: e5823000 str r3, [r2]
640: e5923000 ldr r3, [r2]
644: e3c33b03 bic r3, r3, #3072 ; 0xc00
648: e5823000 str r3, [r2]
64c: e5923000 ldr r3, [r2]
650: e3833b01 orr r3, r3, #1024 ; 0x400
654: e5823000 str r3, [r2]
658: e5923000 ldr r3, [r2]
65c: e3c33a03 bic r3, r3, #12288 ; 0x3000
660: e5823000 str r3, [r2]
664: e5923000 ldr r3, [r2]
668: e3833a01 orr r3, r3, #4096 ; 0x1000
66c: e5823000 str r3, [r2]
670: e5923000 ldr r3, [r2]
674: e3c33903 bic r3, r3, #49152 ; 0xc000
678: e5823000 str r3, [r2]
67c: e5923000 ldr r3, [r2]
680: e3833901 orr r3, r3, #16384 ; 0x4000
684: e5823000 str r3, [r2]
688: e2811802 add r1, r1, #131072 ; 0x20000
68c: e3a030f8 mov r3, #248 ; 0xf8
690: e581300c str r3, [r1, #12]
694: e24330c8 sub r3, r3, #200 ; 0xc8
698: e5813000 str r3, [r1]
69c: e3a02000 mov r2, #0 ; 0x0
6a0: e3a03c4e mov r3, #19968 ; 0x4e00
6a4: e2833020 add r3, r3, #32 ; 0x20
6a8: e1a00000 nop (mov r0,r0)
6ac: e2822001 add r2, r2, #1 ; 0x1
6b0: e1520003 cmp r2, r3
6b4: 0a000032 beq 784 <mmc_init+0x1b8>
6b8: eafffffa b 6a8 <mmc_init+0xdc>
6bc: e3a030ff mov r3, #255 ; 0xff
6c0: e3a0220e mov r2, #-536870912 ; 0xe0000000
6c4: e2822802 add r2, r2, #131072 ; 0x20000
6c8: e5823008 str r3, [r2, #8]
6cc: e5923004 ldr r3, [r2, #4]
6d0: e3130080 tst r3, #128 ; 0x80
6d4: 0afffffc beq 6cc <mmc_init+0x100>
6d8: e2813001 add r3, r1, #1 ; 0x1
6dc: e20310ff and r1, r3, #255 ; 0xff
6e0: e351000a cmp r1, #10 ; 0xa
6e4: 1afffff4 bne 6bc <mmc_init+0xf0>
6e8: e28d0002 add r0, sp, #2 ; 0x2
6ec: e59f10ac ldr r1, [pc, #172] ; 7a0 <.text+0x7a0>
6f0: e3a02006 mov r2, #6 ; 0x6
6f4: eb00048f bl 1938 <memcpy>
6f8: e3a04000 mov r4, #0 ; 0x0
6fc: ea000004 b 714 <mmc_init+0x148>
700: e35400c9 cmp r4, #201 ; 0xc9
704: 0a000022 beq 794 <mmc_init+0x1c8>
708: e2843001 add r3, r4, #1 ; 0x1
70c: e1a03803 mov r3, r3, lsl #16
710: e1a04823 mov r4, r3, lsr #16
714: e28d0002 add r0, sp, #2 ; 0x2
718: ebfffef4 bl 2f0 <Write_Command_MMC>
71c: e3500001 cmp r0, #1 ; 0x1
720: 1afffff6 bne 700 <mmc_init+0x134>
724: e3a03041 mov r3, #65 ; 0x41
728: e5cd3002 strb r3, [sp, #2]
72c: e2433042 sub r3, r3, #66 ; 0x42
730: e5cd3007 strb r3, [sp, #7]
734: e3a04000 mov r4, #0 ; 0x0
738: ea000004 b 750 <mmc_init+0x184>
73c: e35400c9 cmp r4, #201 ; 0xc9
740: 0a000011 beq 78c <mmc_init+0x1c0>
744: e2843001 add r3, r4, #1 ; 0x1
748: e1a03803 mov r3, r3, lsl #16
74c: e1a04823 mov r4, r3, lsr #16
750: e28d0002 add r0, sp, #2 ; 0x2
754: ebfffee5 bl 2f0 <Write_Command_MMC>
758: e3500000 cmp r0, #0 ; 0x0
75c: 1afffff6 bne 73c <mmc_init+0x170>
760: e3a0220e mov r2, #-536870912 ; 0xe0000000
764: e2821802 add r1, r2, #131072 ; 0x20000
768: e3a03008 mov r3, #8 ; 0x8
76c: e581300c str r3, [r1, #12]
770: e282290a add r2, r2, #163840 ; 0x28000
774: e5923000 ldr r3, [r2]
778: e3833b01 orr r3, r3, #1024 ; 0x400
77c: e5823000 str r3, [r2]
780: ea000004 b 798 <mmc_init+0x1cc>
784: e3a01000 mov r1, #0 ; 0x0
788: eaffffcb b 6bc <mmc_init+0xf0>
78c: e3a00002 mov r0, #2 ; 0x2
790: ea000000 b 798 <mmc_init+0x1cc>
794: e3a00001 mov r0, #1 ; 0x1
798: e28dd008 add sp, sp, #8 ; 0x8
79c: e8bd8010 ldmia sp!, {r4, pc}
7a0: 00001bac andeq r1, r0, ip, lsr #23
000007a4 <mmc_write_sector>:
7a4: e92d4070 stmdb sp!, {r4, r5, r6, lr}
7a8: e24dd008 sub sp, sp, #8 ; 0x8
7ac: e1a04000 mov r4, r0
7b0: e1a06001 mov r6, r1
7b4: e28d5002 add r5, sp, #2 ; 0x2
7b8: e1a00005 mov r0, r5
7bc: e59f113c ldr r1, [pc, #316] ; 900 <.text+0x900>
7c0: e3a02006 mov r2, #6 ; 0x6
7c4: eb00045b bl 1938 <memcpy>
7c8: e1a03c24 mov r3, r4, lsr #24
7cc: e5cd3003 strb r3, [sp, #3]
7d0: e1a03824 mov r3, r4, lsr #16
7d4: e5cd3004 strb r3, [sp, #4]
7d8: e1a04424 mov r4, r4, lsr #8
7dc: e5cd4005 strb r4, [sp, #5]
7e0: e1a00005 mov r0, r5
7e4: ebfffec1 bl 2f0 <Write_Command_MMC>
7e8: e3500000 cmp r0, #0 ; 0x0
7ec: 1a000041 bne 8f8 <mmc_write_sector+0x154>
7f0: e3a01000 mov r1, #0 ; 0x0
7f4: e3a0320e mov r3, #-536870912 ; 0xe0000000
7f8: e283c802 add ip, r3, #131072 ; 0x20000
7fc: e3a000ff mov r0, #255 ; 0xff
800: e2832802 add r2, r3, #131072 ; 0x20000
804: e58c0008 str r0, [ip, #8]
808: e5923004 ldr r3, [r2, #4]
80c: e3130080 tst r3, #128 ; 0x80
810: 0afffffc beq 808 <mmc_write_sector+0x64>
814: e5923008 ldr r3, [r2, #8]
818: e2813001 add r3, r1, #1 ; 0x1
81c: e20310ff and r1, r3, #255 ; 0xff
820: e3510064 cmp r1, #100 ; 0x64
824: 1afffff6 bne 804 <mmc_write_sector+0x60>
828: e3a030fe mov r3, #254 ; 0xfe
82c: e5823008 str r3, [r2, #8]
830: e3a0320e mov r3, #-536870912 ; 0xe0000000
834: e2832802 add r2, r3, #131072 ; 0x20000
838: e5923004 ldr r3, [r2, #4]
83c: e3130080 tst r3, #128 ; 0x80
840: 0afffffc beq 838 <mmc_write_sector+0x94>
844: e3a01000 mov r1, #0 ; 0x0
848: e3a0320e mov r3, #-536870912 ; 0xe0000000
84c: e2830802 add r0, r3, #131072 ; 0x20000
850: e2832802 add r2, r3, #131072 ; 0x20000
854: e4d63001 ldrb r3, [r6], #1
858: e5803008 str r3, [r0, #8]
85c: e5923004 ldr r3, [r2, #4]
860: e3130080 tst r3, #128 ; 0x80
864: 0afffffc beq 85c <mmc_write_sector+0xb8>
868: e2813001 add r3, r1, #1 ; 0x1
86c: e1a03803 mov r3, r3, lsl #16
870: e1a01823 mov r1, r3, lsr #16
874: e3510c02 cmp r1, #512 ; 0x200
878: 1afffff5 bne 854 <mmc_write_sector+0xb0>
87c: e3a030ff mov r3, #255 ; 0xff
880: e5823008 str r3, [r2, #8]
884: e3a0320e mov r3, #-536870912 ; 0xe0000000
888: e2832802 add r2, r3, #131072 ; 0x20000
88c: e5923004 ldr r3, [r2, #4]
890: e3130080 tst r3, #128 ; 0x80
894: 0afffffc beq 88c <mmc_write_sector+0xe8>
898: e3a030ff mov r3, #255 ; 0xff
89c: e5823008 str r3, [r2, #8]
8a0: e3a0320e mov r3, #-536870912 ; 0xe0000000
8a4: e2832802 add r2, r3, #131072 ; 0x20000
8a8: e5923004 ldr r3, [r2, #4]
8ac: e3130080 tst r3, #128 ; 0x80
8b0: 0afffffc beq 8a8 <mmc_write_sector+0x104>
8b4: e3a0320e mov r3, #-536870912 ; 0xe0000000
8b8: e2832802 add r2, r3, #131072 ; 0x20000
8bc: e3a010ff mov r1, #255 ; 0xff
8c0: e5821008 str r1, [r2, #8]
8c4: e5923004 ldr r3, [r2, #4]
8c8: e3130080 tst r3, #128 ; 0x80
8cc: 0afffffc beq 8c4 <mmc_write_sector+0x120>
8d0: e5923008 ldr r3, [r2, #8]
8d4: e20330ff and r3, r3, #255 ; 0xff
8d8: e35300ff cmp r3, #255 ; 0xff
8dc: 1afffff7 bne 8c0 <mmc_write_sector+0x11c>
8e0: e3a0220e mov r2, #-536870912 ; 0xe0000000
8e4: e282290a add r2, r2, #163840 ; 0x28000
8e8: e5923000 ldr r3, [r2]
8ec: e3833b01 orr r3, r3, #1024 ; 0x400
8f0: e5823000 str r3, [r2]
8f4: e3a00000 mov r0, #0 ; 0x0
8f8: e28dd008 add sp, sp, #8 ; 0x8
8fc: e8bd8070 ldmia sp!, {r4, r5, r6, pc}
900: 00001ba6 andeq r1, r0, r6, lsr #23
00000904 <Load_FAT>:
void Load_FAT ( unsigned short int Cluster, //Angabe Startcluster
unsigned long *Block,
unsigned char *TMP_Buffer) //Workingbuffer
//############################################################################
{
904: e92d41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
908: e1a08001 mov r8, r1
90c: e1a05002 mov r5, r2
910: e1a00800 mov r0, r0, lsl #16
914: e1a00820 mov r0, r0, lsr #16
//Zum 躡erpr黤en ob der FAT Block schon geladen wurde
unsigned short int FAT_Block_Store = 0;
//Byte Adresse innerhalb des Fat Blocks
unsigned short int FAT_Byte_Addresse;
//FAT Block Adresse
unsigned short int FAT_Block_Addresse;
//Berechnung f黵 den ersten FAT Block (FAT Start Addresse)
for (unsigned short int a = 0;;a++)
{
if (a == *Block)
918: e5913000 ldr r3, [r1]
91c: e3530000 cmp r3, #0 ; 0x0
920: 0a000006 beq 940 <Load_FAT+0x3c>
{
*Block = (0x0000FFFF & Cluster);
return;
}
if (Cluster == 0xFFFF)
924: e3a03801 mov r3, #65536 ; 0x10000
928: e2433001 sub r3, r3, #1 ; 0x1
92c: e1500003 cmp r0, r3
{
break; //Ist das Ende des Files erreicht Schleife beenden
930: 13a07000 movne r7, #0 ; 0x0
934: 11a01007 movne r1, r7
938: 08bd81f0 ldmeqia sp!, {r4, r5, r6, r7, r8, pc}
93c: ea000005 b 958 <Load_FAT+0x54>
940: e5880000 str r0, [r8]
944: e8bd81f0 ldmia sp!, {r4, r5, r6, r7, r8, pc}
948: e3a03801 mov r3, #65536 ; 0x10000
94c: e2433001 sub r3, r3, #1 ; 0x1
950: e1500003 cmp r0, r3
954: 08bd81f0 ldmeqia sp!, {r4, r5, r6, r7, r8, pc}
}
//Berechnung des Bytes innerhalb des FAT Block磗
FAT_Byte_Addresse = (Cluster*2) % BlockSize;
958: e1a06000 mov r6, r0
//Berechnung des Blocks der gelesen werden mu
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -