.file "asmb.c" .data .align 16 const65: .rept 16 .byte 0x65 .endr const20: .rept 16 .byte 0x20 .endr constc0: .rept 16 .byte 0xc0 .endr const00: .rept 16 .byte 0x00 .endr .text .globl asmb asmb: //speicheradresse des parameters zurueckgeben mov %rdi, %rax .nextround: //speicheradresse des pointers zeigt auf 16*8 feld = 128bit movdqu (%rdi), %xmm11 // -64 - c movdqa constc0, %xmm9 psubb %xmm11, %xmm9 // Packed COMpare Greater Than (Byte)" // achtung beim intuitiven lesen des befehles. 'kleiner' // ist mit 'groesser' vertauscht und vice versa pcmpgtb const65, %xmm9 .differenz: // Y = min(X, 'a' - 'A') pand const20, %xmm9 // c += Y paddb %xmm9, %xmm11 // retuniere an die richtige speicheradresse movdqu %xmm11, (%rdi) //entspricht ein byte dem nullbyte dann steht an jener stelle 0xff sonst 0x00 pcmpeqb const00, %xmm11 //hol die MSBs aller bytes raus pmovmskb %xmm11, %ecx add $16, %rdi //ist %ecx gleich null? dann die naechsten 16byte bitte jecxz .nextround ret