Changeset 592 in xtideuniversalbios for trunk/Assembly_Library/Src/Util/Bit.asm
- Timestamp:
- Jun 25, 2018, 10:29:27 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/Util/Bit.asm
r526 r592 24 24 ; Bit_GetSetCountToCXfromDXAX 25 25 ; Parameters 26 ; DX:AX: 26 ; DX:AX: Source DWORD 27 27 ; Returns: 28 28 ; CX: Number of bits set in DX:AX … … 58 58 push ax 59 59 60 xor cx, cx60 mov cx, -1 61 61 ALIGN JUMP_ALIGN 62 .BitScanLoop: 62 .IncrementCX: 63 inc cx 64 .ShiftLoop: 63 65 shr ax, 1 64 jz SHORT .LastBitInCF 65 adc cl, ch 66 jmp SHORT .BitScanLoop 67 ALIGN JUMP_ALIGN 68 .LastBitInCF: 69 adc cl, ch 66 jc SHORT .IncrementCX 67 jnz SHORT .ShiftLoop 70 68 71 69 pop ax … … 95 93 ret 96 94 95 97 96 ;-------------------------------------------------------------------- 98 97 ; Bit_SetToAXfromIndexInCL … … 115 114 pop dx 116 115 ret 116
Note:
See TracChangeset
for help on using the changeset viewer.