📄 dprintf.lst
字号:
GAS LISTING /tmp/ccybp2uc.s page 1 1 .section .mdebug.abi32 2 .previous 3 .section .debug_abbrev,"",@progbits 4 $Ldebug_abbrev0: 5 .section .debug_info,"",@progbits 6 $Ldebug_info0: 7 .section .debug_line,"",@progbits 8 $Ldebug_line0: 9 0000 64030000 .text 9 0200FD00 9 00000101 9 FB0E0A00 9 01010101 10 $Ltext0: 11 .align 2 12 .ent fmtnum 13 .type fmtnum, @function 14 fmtnum: 15 $LFB2: 16 .file 1 "/mnt/hgfs/boot/booter/source/dprintf.c" 1:/mnt/hgfs/boot/booter/source/dprintf.c **** #include <stdarg.h> 2:/mnt/hgfs/boot/booter/source/dprintf.c **** #include "example.h" 3:/mnt/hgfs/boot/booter/source/dprintf.c **** 4:/mnt/hgfs/boot/booter/source/dprintf.c **** // 5:/mnt/hgfs/boot/booter/source/dprintf.c **** // dprintf - printf using no resources 6:/mnt/hgfs/boot/booter/source/dprintf.c **** // 7:/mnt/hgfs/boot/booter/source/dprintf.c **** // understands the following formats: 8:/mnt/hgfs/boot/booter/source/dprintf.c **** // 9:/mnt/hgfs/boot/booter/source/dprintf.c **** // %c - character 10:/mnt/hgfs/boot/booter/source/dprintf.c **** // &d - decimal 11:/mnt/hgfs/boot/booter/source/dprintf.c **** // %x - lower case hex 12:/mnt/hgfs/boot/booter/source/dprintf.c **** // %X - upper case hex 13:/mnt/hgfs/boot/booter/source/dprintf.c **** // 14:/mnt/hgfs/boot/booter/source/dprintf.c **** // all formats can have a field width specifier as in %8x and can 15:/mnt/hgfs/boot/booter/source/dprintf.c **** // also have leading zeros as in %08x. 16:/mnt/hgfs/boot/booter/source/dprintf.c **** // 17:/mnt/hgfs/boot/booter/source/dprintf.c **** 18:/mnt/hgfs/boot/booter/source/dprintf.c **** static int 19:/mnt/hgfs/boot/booter/source/dprintf.c **** fmtnum(char *buf, unsigned int n, int base, char *digits) 20:/mnt/hgfs/boot/booter/source/dprintf.c **** { 17 .loc 1 20 0 18 .frame $sp,0,$31 # vars= 0, regs= 0/0, args= 0, gp= 0 19 .mask 0x00000000,0 20 .fmask 0x00000000,0 21 .set noreorder 22 .set nomacro 23 24 .loc 1 20 0 25 0000 2110A000 move $2,$5 26 0004 21488000 move $9,$4 21:/mnt/hgfs/boot/booter/source/dprintf.c **** int i; 22:/mnt/hgfs/boot/booter/source/dprintf.c **** 23:/mnt/hgfs/boot/booter/source/dprintf.c **** i = 0; 27 .loc 1 23 0 24:/mnt/hgfs/boot/booter/source/dprintf.c **** if( n == 0 ) 28 .loc 1 24 0 29 0008 0600A014 bne $5,$0,$L5GAS LISTING /tmp/ccybp2uc.s page 2 30 000c 21400000 move $8,$0 31 25:/mnt/hgfs/boot/booter/source/dprintf.c **** { 26:/mnt/hgfs/boot/booter/source/dprintf.c **** buf[0] = '0'; 27:/mnt/hgfs/boot/booter/source/dprintf.c **** return 1; 32 .loc 1 27 0 33 0010 01000524 li $5,1 # 0x1 34 .loc 1 26 0 35 0014 30000224 li $2,48 36 0018 000082A0 sb $2,0($4) 28:/mnt/hgfs/boot/booter/source/dprintf.c **** } 29:/mnt/hgfs/boot/booter/source/dprintf.c **** 30:/mnt/hgfs/boot/booter/source/dprintf.c **** while( n != 0 ) 31:/mnt/hgfs/boot/booter/source/dprintf.c **** { 32:/mnt/hgfs/boot/booter/source/dprintf.c **** buf[i++] = digits[n % base]; 33:/mnt/hgfs/boot/booter/source/dprintf.c **** n /= base; 34:/mnt/hgfs/boot/booter/source/dprintf.c **** } 35:/mnt/hgfs/boot/booter/source/dprintf.c **** buf[i] = 0; // terminate string 36:/mnt/hgfs/boot/booter/source/dprintf.c **** return i; 37:/mnt/hgfs/boot/booter/source/dprintf.c **** } 37 .loc 1 37 0 38 001c 0800E003 j $31 39 0020 2110A000 move $2,$5 40 41 $L5: 42 .loc 1 32 0 43 0024 1B004600 divu $0,$2,$6 44 0028 0200C014 bne $6,$0,1f 45 002c 00000000 nop 46 0030 0D000700 break 7 47 1: 48 0034 21280901 addu $5,$8,$9 49 0038 01000825 addiu $8,$8,1 50 003c 10100000 mfhi $2 51 0040 21104700 addu $2,$2,$7 52 0044 00004390 lbu $3,0($2) 53 0048 12200000 mflo $4 54 .loc 1 33 0 55 004c 12100000 mflo $2 56 .loc 1 32 0 57 .loc 1 33 0 58 0050 F4FF8014 bne $4,$0,$L5 59 0054 0000A3A0 sb $3,0($5) 60 61 .loc 1 35 0 62 0058 21102801 addu $2,$9,$8 63 .loc 1 36 0 64 005c 21280001 move $5,$8 65 .loc 1 35 0 66 0060 000040A0 sb $0,0($2) 67 .loc 1 37 0 68 0064 0800E003 j $31 69 0068 2110A000 move $2,$5 70 71 .set macro 72 .set reorder 73 $LFE2:GAS LISTING /tmp/ccybp2uc.s page 3 74 .end fmtnum 75 .section .rodata.str1.4,"aMS",@progbits,1 76 .align 2 77 $LC2: 78 0000 30313233 .ascii "0123456789\000" 78 34353637 78 383900 79 000b 00 .align 2 80 $LC0: 81 000c 30313233 .ascii "0123456789abcdef\000" 81 34353637 81 38396162 81 63646566 81 00 82 001d 000000 .align 2 83 $LC1: 84 0020 30313233 .ascii "0123456789ABCDEF\000" 84 34353637 84 38394142 84 43444546 84 00 85 .text 86 .align 2 87 .globl printf 88 .ent printf 89 .type printf, @function 90 printf: 91 $LFB3: 38:/mnt/hgfs/boot/booter/source/dprintf.c **** 39:/mnt/hgfs/boot/booter/source/dprintf.c **** void 40:/mnt/hgfs/boot/booter/source/dprintf.c **** printf (const char *fmt,...) 41:/mnt/hgfs/boot/booter/source/dprintf.c **** { 92 .loc 1 41 0 93 .frame $sp,96,$31 # vars= 40, regs= 10/0, args= 16, gp= 0 94 .mask 0xc0ff0000,-4 95 .fmask 0x00000000,0 96 .set noreorder 97 .set nomacro 98 99 006c A0FFBD27 addiu $sp,$sp,-96 100 $LCFI0: 101 0070 5400B7AF sw $23,84($sp) 102 $LCFI1: 103 0074 4C00B5AF sw $21,76($sp) 104 $LCFI2: 105 0078 4400B3AF sw $19,68($sp) 106 $LCFI3: 107 007c 4000B2AF sw $18,64($sp) 108 $LCFI4: 109 0080 5C00BFAF sw $31,92($sp) 110 $LCFI5: 111 0084 5800BEAF sw $fp,88($sp) 112 $LCFI6: 113 0088 5000B6AF sw $22,80($sp) 114 $LCFI7: 115 008c 4800B4AF sw $20,72($sp) 116 $LCFI8:GAS LISTING /tmp/ccybp2uc.s page 4 117 0090 3C00B1AF sw $17,60($sp) 118 $LCFI9: 119 0094 3800B0AF sw $16,56($sp) 120 $LCFI10: 121 .loc 1 41 0 122 0098 21908000 move $18,$4 42:/mnt/hgfs/boot/booter/source/dprintf.c **** void ((*putcf)()) = (void *)putc; 43:/mnt/hgfs/boot/booter/source/dprintf.c **** va_list argp; 44:/mnt/hgfs/boot/booter/source/dprintf.c **** int *i; 45:/mnt/hgfs/boot/booter/source/dprintf.c **** char *charp; 46:/mnt/hgfs/boot/booter/source/dprintf.c **** int f1, pbi, ival; 47:/mnt/hgfs/boot/booter/source/dprintf.c **** int lzflag, rjust; 48:/mnt/hgfs/boot/booter/source/dprintf.c **** int c; 49:/mnt/hgfs/boot/booter/source/dprintf.c **** char pbuf[40]; 50:/mnt/hgfs/boot/booter/source/dprintf.c **** int col; 51:/mnt/hgfs/boot/booter/source/dprintf.c **** 52:/mnt/hgfs/boot/booter/source/dprintf.c **** va_start(argp,fmt); 53:/mnt/hgfs/boot/booter/source/dprintf.c **** col = 0; 54:/mnt/hgfs/boot/booter/source/dprintf.c **** while( c = *fmt++ ) 55:/mnt/hgfs/boot/booter/source/dprintf.c **** { 56:/mnt/hgfs/boot/booter/source/dprintf.c **** if( c == '%' ) 57:/mnt/hgfs/boot/booter/source/dprintf.c **** { 58:/mnt/hgfs/boot/booter/source/dprintf.c **** f1 = 0; 59:/mnt/hgfs/boot/booter/source/dprintf.c **** c = *fmt++; 60:/mnt/hgfs/boot/booter/source/dprintf.c **** if( c == '-' ) 61:/mnt/hgfs/boot/booter/source/dprintf.c **** { 62:/mnt/hgfs/boot/booter/source/dprintf.c **** rjust = 1; 63:/mnt/hgfs/boot/booter/source/dprintf.c **** c = *fmt++; 64:/mnt/hgfs/boot/booter/source/dprintf.c **** } 65:/mnt/hgfs/boot/booter/source/dprintf.c **** lzflag = (c == '0'); 66:/mnt/hgfs/boot/booter/source/dprintf.c **** while( isdigit(c) ) 67:/mnt/hgfs/boot/booter/source/dprintf.c **** { 68:/mnt/hgfs/boot/booter/source/dprintf.c **** f1 = f1 * 10 + c - '0'; 69:/mnt/hgfs/boot/booter/source/dprintf.c **** c = *fmt++; 70:/mnt/hgfs/boot/booter/source/dprintf.c **** } 71:/mnt/hgfs/boot/booter/source/dprintf.c **** 72:/mnt/hgfs/boot/booter/source/dprintf.c **** if( c == 'x' ) 73:/mnt/hgfs/boot/booter/source/dprintf.c **** { 74:/mnt/hgfs/boot/booter/source/dprintf.c **** i = (int *)va_arg(argp,int); 75:/mnt/hgfs/boot/booter/source/dprintf.c **** pbi = fmtnum(pbuf,(int)i,16,"0123456789abcdef"); 76:/mnt/hgfs/boot/booter/source/dprintf.c **** } 77:/mnt/hgfs/boot/booter/source/dprintf.c **** else if( c == 'X' ) 78:/mnt/hgfs/boot/booter/source/dprintf.c **** { 79:/mnt/hgfs/boot/booter/source/dprintf.c **** i = (int *)va_arg(argp,int); 80:/mnt/hgfs/boot/booter/source/dprintf.c **** pbi = fmtnum(pbuf,(int)i,16,"0123456789ABCDEF"); 81:/mnt/hgfs/boot/booter/source/dprintf.c **** } 82:/mnt/hgfs/boot/booter/source/dprintf.c **** else if( c == 'd' || c == 'D' ) 83:/mnt/hgfs/boot/booter/source/dprintf.c **** { 84:/mnt/hgfs/boot/booter/source/dprintf.c **** i = (int *)va_arg(argp,int); 85:/mnt/hgfs/boot/booter/source/dprintf.c **** ival = (int)i; 86:/mnt/hgfs/boot/booter/source/dprintf.c **** if( ival < 0 ) 87:/mnt/hgfs/boot/booter/source/dprintf.c **** { 88:/mnt/hgfs/boot/booter/source/dprintf.c **** (*putcf)('-'); 89:/mnt/hgfs/boot/booter/source/dprintf.c **** ival = -ival; 90:/mnt/hgfs/boot/booter/source/dprintf.c **** ++col; 91:/mnt/hgfs/boot/booter/source/dprintf.c **** } 92:/mnt/hgfs/boot/booter/source/dprintf.c **** pbi = fmtnum(pbuf,ival,10,"0123456789");GAS LISTING /tmp/ccybp2uc.s page 5 93:/mnt/hgfs/boot/booter/source/dprintf.c **** } 94:/mnt/hgfs/boot/booter/source/dprintf.c **** else if( c == 'c' ) 95:/mnt/hgfs/boot/booter/source/dprintf.c **** { 96:/mnt/hgfs/boot/booter/source/dprintf.c **** i = (int *)va_arg(argp,int); 97:/mnt/hgfs/boot/booter/source/dprintf.c **** pbi = 0; 98:/mnt/hgfs/boot/booter/source/dprintf.c **** (*putcf)(i); 99:/mnt/hgfs/boot/booter/source/dprintf.c **** ++col; 100:/mnt/hgfs/boot/booter/source/dprintf.c **** --f1; 101:/mnt/hgfs/boot/booter/source/dprintf.c **** } 102:/mnt/hgfs/boot/booter/source/dprintf.c **** else if( c == 's' || c == 'S' ) 103:/mnt/hgfs/boot/booter/source/dprintf.c **** { 104:/mnt/hgfs/boot/booter/source/dprintf.c **** i = (int *)va_arg(argp,int); 105:/mnt/hgfs/boot/booter/source/dprintf.c **** pbi = 0; 106:/mnt/hgfs/boot/booter/source/dprintf.c **** charp = (char *)(i); 107:/mnt/hgfs/boot/booter/source/dprintf.c **** while( *charp ) 108:/mnt/hgfs/boot/booter/source/dprintf.c **** { 109:/mnt/hgfs/boot/booter/source/dprintf.c **** (*putcf)(*charp++); 110:/mnt/hgfs/boot/booter/source/dprintf.c **** ++col; 111:/mnt/hgfs/boot/booter/source/dprintf.c **** --f1; 112:/mnt/hgfs/boot/booter/source/dprintf.c **** } 113:/mnt/hgfs/boot/booter/source/dprintf.c **** } 114:/mnt/hgfs/boot/booter/source/dprintf.c **** else if( c == 't' || c == 'T' ) 115:/mnt/hgfs/boot/booter/source/dprintf.c **** { 116:/mnt/hgfs/boot/booter/source/dprintf.c **** pbi = 0; 117:/mnt/hgfs/boot/booter/source/dprintf.c **** while( col < f1 ) 118:/mnt/hgfs/boot/booter/source/dprintf.c **** { 119:/mnt/hgfs/boot/booter/source/dprintf.c **** (*putcf)(' '); 120:/mnt/hgfs/boot/booter/source/dprintf.c **** ++col; 121:/mnt/hgfs/boot/booter/source/dprintf.c **** } 122:/mnt/hgfs/boot/booter/source/dprintf.c **** f1 = 0; 123:/mnt/hgfs/boot/booter/source/dprintf.c **** } 124:/mnt/hgfs/boot/booter/source/dprintf.c **** 125:/mnt/hgfs/boot/booter/source/dprintf.c **** f1 -= pbi; 126:/mnt/hgfs/boot/booter/source/dprintf.c **** while( f1 > 0 ) 127:/mnt/hgfs/boot/booter/source/dprintf.c **** { 128:/mnt/hgfs/boot/booter/source/dprintf.c **** if( lzflag ) 129:/mnt/hgfs/boot/booter/source/dprintf.c **** (*putcf)('0'); 130:/mnt/hgfs/boot/booter/source/dprintf.c **** else 131:/mnt/hgfs/boot/booter/source/dprintf.c **** (*putcf)(' '); 132:/mnt/hgfs/boot/booter/source/dprintf.c **** ++col; 133:/mnt/hgfs/boot/booter/source/dprintf.c **** --f1; 134:/mnt/hgfs/boot/booter/source/dprintf.c **** } 135:/mnt/hgfs/boot/booter/source/dprintf.c **** 136:/mnt/hgfs/boot/booter/source/dprintf.c **** while( pbi > 0 ) 137:/mnt/hgfs/boot/booter/source/dprintf.c **** { 138:/mnt/hgfs/boot/booter/source/dprintf.c **** (*putcf)(pbuf[--pbi]); 139:/mnt/hgfs/boot/booter/source/dprintf.c **** ++col; 140:/mnt/hgfs/boot/booter/source/dprintf.c **** } 141:/mnt/hgfs/boot/booter/source/dprintf.c **** } 142:/mnt/hgfs/boot/booter/source/dprintf.c **** else 143:/mnt/hgfs/boot/booter/source/dprintf.c **** { 144:/mnt/hgfs/boot/booter/source/dprintf.c **** (*putcf)(c); 145:/mnt/hgfs/boot/booter/source/dprintf.c **** ++col; 123 .loc 1 145 0 124 009c 00008480 lb $4,0($4) 125 .loc 1 42 0 126 00a0 0000023C lui $2,%hi(putc)GAS LISTING /tmp/ccybp2uc.s page 6 127 .loc 1 41 0 128 00a4 6400A5AF sw $5,100($sp) 129 00a8 6800A6AF sw $6,104($sp) 130 00ac 6C00A7AF sw $7,108($sp) 131 .loc 1 42 0 132 00b0 00005524 addiu $21,$2,%lo(putc) 133 .loc 1 145 0 134 00b4 01005226 addiu $18,$18,1 135 .loc 1 52 0 136 00b8 6400B727 addiu $23,$sp,100 137 .loc 1 53 0 138 .loc 1 145 0 139 00bc 3A008010 beq $4,$0,$L49 140 00c0 21980000 move $19,$0 141 142 00c4 1000BE27 addiu $fp,$sp,16
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -