ack/mach/6500/libem/sli4.s

41 lines
576 B
ArmAsm
Raw Permalink Normal View History

1984-12-17 11:03:13 +00:00
.define Sli4
1987-01-30 18:41:42 +00:00
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
1984-12-17 11:03:13 +00:00
! This subroutine shift a signed or unsigned fourbyte integer
! n times left. N is in register X.
Sli4:
cpx #0
beq 9f ! zero shift, return input
lda SP+2 ! the shifting is done on the stack
sta ADDR ! address of integer (lowbyte)
lda SP+1
sta ADDR+1 ! address of integer (highbyte)
2: ldy #0
clc
lda (ADDR),y
rol a
sta (ADDR),y
iny
lda (ADDR),y
rol a
sta (ADDR),y
iny
lda (ADDR),y
rol a
sta (ADDR),y
iny
lda (ADDR),y
rol a
sta (ADDR),y ! shift left
dex
bne 2b
9: rts