summaryrefslogtreecommitdiff
path: root/device/lib/stm8/rand.asm
diff options
context:
space:
mode:
authorXavier ASUS <xavi92psx@gmail.com>2019-10-23 03:38:32 +0200
committerXavier ASUS <xavi92psx@gmail.com>2019-10-23 03:38:32 +0200
commit2cece67cb5af0339e4ab1f18b0bce2f0b4e6ebdd (patch)
treeb2fbf4e99f194213527304c9189abe65c163ac0b /device/lib/stm8/rand.asm
parented26eb00026800d1d2ff6289627216c7d1f0d459 (diff)
downloadsdcc-gas-2cece67cb5af0339e4ab1f18b0bce2f0b4e6ebdd.tar.gz
Removed intermediate files
Diffstat (limited to 'device/lib/stm8/rand.asm')
-rw-r--r--device/lib/stm8/rand.asm156
1 files changed, 0 insertions, 156 deletions
diff --git a/device/lib/stm8/rand.asm b/device/lib/stm8/rand.asm
deleted file mode 100644
index 92a3f11..0000000
--- a/device/lib/stm8/rand.asm
+++ /dev/null
@@ -1,156 +0,0 @@
-;--------------------------------------------------------
-; File Created by SDCC : free open source ANSI-C Compiler
-; Version 3.9.3 #11345 (Linux)
-;--------------------------------------------------------
- .module rand
- .optsdcc -mstm8
-
-;--------------------------------------------------------
-; Public variables in this module
-;--------------------------------------------------------
- .globl _rand
- .globl _srand
-;--------------------------------------------------------
-; ram data
-;--------------------------------------------------------
- .area DATA
-;--------------------------------------------------------
-; ram data
-;--------------------------------------------------------
- .area INITIALIZED
-_s:
- .ds 4
-;--------------------------------------------------------
-; absolute external ram data
-;--------------------------------------------------------
- .area DABS (ABS)
-
-; default segment ordering for linker
- .area HOME
- .area GSINIT
- .area GSFINAL
- .area CONST
- .area INITIALIZER
- .area CODE
-
-;--------------------------------------------------------
-; global & static initialisations
-;--------------------------------------------------------
- .area HOME
- .area GSINIT
- .area GSFINAL
- .area GSINIT
-;--------------------------------------------------------
-; Home
-;--------------------------------------------------------
- .area HOME
- .area HOME
-;--------------------------------------------------------
-; code
-;--------------------------------------------------------
- .area CODE
-; ../rand.c: 40: int rand(void)
-; -----------------------------------------
-; function rand
-; -----------------------------------------
-_rand:
- sub sp, #8
-; ../rand.c: 42: register unsigned long t = s;
- ldw x, _s+2
- ldw (0x03, sp), x
- ldw x, _s+0
- ldw (0x01, sp), x
-; ../rand.c: 44: t ^= t >> 10;
- ldw y, (0x02, sp)
- ldw (0x07, sp), y
- ld a, (0x01, sp)
- ld (0x06, sp), a
- clr (0x05, sp)
- srl (0x06, sp)
- rrc (0x07, sp)
- rrc (0x08, sp)
- srl (0x06, sp)
- rrc (0x07, sp)
- rrc (0x08, sp)
- ld a, (0x04, sp)
- xor a, (0x08, sp)
- ld xl, a
- ld a, (0x03, sp)
- xor a, (0x07, sp)
- ld xh, a
- ld a, (0x02, sp)
- xor a, (0x06, sp)
- push a
- ld a, (0x02, sp)
- xor a, (0x06, sp)
- ld yh, a
- pop a
-; ../rand.c: 45: t ^= t << 9;
- ldw (0x06, sp), x
- ld (0x05, sp), a
- clr (0x08, sp)
- sll (0x08, sp)
- rlc (0x07, sp)
- rlc (0x06, sp)
- rlc (0x05, sp)
- xor a, (0x06, sp)
- ld yl, a
- ld a, xl
- xor a, (0x08, sp)
- rlwa x
- xor a, (0x07, sp)
- ld xh, a
- ld a, yh
- xor a, (0x05, sp)
- ld yh, a
- ldw (0x03, sp), x
- ldw (0x01, sp), y
-; ../rand.c: 46: t ^= t >> 25;
- ld a, (0x01, sp)
- ld (0x08, sp), a
- clr (0x07, sp)
- clr (0x06, sp)
- clr (0x05, sp)
- srl (0x08, sp)
- ld a, (0x04, sp)
- xor a, (0x08, sp)
- ld xl, a
- ld a, (0x03, sp)
- xor a, (0x07, sp)
- ld xh, a
- ld a, (0x02, sp)
- xor a, (0x06, sp)
- ld yl, a
- ld a, (0x01, sp)
- xor a, (0x05, sp)
- ld yh, a
-; ../rand.c: 48: s = t;
- ldw _s+2, x
- ldw _s+0, y
-; ../rand.c: 50: return(t & RAND_MAX);
- sllw x
- srlw x
-; ../rand.c: 51: }
- addw sp, #8
- ret
-; ../rand.c: 53: void srand(unsigned int seed)
-; -----------------------------------------
-; function srand
-; -----------------------------------------
-_srand:
-; ../rand.c: 55: s = seed | 0x80000000; /* s shall not become 0 */
- ldw y, (0x03, sp)
- clrw x
- sllw x
- scf
- rrcw x
- ldw _s+2, y
- ldw _s+0, x
-; ../rand.c: 56: }
- ret
- .area CODE
- .area CONST
- .area INITIALIZER
-__xinit__s:
- .byte #0x80, #0x00, #0x00, #0x01 ; 2147483649
- .area CABS (ABS)