ack/mach/6500/libem/sli.s

29 lines
419 B
ArmAsm
Raw Permalink Normal View History

1984-12-17 11:03:13 +00:00
.define Sli2
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 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