## ## ## ## ## ## DRESS LANG ** Przyklad kodu: $ cat dress2.dr mamy 15 komorek. dopoki mamy komorki pierdol komorki kurwa i ciulaj zegarki kurwa. lysy pokaz zegarki i chuja. ** Kompilacja do test.asm: $ ./Dress < dress2.dr LET NUMBER REGISTER2 WHILE LET REGISTER2 DEC REGISTER2 JOIN >>i<< INC REGISTER1 JOIN IO INT_OUT REGISTER1 >>i<< EOF ** Wygenerowany kod: $ cat test.asm /* Compiled Dress code */ .data reg_1: .long 0x00000000 reg_2: .long 0x00000000 puti_str: .string "%d\n" putc_str: .string "%c\n" .text .global main builtin_puti: push %eax push $puti_str call printf pop %eax pop %eax ret builtin_putc: push %eax push $putc_str call printf pop %eax pop %eax ret main: movl $15, reg_2 while_0: /* Begin condition */ /* Begin register access */ movl reg_2, %eax /* End register access */ push %eax mov $0 , %eax pop %ebx cmpl %ebx, %eax JE while_end_0 /* End condition */ /* Begin register access */ movl reg_2, %eax /* End register access */ DEC %eax /* Begin register store */ movl %eax, reg_2 /* End register store */ /* Begin register access */ movl reg_1, %eax /* End register access */ INC %eax /* Begin register store */ movl %eax, reg_1 /* End register store */ /* Begin register access */ movl reg_1, %eax /* End register access */ call builtin_puti jmp while_0 while_end_0: exit: movl $1, %eax xor %ebx,%ebx int $0x80 .end ** Kompilacja i polinkowanie assemblera: $ make test i686-pc-linux-gnu-as -g -o test.o test.asm i686-pc-linux-gnu-gcc -g -Wall -o test test.o ** Efekt po odpaleniu: $ ./test 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 $