ack/mach/i80/libem/set2.s

42 lines
469 B
ArmAsm
Raw Normal View History

1985-03-18 12:46:51 +00:00
.define .set2
1987-01-28 18:57:04 +00:00
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
1985-03-18 12:46:51 +00:00
! Create 16 bits set with one bit on
! Expects in de-reg: bit number
! Yields in de-reg: resulting set
.set2: mov a,d !trap if bit number >= 16
ora a
cnz eset
mov a,e
cpi 16
cnc eset
pop h
shld .retadr
mov a,e
ani 7
mov d,a
mvi a,1
1: dcr d
jm 2f
rlc
jmp 1b
2: mov d,a
mov a,e
ani 8
jnz 3f ! jump if bit 3 is set
mov e,d
mvi d,0
jmp 4f
3: mvi e,0
4: lhld .retadr
pchl