;---------------------------------------------------------------- ; This is a module in the PLIUTIL library ; ; This module shifts bit(16) strings around ; ; Written by Richard Holmes 10-12-84 ; Last Update Richard Holmes 10-12-84 ;---------------------------------------------------------------- ; name 'shift' public shl16,shr16 extrn getp1,getp2 ; ; Return a bit 16 shifted left by the bin(15) ; shl16: call fetch ora a shl$loop: mov a,l ral mov l,a mov a,h ral mov h,a dcx d mov a,e ora d jnz shl$loop ret ; shr16: call fetch ora a ; Clear initial carry flag shr$loop: mov a,h ; top 8 rar ; move right mov h,a mov a,l rar ; move the bit in mov l,a ; dcx d mov a,e ora d ; set Zero, clear carry flags jnz shr$loop ret ; fetch: mov e,m inx h mov d,m ; de -> parameter 1 inx h push h ; save xchg ; hl -> parameter mov e,m inx h mov d,m pop h ; restore address mov c,m inx h mov b,m ; Get second address ldax b mov l,a inx b ldax b mov h,a xchg ; make HL first parameter ret ; end