Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dna_strand4(dna as const zstring ptr) as zstring ptr
- const iLen = TestLen
- static as zstring*(TestLen+1) pOut
- asm
- mov esi, [dna] 'input
- lea edi, [pOut] 'output
- mov ecx, iLen 'length
- sub edi, 4
- 0:
- mov edx, [esi] 'read 4 chars
- add esi, 4 'point to next char
- mov eax, edx 'make a copy of those 4 chars
- and edx, 0x02020202 'isolate bit 1... (2)
- xor edx, 0x02020202 'invert so... 2 = CG , 0 = AT
- lea ebx, [edx*8] 'ebx = N*8
- shr edx, 1 'edx = N\2
- add edx, ebx 'edx = N*8+N\2
- or edx, &h04040404 'edx ^ 4 (21 or 4)
- add edi, 4 'point to next out char
- xor eax, edx 'chars ^ edx
- sub ecx, 4 'decrement counter
- mov [edi], eax 'store char
- jnz 0b
- end asm
- return @pOut
- end function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement