8000 minix/lib/ack/i386/em/em_inn.s at R3.1.3 · fyy3/minix · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
executable file
·
32 lines (30 loc) · 437 Bytes

em_inn.s

File metadata and controls

executable file
·
32 lines (30 loc) · 437 Bytes
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .inn
! #bytes in ecx
! bit # in eax
.inn:
xor edx,edx
mov ebx,8
div ebx
mov ebx,esp
add ebx,4
add ebx,eax
cmp eax,ecx
jae 1f
movb al,(ebx)
mov ebx,edx
testb al,bits(ebx)
jz 1f
mov eax,1
jmp 2f
1:
xor eax,eax
2:
pop ebx
add esp,ecx
! eax is result
jmp ebx
.sect .rom
bits:
.data1 1,2,4,8,16,32,64,128
0