ack/mach/6500/libem/sli.s
1987-01-30 18:41:42 +00:00

29 lines
419 B
ArmAsm

.define Sli2
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine shifts a signed or unsigned interger to the
! left n times.
! N is in register X.
! The returned value is in registerpair AX.
Sli2:
txa
bne 1f
jmp Pop ! zero shift, return input
1: tay
jsr Pop ! get integer
stx Ytmp ! save lowbyte
2: asl Ytmp
rol a ! shift left
dey
bne 2b
ldx Ytmp ! get lowbyte
rts