global _start
section .bss
strA resb 255
section .data
msgNot db "String is Wrong", 0xA,0x0
msgOk db "String is Good", 0xA,0x0
section .text
_start:
mov eax,3
mov ebx,0
mov ecx,strA
mov edx,255
int 0x80
xor ebx,ebx
mov edx,strA
doCheck:
mov bl, [edx]
inc edx
cmp bl, '0'
jb nextStep
cmp bl, '9'
ja nextStep
jmp doCheck
nextStep:
cmp ebx ,0xA
je printOk
mov eax,4
mov ebx,1
mov ecx, msgNot
mov edx,15
int 0x80
jmp exit
printOk:
mov eax,4
mov ebx,1
mov ecx, msgOk
mov edx,14
int 0x80
xor ebx, ebx
exit:
mov eax, 1
mov ebx, 0
int 0x80