123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- .define Sri4, Sru4
- .sect .text
- .sect .rom
- .sect .data
- .sect .bss
- .sect .text
- ! The subroutine Sri4 shifts a signed fourbyte integer to the
- ! right n times
- ! N is in register X.
- ! The subroutine Sru4 shifts an unsigned fourbyte integer to the
- ! right n times.
- Sru4:
- txa
- tay
- bne 1f
- rts
- 1: jsr Pop
- stx ARTH
- sta ARTH+1
- jsr Pop
- stx ARTH+2
- jmp 2f
- Sri4:
- txa
- tay
- bne 1f
- rts
- 1: jsr Pop
- stx ARTH
- sta ARTH+1
- jsr Pop
- stx ARTH+2
- tax
- bmi 1f
- 2: lsr a
- ror ARTH+2
- ror ARTH+1
- ror ARTH
- dey
- bne 2b
- beq 4f
- 1: sec
- ror a
- ror ARTH+2
- ror ARTH+1
- ror ARTH
- 3: dey
- bne 1b
- 4: ldx ARTH+2
- jsr Push
- lda ARTH+1
- ldx ARTH
- jmp Push
|