代码拉取完成,页面将自动刷新
同步操作将从 西边/intel_asm 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
; 003.c
global _main
section .data
LC0:
db "please input a number string:",0Ah,0
LC1:
db "please input n(2 or 8 or 16):",0Ah,0
LC2:
db "%d",0
LC3:
db "data error!!",0
LC4:
db "the decimal is %ld",0Ah,0
extern _memset,_gets,_strupr,_printf,_strlen,_scanf,_exit
section .text
_main:
push ebp
mov ebp,esp
sub esp,0x1000
mov dword [ebp-0x1000],0 ; t1
mov dword [ebp-0xffc],0 ; i
mov dword [ebp-0xff8],0 ; n
mov dword [ebp-0xff4],0 ; t
mov dword [ebp-0xff0],0 ; t3
mov dword [ebp-0xfe0],0 ; a
mov dword [esp+8],100
mov dword [esp+4],0
lea eax,[ebp-0xfe0] ; a
mov [esp+0],eax
call _memset
sub esp,12
mov dword [esp+0],LC0
mov eax,0
call _printf
sub esp,4
lea eax,[ebp-0xfe0] ;a
mov [esp+0],eax
call _gets
sub esp,4
lea eax,[ebp-0xfe0] ;a
mov [esp+0],eax
call _strupr
sub esp,4
lea eax,[ebp-0xfe0] ;a
mov [esp+0],eax
call _strlen
sub esp,4
mov [ebp-0xff0],eax ; t3
mov dword [ebp-0x1000],0 ; t1
mov dword [esp+0],LC1
mov eax,0
call _printf
sub esp,4
lea eax,[ebp-0xff8] ; n
mov [esp+4],eax
mov dword [esp+0],LC2
mov eax,0
call _scanf
sub esp,8
mov dword [ebp-0xffc],0 ; i
jmp .Lmain_400
.Lmain_500:
mov eax,[ebp-0xffc] ; i
lea edi,[ebp-0xfe0] ; a
mov cl,[edi+eax] ; a[i]
sub cl,48 ; '0'
movsx ecx,cl
cmp ecx,[ebp-0xff8] ;n
jl .Lmain_490
mov eax,[ebp-0xffc] ;i
lea edi,[ebp-0xfe0] ;a
cmp byte [edi+eax],65 ; 'A'
jge .Lmain_490
jmp .Lmain_489
.Lmain_490:
mov eax,[ebp-0xffc] ; i
lea edi,[ebp-0xfe0] ;a
mov cl,[edi+eax] ; a[i]
sub cl,65 ; 'A'
add cl,10
movsx ecx,cl
cmp ecx,[ebp-0xff8] ; n
jl .Lmain_480
.Lmain_489:
mov dword [esp+0],LC3
mov eax,0
call _printf
sub esp,4
mov dword [esp+0],0
call _exit
sub esp,4
.Lmain_480:
mov eax,[ebp-0xffc] ;i
lea edi,[ebp-0xfe0] ;a
cmp byte [edi+eax],48 ;'0'
jl .Lmain_470
mov eax,[ebp-0xffc] ;i
lea edi,[ebp-0xfe0] ;a
cmp byte [edi+eax],57 ;'9'
jg .Lmain_470
mov eax,[ebp-0xffc] ;i
lea edi,[ebp-0xfe0] ;a
mov cl,[edi+eax] ; a[i]
sub cl,48 ; '0'
movsx ecx,cl
mov [ebp-0xff4],ecx ; t
jmp .Lmain_460
.Lmain_470:
cmp dword [ebp-0xff8],11 ; n
jl .Lmain_460
mov eax,[ebp-0xffc] ; i
lea edi,[ebp-0xfe0] ; a
cmp byte [edi+eax],65 ; 'A'
jl .Lmain_460
mov al,65 ; 'A'
add al,[ebp-0xff8] ; n
sub al,10
mov cl,al
mov eax,[ebp-0xffc] ;i
lea edi,[ebp-0xfe0] ;a
cmp cl,[edi+eax]
jl .Lmain_460
mov eax,[ebp-0xffc] ;i
lea edi,[ebp-0xfe0] ;a
mov al,[edi+eax] ; a[i]
sub al,65 ;'A'
add al,10
mov [ebp-0xff4],al ; t
.Lmain_460:
mov eax,[ebp-0x1000] ; t1
imul eax, [ebp-0xff8] ; n
add eax,[ebp-0xff4] ; t
mov [ebp-0x1000],eax ; t1
add dword [ebp-0xffc],1 ;i
.Lmain_400:
mov eax,[ebp-0xffc] ; i
cmp [ebp-0xff0],eax ; t3
jg .Lmain_500
mov eax,[ebp-0x1000] ; t1
mov [esp+4],eax
mov dword [esp+0],LC4
mov eax,0
call _printf
sub esp,8
mov eax,0
leave
ret
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。