ack/mach/i86/libem/inn.s

33 lines
413 B
ArmAsm
Raw Permalink Normal View History

1987-01-08 10:13:48 +00:00
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
1985-02-07 15:33:13 +00:00
.define .inn
! #bytes in cx
! bit # in ax
.inn:
xor dx,dx
mov bx,8
div bx
mov bx,sp
add bx,2
add bx,ax
1985-02-07 15:33:13 +00:00
cmp ax,cx
jae 1f
movb al,(bx)
mov bx,dx
testb al,bits(bx)
1985-02-07 15:33:13 +00:00
jz 1f
mov ax,1
jmp 2f
1985-02-07 15:33:13 +00:00
1:
xor ax,ax
2:
pop bx
1985-02-07 15:33:13 +00:00
add sp,cx
! ax is result
jmp bx
1987-01-08 10:13:48 +00:00
.sect .data
1985-02-07 15:33:13 +00:00
bits:
1987-01-08 10:13:48 +00:00
.data1 1,2,4,8,16,32,64,128