📄 main.cod
字号:
; 620 : }
002fc e8bd41f0 ldmia sp!, {r4 - r8, lr}
00300 e12fff1e bx lr
00304 |$L44330|
00304 00000000 DCD |sg_sIdentifiers|
00308 00000000 DCD |sg_u8YYLEX|
0030c |$M44326|
ENDP ; |LexGetNextToken|
EXPORT |??_C@_03OLJLMEOE@?$AI?5?$AI?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_02PCIJFNDE@?$AN?6?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_04MFGIPFEC@?$FOC?$AN?6?$AA@| [ DATA ] ; `string'
IMPORT |strlen|
IMPORT |EdbgOutputDebugString|
IMPORT |OEMReadDebugByte|
00000 AREA |.text| { |GetLine| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$GetLine|, PDATA, SELECTION=5, ASSOC=|.text| { |GetLine| } ; comdat associative
|$T44356| DCD |$L44355|
DCD 0x40005301
00000 AREA |.rdata| { |??_C@_04MFGIPFEC@?$FOC?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_04MFGIPFEC@?$FOC?$AN?6?$AA@| DCB "^C", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_02PCIJFNDE@?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_02PCIJFNDE@?$AN?6?$AA@| DCB 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_03OLJLMEOE@?$AI?5?$AI?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_03OLJLMEOE@?$AI?5?$AI?$AA@| DCB 0x8, " ", 0x8, 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |GetLine| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |GetLine| PROC
; 624 : {
00000 |$L44355|
00000 e92d43f0 stmdb sp!, {r4 - r9, lr}
00004 |$M44353|
00004 e1a08001 mov r8, r1
00008 e1a07000 mov r7, r0
; 625 : UINT32 u32Position = 0;
; 626 : UINT32 u32Length = 0;
; 627 : INT16 s16IncomingByte = 0;
; 628 : UINT8 u8EscapeState = 0;
; 629 :
; 630 : // If there are any characters in the buffer already, print them out so we can start
; 631 : // on a non-clear edited line
; 632 :
; 633 : EdbgOutputDebugString(pu8InputBuffer);
0000c e3a06000 mov r6, #0
00010 eb000000 bl EdbgOutputDebugString
; 634 : u32Length = strlen(pu8InputBuffer);
00014 e1a00007 mov r0, r7
00018 eb000000 bl strlen
0001c e1a04000 mov r4, r0
00020 e3a09000 mov r9, #0
00024 |$L42606|
; 635 :
; 636 : while (1)
; 637 : {
; 638 : // Wait for a data byte to come in
; 639 :
; 640 : do
; 641 : {
; 642 : s16IncomingByte = OEMReadDebugByte();
00024 eb000000 bl OEMReadDebugByte
00028 e1a05800 mov r5, r0, lsl #16
0002c e1a05845 mov r5, r5, asr #16
; 643 : } while (OEM_DEBUG_READ_NODATA == s16IncomingByte);
00030 e3750001 cmn r5, #1
00034 0afffffa beq |$L42606|
; 644 :
; 645 : if (('\b' == s16IncomingByte) && (u32Length))
00038 e3550008 cmp r5, #8
0003c 1a000006 bne |$L42609|
00040 e3540000 cmp r4, #0
00044 0a000004 beq |$L42609|
; 646 : {
; 647 : EdbgOutputDebugString("\b \b");
00048 e59f00f8 ldr r0, [pc, #0xF8]
0004c eb000000 bl EdbgOutputDebugString
; 648 : u32Length--;
00050 e2444001 sub r4, r4, #1
; 649 : pu8InputBuffer[u32Length] = '\0';
00054 e7c49007 strb r9, [r4, +r7]
; 650 : }
; 651 : else
00058 eafffff1 b |$L42606|
0005c |$L42609|
; 652 : if ('\r' == s16IncomingByte)
0005c e355000d cmp r5, #0xD
00060 0a00002c beq |$L44337|
; 657 : }
; 658 : else
; 659 : if (0x03 == s16IncomingByte)
00064 e3550003 cmp r5, #3
00068 0a00002e beq |$L44338|
; 664 : }
; 665 : else
; 666 : if ((0x1b == s16IncomingByte) && (0 == u8EscapeState))
0006c e355001b cmp r5, #0x1B
00070 03560000 cmpeq r6, #0
; 667 : {
; 668 : u8EscapeState = 1;
00074 03a06001 moveq r6, #1
00078 0affffe9 beq |$L42606|
; 669 : }
; 670 : else
; 671 : if (('[' == s16IncomingByte) && (1 == u8EscapeState))
0007c e355005b cmp r5, #0x5B
00080 03560001 cmpeq r6, #1
; 672 : {
; 673 : u8EscapeState = 2;
00084 03a06002 moveq r6, #2
00088 0affffe5 beq |$L42606|
; 674 : }
; 675 : else
; 676 : if (('A' == s16IncomingByte || 'B' == s16IncomingByte) && (2 == u8EscapeState))
0008c e3550041 cmp r5, #0x41
00090 0a000001 beq |$L42623|
00094 e3550042 cmp r5, #0x42
00098 1a000010 bne |$L42622|
0009c |$L42623|
0009c e3560002 cmp r6, #2
000a0 1a00000e bne |$L42622|
; 677 : {
; 678 : // It's an UP or DOWN!
; 679 :
; 680 : u8EscapeState = 0;
000a4 e3a06000 mov r6, #0
000a8 ea000001 b |$L44351|
000ac |$L42625|
; 681 :
; 682 : while (u32Length--)
; 683 : {
; 684 : EdbgOutputDebugString("\b \b");
000ac e59f0094 ldr r0, [pc, #0x94]
000b0 eb000000 bl EdbgOutputDebugString
000b4 |$L44351|
000b4 e3540000 cmp r4, #0
000b8 e2444001 sub r4, r4, #1
000bc 1afffffa bne |$L42625|
; 685 : }
; 686 :
; 687 : if ('A' == s16IncomingByte)
000c0 e3550041 cmp r5, #0x41
000c4 0a00001b beq |$L44339|
; 691 : }
; 692 : if ('B' == s16IncomingByte)
000c8 e3550042 cmp r5, #0x42
000cc 1affffd4 bne |$L42606|
; 695 : return(LINE_DOWN);
000d0 e3a00003 mov r0, #3
000d4 |$L44352|
; 693 : {
; 694 : pu8InputBuffer[u32Length] = '\0';
000d4 e7c49007 strb r9, [r4, +r7]
; 711 : }
000d8 e8bd43f0 ldmia sp!, {r4 - r9, lr}
000dc e12fff1e bx lr
000e0 |$L42622|
; 696 : }
; 697 : }
; 698 : else
; 699 : if ((s16IncomingByte >= ' ') && (u32Length < u32MaxLength) && (0 == u8EscapeState))
000e0 e3550020 cmp r5, #0x20
000e4 ba000009 blt |$L42630|
000e8 e1540008 cmp r4, r8
000ec 2a000007 bcs |$L42630|
000f0 e3560000 cmp r6, #0
000f4 1a000005 bne |$L42630|
; 700 : {
; 701 : pu8InputBuffer[u32Length] = (UINT8) s16IncomingByte;
000f8 e20530ff and r3, r5, #0xFF
; 702 : OEMWriteDebugByte(pu8InputBuffer[u32Length]);
000fc e1a00003 mov r0, r3
00100 e7c43007 strb r3, [r4, +r7]
00104 eb000000 bl OEMWriteDebugByte
; 703 : u32Length++;
00108 e2844001 add r4, r4, #1
; 704 : }
; 705 : else
0010c eaffffc4 b |$L42606|
00110 |$L42630|
; 706 : {
; 707 : u8EscapeState = 0;
00110 e3a06000 mov r6, #0
; 708 : }
; 709 :
; 710 : }
00114 eaffffc2 b |$L42606|
00118 |$L44337|
; 653 : {
; 654 : EdbgOutputDebugString("\r\n");
00118 e59f0024 ldr r0, [pc, #0x24]
0011c eb000000 bl EdbgOutputDebugString
; 655 : pu8InputBuffer[u32Length] = '\0';
; 656 : return(LINE_OK);
00120 e3a00000 mov r0, #0
00124 eaffffea b |$L44352|
00128 |$L44338|
; 660 : {
; 661 : EdbgOutputDebugString("^C\r\n");
00128 e59f0010 ldr r0, [pc, #0x10]
0012c eb000000 bl EdbgOutputDebugString
; 662 : pu8InputBuffer[u32Length] = '\0';
; 663 : return(LINE_EXIT);
00130 e3a00001 mov r0, #1
00134 eaffffe6 b |$L44352|
00138 |$L44339|
; 688 : {
; 689 : pu8InputBuffer[u32Length] = '\0';
; 690 : return(LINE_UP);
00138 e3a00002 mov r0, #2
0013c eaffffe4 b |$L44352|
00140 |$L44358|
00140 00000000 DCD |??_C@_04MFGIPFEC@?$FOC?$AN?6?$AA@|
00144 00000000 DCD |??_C@_02PCIJFNDE@?$AN?6?$AA@|
00148 00000000 DCD |??_C@_03OLJLMEOE@?$AI?5?$AI?$AA@|
0014c |$M44354|
ENDP ; |GetLine|
EXPORT |??_C@_0BC@FDNMOHPL@Missing?5address?$AN?6?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_0EJ@KGIEPNHD@Expected?5constant?5or?5optional?5?8b@| [ DATA ] ; `string'
EXPORT |??_C@_0CO@NLPKAHEO@Expected?5data?5byte?1word?1dword?5af@| [ DATA ] ; `string'
00000 AREA |.text| { |ParseForAddressAndData| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$ParseForAddressAndData|, PDATA, SELECTION=5, ASSOC=|.text| { |ParseForAddressAndData| } ; comdat associative
|$T44372| DCD |$L44371|
DCD 0x40003901
00000 AREA |.rdata| { |??_C@_0CO@NLPKAHEO@Expected?5data?5byte?1word?1dword?5af@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CO@NLPKAHEO@Expected?5data?5byte?1word?1dword?5af@| DCB "Expected"
DCB " data byte/word/dword after address", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0EJ@KGIEPNHD@Expected?5constant?5or?5optional?5?8b@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0EJ@KGIEPNHD@Expected?5constant?5or?5optional?5?8b@| DCB "Expected"
DCB " constant or optional 'byte', 'word', or 'dword' after c"
DCB "ommand", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0BC@FDNMOHPL@Missing?5address?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BC@FDNMOHPL@Missing?5address?$AN?6?$AA@| DCB "Missing address", 0xd
DCB 0xa, 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |ParseForAddressAndData| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |ParseForAddressAndData| PROC
; 717 : {
00000 |$L44371|
00000 e92d41f0 stmdb sp!, {r4 - r8, lr}
00004 |$M44369|
00004 e1a08003 mov r8, r3
00008 e1b06002 movs r6, r2
0000c e1a07001 mov r7, r1
00010 e1a04000 mov r4, r0
; 718 : ELex eToken;
; 719 :
; 720 : *pu32Address = 0;
; 721 :
; 722 : if (pu32Data)
; 723 : {
; 724 : *pu32Data = 0;
; 725 : }
; 726 :
; 727 : *peDataSize = sg_eDatasize;
00014 e59fe0c4 ldr lr, [pc, #0xC4]
00018 e3a03000 mov r3, #0
0001c e5873000 str r3, [r7]
00020 e59ee000 ldr lr, [lr]
00024 15863000 strne r3, [r6]
00028 e584e000 str lr, [r4]
; 728 :
; 729 : eToken = LexGetNextToken();
0002c eb000000 bl LexGetNextToken
; 730 :
; 731 : // Look for optional data size
; 732 :
; 733 : if (LEX_BYTE == eToken || LEX_WORD == eToken || LEX_DWORD == eToken)
00030 e3a0ef42 mov lr, #0x42, 30
00034 e38ee001 orr lr, lr, #1
00038 e150000e cmp r0, lr
0003c 0a000007 beq |$L42646|
00040 e3a0ef42 mov lr, #0x42, 30
00044 e38ee002 orr lr, lr, #2
00048 e150000e cmp r0, lr
0004c 0a000003 beq |$L42646|
00050 e3a03f42 mov r3, #0x42, 30
00054 e3833003 orr r3, r3, #3
00058 e1500003 cmp r0, r3
0005c 1a000001 bne |$L42645|
00060 |$L42646|
; 734 : {
; 735 : *peDataSize = eToken;
00060 e5840000 str r0, [r4]
; 736 : eToken = LexGetNextToken();
00064 eb000000 bl LexGetNextToken
00068 |$L42645|
; 737 : }
; 738 :
; 739 : if (LEX_EOF == eToken)
00068 e3500c01 cmp r0, #1, 24
; 740 : {
; 741 : EdbgOutputDebugString("Missing address\r\n");
0006c 059f0068 ldreq r0, [pc, #0x68]
00070 0a00000d beq |$L44368|
; 742 : return(FALSE);
; 743 : }
; 744 :
; 745 : if (eToken != LEX_CONSTANT)
00074 e3a04c01 mov r4, #1, 24
00078 e3844001 orr
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -