home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
A
/
ARC20.ARC
/
ARCMACS.ARC
/
SHIFT.MAC
< prev
next >
Wrap
Text File
|
1989-10-17
|
946b
|
55 lines
; 32-Bit Shift_Long f}r Turbo
; 151089 Tilmann Reh
.z80
extrn n,lw
ld ix,(lw) ; Zeiger auf Langwort
ld l,(ix)
ld h,(ix+1)
ld e,(ix+2)
ld d,(ix+3) ; Langwort in DEHL
ld bc,(n) ; Anzahl Schiebungen in BC
ld a,b
or c
ret z ; nicht schieben: Ende
bit 7,b
jr nz,shrn ; Anzahl negativ: rechts schieben
shln: inc b
dec b
jr nz,nul ; B<>0: Ergebnis mu~ 0 sein!
ld a,c
and 11100000b
jr nz,nul ; }ber 31 Bit: Ergebnis 0
ld b,c
loopl: sla l
rl h
rl e
rl d
djnz loopl ; schieben
jr ende ; Ergebnis speichern
shrn: inc b
jr nz,nul ; B<>FF : Ergebnis 0
ld a,c
neg
ld b,a ; Anzahl nach B
and 11100000b
jr nz,nul ; }ber 31 : Ergebnis 0
loopr: srl d
rr e
rr h
rr l
djnz loopr ; schieben
jr ende ; Ergebnis speichern
nul: ld de,0 ; Ergebnis 0 zun{chst in Register
ld hl,0
ende: ld (ix+3),d
ld (ix+2),e
ld (ix+1),h
ld (ix),l ; Ergebnis speichern
end