Self printing program in assembly (part 2)

Shortest self printing program in assembly I managed to write. 69 bytes long. If anyone knows shorter version, please let me know.
.globl _start
        .type   _start, @function
_start:
        movl $_start, %esi
        xorl %edi, %edi
loop:
        movzb (%esi,%edi),%eax
        and  $0xf, %al
        cmp  $0xa, %al
        sbb  $0x69,%al
        das
        mov  $0x20, %dl
        shll $16, %edx
        orl %eax, %edx
        shll $0x8, %edx
        movzb (%esi,%edi),%eax
        shr  $0x4, %al
        cmp  $0xa, %al
        sbb  $0x69,%al
        das     
        orl %eax, %edx        
        movl %edx, (%esp)
        xorl %eax, %eax
        incl %eax
        movl %eax, %ebx
        shll $0x2, %eax
        movl %esp, %ecx
        movl %eax, %edx
        int $0x80
        incl %edi
        cmpl $69, %edi
        jle loop
        xorl %eax, %eax
        incl %eax
        int $0x80
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

nike

Search

Categories
Archives
« March 2015
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
    
       
Today