global _start
section .data
buffer dw 0h
section .text
_start:
mov ecx, buffer
mov edx, 02h
call read
mov cx, word [buffer]
cmp cx, 3234h
je exit
cmp ch, 0ah
je one_dig
jmp two_dig
one_dig:
mov ecx, buffer
mov edx, 02h
call write
jmp _start
two_dig:
mov ecx, buffer
mov edx, 02h
call write
mov edx, 01h
mov ecx, buffer
call read ; read the 0ah
mov ecx, buffer
call write ; write the 0ah
jmp _start
exit:
mov eax, 01h ; exit()
xor ebx, ebx ; errno
int 80h
read:
mov eax, 03h ; read()
mov ebx, 00h ; stdin
int 80h
ret
write:
mov eax, 04h ; write()
mov ebx, 01h ; stdout
int 80h
ret
Z2xvYmFsIF9zdGFydAoKc2VjdGlvbiAuZGF0YQoJYnVmZmVyCWR3CTBoCgpzZWN0aW9uIC50ZXh0Cgpfc3RhcnQ6Cgltb3YJCWVjeCwgYnVmZmVyCgltb3YJCWVkeCwgMDJoCgljYWxsCQlyZWFkCgltb3YJCWN4LCB3b3JkIFtidWZmZXJdCgljbXAJCWN4LCAzMjM0aAoJamUJCWV4aXQKCWNtcAkJY2gsIDBhaAoJamUJCW9uZV9kaWcKCWptcAkJdHdvX2RpZwoKb25lX2RpZzoKCW1vdgkJZWN4LCBidWZmZXIKCW1vdgkJZWR4LCAwMmgKCWNhbGwJCXdyaXRlCglqbXAJCV9zdGFydAoKdHdvX2RpZzoKCW1vdgkJZWN4LCBidWZmZXIKCW1vdgkJZWR4LCAwMmgKCWNhbGwJCXdyaXRlCgltb3YJCWVkeCwgMDFoCgltb3YJCWVjeCwgYnVmZmVyCgljYWxsCQlyZWFkCQkJOyByZWFkIHRoZSAwYWgKCW1vdgkJZWN4LCBidWZmZXIKCWNhbGwJCXdyaXRlCQkJOyB3cml0ZSB0aGUgMGFoCglqbXAJCV9zdGFydAoKZXhpdDoKCW1vdgkJZWF4LCAwMWgJCTsgZXhpdCgpCgl4b3IJCWVieCwgZWJ4CQk7IGVycm5vCglpbnQJCTgwaAoKCnJlYWQ6Cgltb3YJCWVheCwgMDNoCQk7IHJlYWQoKQoJbW92CQllYngsIDAwaAkJOyBzdGRpbgoJaW50CQk4MGgKCXJldAp3cml0ZToKCW1vdgkJZWF4LCAwNGgJCTsgd3JpdGUoKQoJbW92CQllYngsIDAxaAkJOyBzdGRvdXQKCWludAkJODBoCglyZXQ=