1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-02-20 15:29:10 +00:00

Added pseuso random number generator to <stdlib.h>. Closes #434

This commit is contained in:
jespergravgaard 2020-05-05 07:46:48 +02:00
parent 4d4169ef32
commit 36f82d5745
19 changed files with 2367 additions and 2042 deletions

View File

@ -1,6 +1,12 @@
ldy #6 lda {m1}
!: asl
lsr {m1}+1 sta $ff
ror {m1} lda {m1}+1
dey rol
bne !- sta {m1}
lda #0
rol
sta {m1}+1
asl $ff
rol {m1}
rol {m1}+1

View File

@ -48,3 +48,11 @@ int abs(int x);
// Returns the absolute value of long int x. // Returns the absolute value of long int x.
long labs(long x); long labs(long x);
// The maximal random value
#define RAND_MAX 65335
// Returns a pseudo-random number in the range of 0 to RAND_MAX (65535)
unsigned int rand();
// Seeds the random number generator used by the function rand.
void srand(unsigned int seed);

View File

@ -284,3 +284,22 @@ inline long labs(long x) {
else else
return x; return x;
} }
// The random state variable
unsigned int rand_state = 1;
// Returns a pseudo-random number in the range of 0 to RAND_MAX (65535)
// Uses an xorshift pseudorandom number generator that hits all different values
// Information https://en.wikipedia.org/wiki/Xorshift
// Source http://www.retroprogramming.com/2017/07/xorshift-pseudorandom-numbers-in-z80.html
unsigned int rand() {
rand_state ^= rand_state << 7;
rand_state ^= rand_state >> 9;
rand_state ^= rand_state << 8;
return rand_state;
}
// Seeds the random number generator used by the function rand.
void srand(unsigned int seed) {
rand_state = seed;
}

View File

@ -12,7 +12,6 @@ void start(void) {
sta LAST_TIME sta LAST_TIME
stx LAST_TIME + 1 stx LAST_TIME + 1
} }
rand_seed = 6474;
} }
void end(void) { void end(void) {
@ -23,23 +22,3 @@ void end(void) {
print_uint(Ticks); print_uint(Ticks);
print_ln(); print_ln();
} }
unsigned int rand_seed;
char rand() {
unsigned int* const RAND_SEED = &rand_seed;
asm{
ldx #8
lda RAND_SEED+0
__rand_loop:
asl
rol RAND_SEED+1
bcc __no_eor
eor #$2D
__no_eor:
dex
bne __rand_loop
sta RAND_SEED+0
}
return (char)rand_seed;
}

View File

@ -114,7 +114,6 @@ int main (void)
char block; char block;
unsigned int count = 500; unsigned int count = 500;
rand_seed = 6474;
makechar(); makechar();
start(); start();

View File

@ -9,7 +9,7 @@ void main() {
clrscr(); clrscr();
textcolor(WHITE); textcolor(WHITE);
printf("generating unique randoms..."); printf("generating unique randoms...");
unsigned int first = rand(); unsigned int first = _rand();
unsigned long cnt = 0; unsigned long cnt = 0;
textcolor(LIGHT_BLUE); textcolor(LIGHT_BLUE);
char col = 3, row = 1; char col = 3, row = 1;
@ -26,7 +26,7 @@ void main() {
col = 3; col = 3;
} }
} }
rnd = rand(); rnd = _rand();
} while(rnd!=first); } while(rnd!=first);
gotoxy(28,0); gotoxy(28,0);
printf("found %lu",cnt); printf("found %lu",cnt);
@ -37,17 +37,17 @@ void main() {
#define RAND_MAX 65335 #define RAND_MAX 65335
// The random state variable // The random state variable
unsigned int rand_state = 1; unsigned int _rand_state = 1;
// Returns a pseudo-random number in the range of 0 to RAND_MAX (65535) // Returns a pseudo-random number in the range of 0 to RAND_MAX (65535)
unsigned int rand() { unsigned int _rand() {
rand_state ^= rand_state << 7; _rand_state ^= _rand_state << 7;
rand_state ^= rand_state >> 9; _rand_state ^= _rand_state >> 9;
rand_state ^= rand_state << 8; _rand_state ^= _rand_state << 8;
return rand_state; return _rand_state;
} }
// Seeds the random number generator used by the function rand. // Seeds the random number generator used by the function rand.
void srand(unsigned int seed) { void _srand(unsigned int seed) {
rand_state = seed; _rand_state = seed;
} }

View File

@ -476,12 +476,18 @@ gfx_mode: {
and #>$3fff and #>$3fff
sta.z __47+1 sta.z __47+1
// ((word)get_vic_screen(*form_vic_screen)&$3fff)/$40 // ((word)get_vic_screen(*form_vic_screen)&$3fff)/$40
ldy #6 lda.z __48
!: asl
lsr.z __48+1 sta.z $ff
ror.z __48 lda.z __48+1
dey rol
bne !- sta.z __48
lda #0
rol
sta.z __48+1
asl.z $ff
rol.z __48
rol.z __48+1
// get_vic_charset(*form_vic_gfx) // get_vic_charset(*form_vic_gfx)
lda form_vic_gfx lda form_vic_gfx
jsr get_vic_charset jsr get_vic_charset

View File

@ -20969,12 +20969,18 @@ gfx_mode: {
and #>$3fff and #>$3fff
sta.z __47+1 sta.z __47+1
// [97] (word~) gfx_mode::$48 ← (word~) gfx_mode::$47 >> (byte) 6 -- vwuz1=vwuz1_ror_6 // [97] (word~) gfx_mode::$48 ← (word~) gfx_mode::$47 >> (byte) 6 -- vwuz1=vwuz1_ror_6
ldy #6 lda.z __48
!: asl
lsr.z __48+1 sta.z $ff
ror.z __48 lda.z __48+1
dey rol
bne !- sta.z __48
lda #0
rol
sta.z __48+1
asl.z $ff
rol.z __48
rol.z __48+1
// [98] (byte) get_vic_charset::idx#0 ← *((const nomodify byte*) form_vic_gfx) -- vbuaa=_deref_pbuc1 // [98] (byte) get_vic_charset::idx#0 ← *((const nomodify byte*) form_vic_gfx) -- vbuaa=_deref_pbuc1
lda form_vic_gfx lda form_vic_gfx
// [99] call get_vic_charset // [99] call get_vic_charset
@ -26690,15 +26696,15 @@ Removing unreachable instruction jmp __b9
Removing unreachable instruction jmp __b14 Removing unreachable instruction jmp __b14
Removing unreachable instruction jmp __b7 Removing unreachable instruction jmp __b7
Succesful ASM optimization Pass5UnreachableCodeElimination Succesful ASM optimization Pass5UnreachableCodeElimination
Fixing long branch [746] beq __b6 to bne Fixing long branch [752] beq __b6 to bne
Fixing long branch [750] beq __b7 to bne Fixing long branch [756] beq __b7 to bne
Fixing long branch [754] beq __b8 to bne Fixing long branch [760] beq __b8 to bne
Fixing long branch [758] beq __b9 to bne Fixing long branch [764] beq __b9 to bne
Fixing long branch [762] beq __b10 to bne Fixing long branch [768] beq __b10 to bne
Fixing long branch [766] beq __b11 to bne Fixing long branch [772] beq __b11 to bne
Fixing long branch [770] beq __b12 to bne Fixing long branch [776] beq __b12 to bne
Fixing long branch [774] beq __b13 to bne Fixing long branch [780] beq __b13 to bne
Fixing long branch [1339] bmi __b2 to bpl Fixing long branch [1345] bmi __b2 to bpl
FINAL SYMBOL TABLE FINAL SYMBOL TABLE
(label) @1 (label) @1
@ -28189,7 +28195,7 @@ reg byte a [ gfx_init_screen0::$3 ]
FINAL ASSEMBLER FINAL ASSEMBLER
Score: 10118890 Score: 10118912
// File Comments // File Comments
// Interactive Explorer for C64DTV Screen Modes // Interactive Explorer for C64DTV Screen Modes
@ -28829,12 +28835,18 @@ gfx_mode: {
sta.z __47+1 sta.z __47+1
// ((word)get_vic_screen(*form_vic_screen)&$3fff)/$40 // ((word)get_vic_screen(*form_vic_screen)&$3fff)/$40
// [97] (word~) gfx_mode::$48 ← (word~) gfx_mode::$47 >> (byte) 6 -- vwuz1=vwuz1_ror_6 // [97] (word~) gfx_mode::$48 ← (word~) gfx_mode::$47 >> (byte) 6 -- vwuz1=vwuz1_ror_6
ldy #6 lda.z __48
!: asl
lsr.z __48+1 sta.z $ff
ror.z __48 lda.z __48+1
dey rol
bne !- sta.z __48
lda #0
rol
sta.z __48+1
asl.z $ff
rol.z __48
rol.z __48+1
// get_vic_charset(*form_vic_gfx) // get_vic_charset(*form_vic_gfx)
// [98] (byte) get_vic_charset::idx#0 ← *((const nomodify byte*) form_vic_gfx) -- vbuaa=_deref_pbuc1 // [98] (byte) get_vic_charset::idx#0 ← *((const nomodify byte*) form_vic_gfx) -- vbuaa=_deref_pbuc1
lda form_vic_gfx lda form_vic_gfx

View File

@ -1,7 +1,5 @@
Resolved forward reference rand_seed to (word) rand_seed
Fixing struct type size struct node to 4 Fixing struct type size struct node to 4
Setting inferred volatile on symbol affected by address-of (word) last_time Setting inferred volatile on symbol affected by address-of (word) last_time
Setting inferred volatile on symbol affected by address-of (word) rand_seed
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA CONTROL FLOW GRAPH SSA

View File

@ -9,10 +9,11 @@
.label SCREEN1 = $e000 .label SCREEN1 = $e000
.label SCREEN2 = $e400 .label SCREEN2 = $e400
.label CHARSET = $e800 .label CHARSET = $e800
.label last_time = $a .label last_time = $c
.label rand_seed = $c // The random state variable
.label print_line_cursor = 4 .label rand_state = 9
.label print_char_cursor = 6 .label print_line_cursor = 5
.label print_char_cursor = 7
.label Ticks = $10 .label Ticks = $10
.label Ticks_1 = $12 .label Ticks_1 = $12
__bbegin: __bbegin:
@ -20,20 +21,12 @@ __bbegin:
lda #<0 lda #<0
sta.z last_time sta.z last_time
sta.z last_time+1 sta.z last_time+1
// rand_seed
sta.z rand_seed
sta.z rand_seed+1
jsr main jsr main
rts rts
main: { main: {
.label block = $e .label block = $e
.label v = $f .label v = $f
.label count = 4 .label count = 5
// rand_seed = 6474
lda #<$194a
sta.z rand_seed
lda #>$194a
sta.z rand_seed+1
// makechar() // makechar()
jsr makechar jsr makechar
// start() // start()
@ -102,17 +95,17 @@ main: {
dec.z count dec.z count
jmp __b1 jmp __b1
} }
// doplasma(byte* zp(6) scrn) // doplasma(byte* zp(7) scrn)
doplasma: { doplasma: {
.const c2A = 0 .const c2A = 0
.const c2B = 0 .const c2B = 0
.label c1a = 9 .label c1a = $14
.label c1b = $14 .label c1b = $19
.label ii = 8 .label ii = $b
.label c2a = 2 .label c2a = 3
.label c2b = 3 .label c2b = 4
.label i = $17 .label i = 2
.label scrn = 6 .label scrn = 7
lda #0 lda #0
sta.z c1b sta.z c1b
sta.z c1a sta.z c1a
@ -325,24 +318,22 @@ start: {
jsr $ffde jsr $ffde
sta LAST_TIME sta LAST_TIME
stx LAST_TIME+1 stx LAST_TIME+1
// rand_seed = 6474
lda #<$194a
sta.z rand_seed
lda #>$194a
sta.z rand_seed+1
// } // }
rts rts
} }
makechar: { makechar: {
.label __4 = $17 .label __3 = $17
.label __4 = $19
.label __7 = $15 .label __7 = $15
.label __8 = $15 .label __8 = $15
.label s = $14 .label s = $14
.label c = $10 .label c = $10
.label i = 8 .label i = $b
.label b = 9
.label __10 = $15 .label __10 = $15
lda #<0 lda #<1
sta.z rand_state
lda #>1
sta.z rand_state+1
sta.z c sta.z c
sta.z c+1 sta.z c+1
__b1: __b1:
@ -377,12 +368,11 @@ makechar: {
!: !:
jmp __b1 jmp __b1
__b4: __b4:
lda #0 ldy #0
sta.z b ldx #0
tay
__b5: __b5:
// for (ii = 0; ii < 8; ++ii) // for (ii = 0; ii < 8; ++ii)
cpy #8 cpx #8
bcc __b6 bcc __b6
// c<<3 // c<<3
lda.z c lda.z c
@ -411,7 +401,7 @@ makechar: {
lda.z __10+1 lda.z __10+1
adc #>CHARSET adc #>CHARSET
sta.z __10+1 sta.z __10+1
lda.z b tya
ldy #0 ldy #0
sta (__10),y sta (__10),y
// for (i = 0; i < 8; ++i) // for (i = 0; i < 8; ++i)
@ -421,37 +411,76 @@ makechar: {
// rand() // rand()
jsr rand jsr rand
// rand() & 0xFF // rand() & 0xFF
and #$ff lda #$ff
and.z __3
sta.z __4 sta.z __4
// if ((rand() & 0xFF) > s) // if ((rand() & 0xFF) > s)
lda.z s lda.z s
cmp.z __4 cmp.z __4
bcs __b8 bcs __b8
// b |= bittab[ii] // b |= bittab[ii]
lda bittab,y tya
ora.z b ora bittab,x
sta.z b tay
__b8: __b8:
// for (ii = 0; ii < 8; ++ii) // for (ii = 0; ii < 8; ++ii)
iny inx
jmp __b5 jmp __b5
} }
// Returns a pseudo-random number in the range of 0 to RAND_MAX (65535)
// Uses an xorshift pseudorandom number generator that hits all different values
// Information https://en.wikipedia.org/wiki/Xorshift
// Source http://www.retroprogramming.com/2017/07/xorshift-pseudorandom-numbers-in-z80.html
rand: { rand: {
.label RAND_SEED = rand_seed .label __0 = $1a
// asm .label __1 = $1c
ldx #8 .label __2 = $1e
lda RAND_SEED+0 .label return = $17
__rand_loop: // rand_state << 7
asl lda.z rand_state+1
rol RAND_SEED+1 lsr
bcc __no_eor lda.z rand_state
eor #$2d ror
__no_eor: sta.z __0+1
dex lda #0
bne __rand_loop ror
sta RAND_SEED+0 sta.z __0
// return (char)rand_seed; // rand_state ^= rand_state << 7
lda.z rand_seed lda.z rand_state
eor.z __0
sta.z rand_state
lda.z rand_state+1
eor.z __0+1
sta.z rand_state+1
// rand_state >> 9
lsr
sta.z __1
lda #0
sta.z __1+1
// rand_state ^= rand_state >> 9
lda.z rand_state
eor.z __1
sta.z rand_state
lda.z rand_state+1
eor.z __1+1
sta.z rand_state+1
// rand_state << 8
lda.z rand_state
sta.z __2+1
lda #0
sta.z __2
// rand_state ^= rand_state << 8
lda.z rand_state
eor.z __2
sta.z rand_state
lda.z rand_state+1
eor.z __2+1
sta.z rand_state+1
// return rand_state;
lda.z rand_state
sta.z return
lda.z rand_state+1
sta.z return+1
// } // }
rts rts
} }

View File

@ -5,246 +5,250 @@
[1] (volatile word) last_time ← (word) 0 [1] (volatile word) last_time ← (word) 0
to:@2 to:@2
@2: scope:[] from @1 @2: scope:[] from @1
[2] (volatile word) rand_seed ← (word) 0 [2] phi()
to:@3 [3] call main
@3: scope:[] from @2
[3] phi()
[4] call main
to:@end to:@end
@end: scope:[] from @3 @end: scope:[] from @2
[5] phi() [4] phi()
(signed word()) main() (signed word()) main()
main: scope:[main] from @3 main: scope:[main] from @2
[6] (volatile word) rand_seed ← (word) $194a [5] phi()
[7] call makechar [6] call makechar
to:main::@4 to:main::@4
main::@4: scope:[main] from main main::@4: scope:[main] from main
[8] phi() [7] phi()
[9] call start [8] call start
to:main::@5 to:main::@5
main::@5: scope:[main] from main::@4 main::@5: scope:[main] from main::@4
[10] (byte) main::block#1 ← *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) [9] (byte) main::block#1 ← *((byte*)(const nomodify struct MOS6526_CIA*) CIA2)
[11] (byte) main::tmp#1 ← (byte) main::block#1 & (byte) $fc [10] (byte) main::tmp#1 ← (byte) main::block#1 & (byte) $fc
[12] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) main::tmp#1 [11] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) main::tmp#1
[13] (byte) main::v#1 ← *((const nomodify byte*) VIC_MEMORY) [12] (byte) main::v#1 ← *((const nomodify byte*) VIC_MEMORY)
to:main::@1 to:main::@1
main::@1: scope:[main] from main::@5 main::@7 main::@1: scope:[main] from main::@5 main::@7
[14] (word) main::count#2 ← phi( main::@5/(word) $1f4 main::@7/(word) main::count#1 ) [13] (word) main::count#2 ← phi( main::@5/(word) $1f4 main::@7/(word) main::count#1 )
[15] if((byte) 0!=(word) main::count#2) goto main::@2 [14] if((byte) 0!=(word) main::count#2) goto main::@2
to:main::@3 to:main::@3
main::@3: scope:[main] from main::@1 main::@3: scope:[main] from main::@1
[16] *((const nomodify byte*) VIC_MEMORY) ← (byte) main::v#1 [15] *((const nomodify byte*) VIC_MEMORY) ← (byte) main::v#1
[17] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) main::block#1 [16] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) main::block#1
[18] call end [17] call end
to:main::@return to:main::@return
main::@return: scope:[main] from main::@3 main::@return: scope:[main] from main::@3
[19] return [18] return
to:@return to:@return
main::@2: scope:[main] from main::@1 main::@2: scope:[main] from main::@1
[20] phi() [19] phi()
[21] call doplasma [20] call doplasma
to:main::@6 to:main::@6
main::@6: scope:[main] from main::@2 main::@6: scope:[main] from main::@2
[22] *((const nomodify byte*) VIC_MEMORY) ← (const nomodify byte) PAGE1 [21] *((const nomodify byte*) VIC_MEMORY) ← (const nomodify byte) PAGE1
[23] call doplasma [22] call doplasma
to:main::@7 to:main::@7
main::@7: scope:[main] from main::@6 main::@7: scope:[main] from main::@6
[24] *((const nomodify byte*) VIC_MEMORY) ← (const nomodify byte) PAGE2 [23] *((const nomodify byte*) VIC_MEMORY) ← (const nomodify byte) PAGE2
[25] (word) main::count#1 ← -- (word) main::count#2 [24] (word) main::count#1 ← -- (word) main::count#2
to:main::@1 to:main::@1
(void()) doplasma((byte*) doplasma::scrn) (void()) doplasma((byte*) doplasma::scrn)
doplasma: scope:[doplasma] from main::@2 main::@6 doplasma: scope:[doplasma] from main::@2 main::@6
[26] (byte*) doplasma::scrn#13 ← phi( main::@2/(const nomodify byte*) SCREEN1 main::@6/(const nomodify byte*) SCREEN2 ) [25] (byte*) doplasma::scrn#13 ← phi( main::@2/(const nomodify byte*) SCREEN1 main::@6/(const nomodify byte*) SCREEN2 )
to:doplasma::@1 to:doplasma::@1
doplasma::@1: scope:[doplasma] from doplasma doplasma::@2 doplasma::@1: scope:[doplasma] from doplasma doplasma::@2
[27] (byte) doplasma::c1b#3 ← phi( doplasma/(byte) 0 doplasma::@2/(byte) doplasma::c1b#2 ) [26] (byte) doplasma::c1b#3 ← phi( doplasma/(byte) 0 doplasma::@2/(byte) doplasma::c1b#2 )
[27] (byte) doplasma::c1a#3 ← phi( doplasma/(byte) 0 doplasma::@2/(byte) doplasma::c1a#2 ) [26] (byte) doplasma::c1a#3 ← phi( doplasma/(byte) 0 doplasma::@2/(byte) doplasma::c1a#2 )
[27] (byte) doplasma::ii#3 ← phi( doplasma/(byte) 0 doplasma::@2/(byte) doplasma::ii#2 ) [26] (byte) doplasma::ii#3 ← phi( doplasma/(byte) 0 doplasma::@2/(byte) doplasma::ii#2 )
[28] if((byte) doplasma::ii#3<(byte) $19) goto doplasma::@2 [27] if((byte) doplasma::ii#3<(byte) $19) goto doplasma::@2
to:doplasma::@3 to:doplasma::@3
doplasma::@3: scope:[doplasma] from doplasma::@1 doplasma::@4 doplasma::@3: scope:[doplasma] from doplasma::@1 doplasma::@4
[29] (byte) doplasma::c2b#3 ← phi( doplasma::@1/(const byte) doplasma::c2B#0 doplasma::@4/(byte) doplasma::c2b#2 ) [28] (byte) doplasma::c2b#3 ← phi( doplasma::@1/(const byte) doplasma::c2B#0 doplasma::@4/(byte) doplasma::c2b#2 )
[29] (byte) doplasma::c2a#3 ← phi( doplasma::@1/(const byte) doplasma::c2A#0 doplasma::@4/(byte) doplasma::c2a#2 ) [28] (byte) doplasma::c2a#3 ← phi( doplasma::@1/(const byte) doplasma::c2A#0 doplasma::@4/(byte) doplasma::c2a#2 )
[29] (byte) doplasma::i#3 ← phi( doplasma::@1/(byte) 0 doplasma::@4/(byte) doplasma::i#2 ) [28] (byte) doplasma::i#3 ← phi( doplasma::@1/(byte) 0 doplasma::@4/(byte) doplasma::i#2 )
[30] if((byte) doplasma::i#3<(byte) $28) goto doplasma::@4 [29] if((byte) doplasma::i#3<(byte) $28) goto doplasma::@4
to:doplasma::@5 to:doplasma::@5
doplasma::@5: scope:[doplasma] from doplasma::@3 doplasma::@8 doplasma::@5: scope:[doplasma] from doplasma::@3 doplasma::@8
[31] (byte*) doplasma::scrn#6 ← phi( doplasma::@8/(byte*) doplasma::scrn#0 doplasma::@3/(byte*) doplasma::scrn#13 ) [30] (byte*) doplasma::scrn#6 ← phi( doplasma::@8/(byte*) doplasma::scrn#0 doplasma::@3/(byte*) doplasma::scrn#13 )
[31] (byte) doplasma::jj#3 ← phi( doplasma::@8/(byte) doplasma::jj#2 doplasma::@3/(byte) 0 ) [30] (byte) doplasma::jj#3 ← phi( doplasma::@8/(byte) doplasma::jj#2 doplasma::@3/(byte) 0 )
[32] if((byte) doplasma::jj#3<(byte) $19) goto doplasma::@6 [31] if((byte) doplasma::jj#3<(byte) $19) goto doplasma::@6
to:doplasma::@return to:doplasma::@return
doplasma::@return: scope:[doplasma] from doplasma::@5 doplasma::@return: scope:[doplasma] from doplasma::@5
[33] return [32] return
to:@return to:@return
doplasma::@6: scope:[doplasma] from doplasma::@5 doplasma::@7 doplasma::@6: scope:[doplasma] from doplasma::@5 doplasma::@7
[34] (byte) doplasma::j#3 ← phi( doplasma::@7/(byte) doplasma::j#2 doplasma::@5/(byte) 0 ) [33] (byte) doplasma::j#3 ← phi( doplasma::@7/(byte) doplasma::j#2 doplasma::@5/(byte) 0 )
[35] if((byte) doplasma::j#3<(byte) $28) goto doplasma::@7 [34] if((byte) doplasma::j#3<(byte) $28) goto doplasma::@7
to:doplasma::@8 to:doplasma::@8
doplasma::@8: scope:[doplasma] from doplasma::@6 doplasma::@8: scope:[doplasma] from doplasma::@6
[36] (byte*) doplasma::scrn#0 ← (byte*) doplasma::scrn#6 + (byte) $28 [35] (byte*) doplasma::scrn#0 ← (byte*) doplasma::scrn#6 + (byte) $28
[37] (byte) doplasma::jj#2 ← ++ (byte) doplasma::jj#3 [36] (byte) doplasma::jj#2 ← ++ (byte) doplasma::jj#3
to:doplasma::@5 to:doplasma::@5
doplasma::@7: scope:[doplasma] from doplasma::@6 doplasma::@7: scope:[doplasma] from doplasma::@6
[38] (byte~) doplasma::$6 ← *((const byte*) xbuf + (byte) doplasma::j#3) + *((const byte*) ybuf + (byte) doplasma::jj#3) [37] (byte~) doplasma::$6 ← *((const byte*) xbuf + (byte) doplasma::j#3) + *((const byte*) ybuf + (byte) doplasma::jj#3)
[39] *((byte*) doplasma::scrn#6 + (byte) doplasma::j#3) ← (byte~) doplasma::$6 [38] *((byte*) doplasma::scrn#6 + (byte) doplasma::j#3) ← (byte~) doplasma::$6
[40] (byte) doplasma::j#2 ← ++ (byte) doplasma::j#3 [39] (byte) doplasma::j#2 ← ++ (byte) doplasma::j#3
to:doplasma::@6 to:doplasma::@6
doplasma::@4: scope:[doplasma] from doplasma::@3 doplasma::@4: scope:[doplasma] from doplasma::@3
[41] (byte~) doplasma::$3 ← *((const to_nomodify byte*) sinustable + (byte) doplasma::c2a#3) + *((const to_nomodify byte*) sinustable + (byte) doplasma::c2b#3) [40] (byte~) doplasma::$3 ← *((const to_nomodify byte*) sinustable + (byte) doplasma::c2a#3) + *((const to_nomodify byte*) sinustable + (byte) doplasma::c2b#3)
[42] *((const byte*) xbuf + (byte) doplasma::i#3) ← (byte~) doplasma::$3 [41] *((const byte*) xbuf + (byte) doplasma::i#3) ← (byte~) doplasma::$3
[43] (byte) doplasma::c2a#2 ← (byte) doplasma::c2a#3 + (byte) 3 [42] (byte) doplasma::c2a#2 ← (byte) doplasma::c2a#3 + (byte) 3
[44] (byte) doplasma::c2b#2 ← (byte) doplasma::c2b#3 + (byte) 7 [43] (byte) doplasma::c2b#2 ← (byte) doplasma::c2b#3 + (byte) 7
[45] (byte) doplasma::i#2 ← ++ (byte) doplasma::i#3 [44] (byte) doplasma::i#2 ← ++ (byte) doplasma::i#3
to:doplasma::@3 to:doplasma::@3
doplasma::@2: scope:[doplasma] from doplasma::@1 doplasma::@2: scope:[doplasma] from doplasma::@1
[46] (byte~) doplasma::$1 ← *((const to_nomodify byte*) sinustable + (byte) doplasma::c1a#3) + *((const to_nomodify byte*) sinustable + (byte) doplasma::c1b#3) [45] (byte~) doplasma::$1 ← *((const to_nomodify byte*) sinustable + (byte) doplasma::c1a#3) + *((const to_nomodify byte*) sinustable + (byte) doplasma::c1b#3)
[47] *((const byte*) ybuf + (byte) doplasma::ii#3) ← (byte~) doplasma::$1 [46] *((const byte*) ybuf + (byte) doplasma::ii#3) ← (byte~) doplasma::$1
[48] (byte) doplasma::c1a#2 ← (byte) doplasma::c1a#3 + (byte) 4 [47] (byte) doplasma::c1a#2 ← (byte) doplasma::c1a#3 + (byte) 4
[49] (byte) doplasma::c1b#2 ← (byte) doplasma::c1b#3 + (byte) 9 [48] (byte) doplasma::c1b#2 ← (byte) doplasma::c1b#3 + (byte) 9
[50] (byte) doplasma::ii#2 ← ++ (byte) doplasma::ii#3 [49] (byte) doplasma::ii#2 ← ++ (byte) doplasma::ii#3
to:doplasma::@1 to:doplasma::@1
(void()) end() (void()) end()
end: scope:[end] from main::@3 end: scope:[end] from main::@3
[51] (word) Ticks#1 ← (volatile word) last_time [50] (word) Ticks#1 ← (volatile word) last_time
[52] call start [51] call start
to:end::@1 to:end::@1
end::@1: scope:[end] from end end::@1: scope:[end] from end
[53] (volatile word) last_time ← (volatile word) last_time - (word) Ticks#1 [52] (volatile word) last_time ← (volatile word) last_time - (word) Ticks#1
[54] (word) Ticks#12 ← (volatile word) last_time [53] (word) Ticks#12 ← (volatile word) last_time
[55] (word) print_uint::w#0 ← (word) Ticks#12 [54] (word) print_uint::w#0 ← (word) Ticks#12
[56] call print_uint [55] call print_uint
to:end::@2 to:end::@2
end::@2: scope:[end] from end::@1 end::@2: scope:[end] from end::@1
[57] phi() [56] phi()
[58] call print_ln [57] call print_ln
to:end::@return to:end::@return
end::@return: scope:[end] from end::@2 end::@return: scope:[end] from end::@2
[59] return [58] return
to:@return to:@return
(void()) print_ln() (void()) print_ln()
print_ln: scope:[print_ln] from end::@2 print_ln: scope:[print_ln] from end::@2
[60] phi() [59] phi()
to:print_ln::@1 to:print_ln::@1
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
[61] (byte*) print_line_cursor#8 ← phi( print_ln/(byte*) 1024 print_ln::@1/(byte*) print_line_cursor#1 ) [60] (byte*) print_line_cursor#8 ← phi( print_ln/(byte*) 1024 print_ln::@1/(byte*) print_line_cursor#1 )
[62] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28 [61] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28
[63] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#10) goto print_ln::@1 [62] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#10) goto print_ln::@1
to:print_ln::@return to:print_ln::@return
print_ln::@return: scope:[print_ln] from print_ln::@1 print_ln::@return: scope:[print_ln] from print_ln::@1
[64] return [63] return
to:@return to:@return
(void()) print_uint((word) print_uint::w) (void()) print_uint((word) print_uint::w)
print_uint: scope:[print_uint] from end::@1 print_uint: scope:[print_uint] from end::@1
[65] (byte) print_uchar::b#0 ← > (word) print_uint::w#0 [64] (byte) print_uchar::b#0 ← > (word) print_uint::w#0
[66] call print_uchar [65] call print_uchar
to:print_uint::@1 to:print_uint::@1
print_uint::@1: scope:[print_uint] from print_uint print_uint::@1: scope:[print_uint] from print_uint
[67] (byte) print_uchar::b#1 ← < (word) print_uint::w#0 [66] (byte) print_uchar::b#1 ← < (word) print_uint::w#0
[68] call print_uchar [67] call print_uchar
to:print_uint::@return to:print_uint::@return
print_uint::@return: scope:[print_uint] from print_uint::@1 print_uint::@return: scope:[print_uint] from print_uint::@1
[69] return [68] return
to:@return to:@return
(void()) print_uchar((byte) print_uchar::b) (void()) print_uchar((byte) print_uchar::b)
print_uchar: scope:[print_uchar] from print_uint print_uint::@1 print_uchar: scope:[print_uchar] from print_uint print_uint::@1
[70] (byte*) print_char_cursor#35 ← phi( print_uint/(byte*) 1024 print_uint::@1/(byte*) print_char_cursor#10 ) [69] (byte*) print_char_cursor#35 ← phi( print_uint/(byte*) 1024 print_uint::@1/(byte*) print_char_cursor#10 )
[70] (byte) print_uchar::b#2 ← phi( print_uint/(byte) print_uchar::b#0 print_uint::@1/(byte) print_uchar::b#1 ) [69] (byte) print_uchar::b#2 ← phi( print_uint/(byte) print_uchar::b#0 print_uint::@1/(byte) print_uchar::b#1 )
[71] (byte~) print_uchar::$0 ← (byte) print_uchar::b#2 >> (byte) 4 [70] (byte~) print_uchar::$0 ← (byte) print_uchar::b#2 >> (byte) 4
[72] (byte) print_char::ch#0 ← *((const to_nomodify byte*) print_hextab + (byte~) print_uchar::$0) [71] (byte) print_char::ch#0 ← *((const to_nomodify byte*) print_hextab + (byte~) print_uchar::$0)
[73] call print_char [72] call print_char
to:print_uchar::@1 to:print_uchar::@1
print_uchar::@1: scope:[print_uchar] from print_uchar print_uchar::@1: scope:[print_uchar] from print_uchar
[74] (byte~) print_uchar::$2 ← (byte) print_uchar::b#2 & (byte) $f [73] (byte~) print_uchar::$2 ← (byte) print_uchar::b#2 & (byte) $f
[75] (byte) print_char::ch#1 ← *((const to_nomodify byte*) print_hextab + (byte~) print_uchar::$2) [74] (byte) print_char::ch#1 ← *((const to_nomodify byte*) print_hextab + (byte~) print_uchar::$2)
[76] call print_char [75] call print_char
to:print_uchar::@return to:print_uchar::@return
print_uchar::@return: scope:[print_uchar] from print_uchar::@1 print_uchar::@return: scope:[print_uchar] from print_uchar::@1
[77] return [76] return
to:@return to:@return
(void()) print_char((byte) print_char::ch) (void()) print_char((byte) print_char::ch)
print_char: scope:[print_char] from print_uchar print_uchar::@1 print_char: scope:[print_char] from print_uchar print_uchar::@1
[78] (byte*) print_char_cursor#25 ← phi( print_uchar/(byte*) print_char_cursor#35 print_uchar::@1/(byte*) print_char_cursor#10 ) [77] (byte*) print_char_cursor#25 ← phi( print_uchar/(byte*) print_char_cursor#35 print_uchar::@1/(byte*) print_char_cursor#10 )
[78] (byte) print_char::ch#2 ← phi( print_uchar/(byte) print_char::ch#0 print_uchar::@1/(byte) print_char::ch#1 ) [77] (byte) print_char::ch#2 ← phi( print_uchar/(byte) print_char::ch#0 print_uchar::@1/(byte) print_char::ch#1 )
[79] *((byte*) print_char_cursor#25) ← (byte) print_char::ch#2 [78] *((byte*) print_char_cursor#25) ← (byte) print_char::ch#2
[80] (byte*) print_char_cursor#10 ← ++ (byte*) print_char_cursor#25 [79] (byte*) print_char_cursor#10 ← ++ (byte*) print_char_cursor#25
to:print_char::@return to:print_char::@return
print_char::@return: scope:[print_char] from print_char print_char::@return: scope:[print_char] from print_char
[81] return [80] return
to:@return to:@return
(void()) start() (void()) start()
start: scope:[start] from end main::@4 start: scope:[start] from end main::@4
asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1 } asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1 }
[83] (volatile word) rand_seed ← (word) $194a
to:start::@return to:start::@return
start::@return: scope:[start] from start start::@return: scope:[start] from start
[84] return [82] return
to:@return to:@return
(void()) makechar() (void()) makechar()
makechar: scope:[makechar] from main makechar: scope:[makechar] from main
[85] phi() [83] phi()
to:makechar::@1 to:makechar::@1
makechar::@1: scope:[makechar] from makechar makechar::@4 makechar::@1: scope:[makechar] from makechar makechar::@4
[86] (word) makechar::c#3 ← phi( makechar/(byte) 0 makechar::@4/(word) makechar::c#2 ) [84] (word) rand_state#13 ← phi( makechar/(word) 1 makechar::@4/(word) rand_state#23 )
[87] if((word) makechar::c#3<(word) $100) goto makechar::@2 [84] (word) makechar::c#3 ← phi( makechar/(byte) 0 makechar::@4/(word) makechar::c#2 )
[85] if((word) makechar::c#3<(word) $100) goto makechar::@2
to:makechar::@return to:makechar::@return
makechar::@return: scope:[makechar] from makechar::@1 makechar::@return: scope:[makechar] from makechar::@1
[88] return [86] return
to:@return to:@return
makechar::@2: scope:[makechar] from makechar::@1 makechar::@2: scope:[makechar] from makechar::@1
[89] (byte~) makechar::$9 ← (byte)(word) makechar::c#3 [87] (byte~) makechar::$9 ← (byte)(word) makechar::c#3
[90] (byte) makechar::s#1 ← *((const to_nomodify byte*) sinustable + (byte~) makechar::$9) [88] (byte) makechar::s#1 ← *((const to_nomodify byte*) sinustable + (byte~) makechar::$9)
to:makechar::@3 to:makechar::@3
makechar::@3: scope:[makechar] from makechar::@2 makechar::@7 makechar::@3: scope:[makechar] from makechar::@2 makechar::@7
[91] (byte) makechar::i#3 ← phi( makechar::@2/(byte) 0 makechar::@7/(byte) makechar::i#2 ) [89] (word) rand_state#23 ← phi( makechar::@2/(word) rand_state#13 makechar::@7/(word) rand_state#17 )
[92] if((byte) makechar::i#3<(byte) 8) goto makechar::@5 [89] (byte) makechar::i#3 ← phi( makechar::@2/(byte) 0 makechar::@7/(byte) makechar::i#2 )
[90] if((byte) makechar::i#3<(byte) 8) goto makechar::@5
to:makechar::@4 to:makechar::@4
makechar::@4: scope:[makechar] from makechar::@3 makechar::@4: scope:[makechar] from makechar::@3
[93] (word) makechar::c#2 ← ++ (word) makechar::c#3 [91] (word) makechar::c#2 ← ++ (word) makechar::c#3
to:makechar::@1 to:makechar::@1
makechar::@5: scope:[makechar] from makechar::@3 makechar::@8 makechar::@5: scope:[makechar] from makechar::@3 makechar::@8
[94] (byte) makechar::b#3 ← phi( makechar::@3/(byte) 0 makechar::@8/(byte) makechar::b#7 ) [92] (word) rand_state#17 ← phi( makechar::@3/(word) rand_state#23 makechar::@8/(word) rand_state#11 )
[94] (byte) makechar::ii#3 ← phi( makechar::@3/(byte) 0 makechar::@8/(byte) makechar::ii#2 ) [92] (byte) makechar::b#3 ← phi( makechar::@3/(byte) 0 makechar::@8/(byte) makechar::b#7 )
[95] if((byte) makechar::ii#3<(byte) 8) goto makechar::@6 [92] (byte) makechar::ii#3 ← phi( makechar::@3/(byte) 0 makechar::@8/(byte) makechar::ii#2 )
[93] if((byte) makechar::ii#3<(byte) 8) goto makechar::@6
to:makechar::@7 to:makechar::@7
makechar::@7: scope:[makechar] from makechar::@5 makechar::@7: scope:[makechar] from makechar::@5
[96] (word~) makechar::$7 ← (word) makechar::c#3 << (byte) 3 [94] (word~) makechar::$7 ← (word) makechar::c#3 << (byte) 3
[97] (word~) makechar::$8 ← (word~) makechar::$7 + (byte) makechar::i#3 [95] (word~) makechar::$8 ← (word~) makechar::$7 + (byte) makechar::i#3
[98] (byte*~) makechar::$10 ← (const nomodify byte*) CHARSET + (word~) makechar::$8 [96] (byte*~) makechar::$10 ← (const nomodify byte*) CHARSET + (word~) makechar::$8
[99] *((byte*~) makechar::$10) ← (byte) makechar::b#3 [97] *((byte*~) makechar::$10) ← (byte) makechar::b#3
[100] (byte) makechar::i#2 ← ++ (byte) makechar::i#3 [98] (byte) makechar::i#2 ← ++ (byte) makechar::i#3
to:makechar::@3 to:makechar::@3
makechar::@6: scope:[makechar] from makechar::@5 makechar::@6: scope:[makechar] from makechar::@5
[101] phi() [99] phi()
[102] call rand [100] call rand
[103] (byte) rand::return#2 ← (byte) rand::return#0 [101] (word) rand::return#2 ← (word) rand::return#0
to:makechar::@10 to:makechar::@10
makechar::@10: scope:[makechar] from makechar::@6 makechar::@10: scope:[makechar] from makechar::@6
[104] (byte~) makechar::$3 ← (byte) rand::return#2 [102] (word~) makechar::$3 ← (word) rand::return#2
[105] (byte~) makechar::$4 ← (byte~) makechar::$3 & (byte) $ff [103] (byte~) makechar::$4 ← (word~) makechar::$3 & (byte) $ff
[106] if((byte~) makechar::$4<=(byte) makechar::s#1) goto makechar::@8 [104] if((byte~) makechar::$4<=(byte) makechar::s#1) goto makechar::@8
to:makechar::@9 to:makechar::@9
makechar::@9: scope:[makechar] from makechar::@10 makechar::@9: scope:[makechar] from makechar::@10
[107] (byte) makechar::b#2 ← (byte) makechar::b#3 | *((const to_nomodify byte*) bittab + (byte) makechar::ii#3) [105] (byte) makechar::b#2 ← (byte) makechar::b#3 | *((const to_nomodify byte*) bittab + (byte) makechar::ii#3)
to:makechar::@8 to:makechar::@8
makechar::@8: scope:[makechar] from makechar::@10 makechar::@9 makechar::@8: scope:[makechar] from makechar::@10 makechar::@9
[108] (byte) makechar::b#7 ← phi( makechar::@9/(byte) makechar::b#2 makechar::@10/(byte) makechar::b#3 ) [106] (byte) makechar::b#7 ← phi( makechar::@9/(byte) makechar::b#2 makechar::@10/(byte) makechar::b#3 )
[109] (byte) makechar::ii#2 ← ++ (byte) makechar::ii#3 [107] (byte) makechar::ii#2 ← ++ (byte) makechar::ii#3
to:makechar::@5 to:makechar::@5
(byte()) rand() (word()) rand()
rand: scope:[rand] from makechar::@6 rand: scope:[rand] from makechar::@6
asm { ldx#8 ldaRAND_SEED+0 __rand_loop: asl rolRAND_SEED+1 bcc__no_eor eor#$2D __no_eor: dex bne__rand_loop staRAND_SEED+0 } [108] (word~) rand::$0 ← (word) rand_state#17 << (byte) 7
[111] (byte) rand::return#0 ← (byte)(volatile word) rand_seed [109] (word) rand_state#1 ← (word) rand_state#17 ^ (word~) rand::$0
[110] (word~) rand::$1 ← (word) rand_state#1 >> (byte) 9
[111] (word) rand_state#2 ← (word) rand_state#1 ^ (word~) rand::$1
[112] (word~) rand::$2 ← (word) rand_state#2 << (byte) 8
[113] (word) rand_state#11 ← (word) rand_state#2 ^ (word~) rand::$2
[114] (word) rand::return#0 ← (word) rand_state#11
to:rand::@return to:rand::@return
rand::@return: scope:[rand] from rand rand::@return: scope:[rand] from rand
[112] return [115] return
to:@return to:@return

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,5 @@
(label) @1 (label) @1
(label) @2 (label) @2
(label) @3
(label) @begin (label) @begin
(label) @end (label) @end
(const nomodify byte*) CHARSET = (byte*) 59392 (const nomodify byte*) CHARSET = (byte*) 59392
@ -118,27 +117,27 @@
(byte) doplasma::c1A (byte) doplasma::c1A
(byte) doplasma::c1B (byte) doplasma::c1B
(byte) doplasma::c1a (byte) doplasma::c1a
(byte) doplasma::c1a#2 c1a zp[1]:9 66667.33333333333 (byte) doplasma::c1a#2 c1a zp[1]:20 66667.33333333333
(byte) doplasma::c1a#3 c1a zp[1]:9 75000.75 (byte) doplasma::c1a#3 c1a zp[1]:20 75000.75
(byte) doplasma::c1b (byte) doplasma::c1b
(byte) doplasma::c1b#2 c1b zp[1]:20 100001.0 (byte) doplasma::c1b#2 c1b zp[1]:25 100001.0
(byte) doplasma::c1b#3 c1b zp[1]:20 60000.600000000006 (byte) doplasma::c1b#3 c1b zp[1]:25 60000.600000000006
(byte) doplasma::c2A (byte) doplasma::c2A
(const byte) doplasma::c2A#0 c2A = (byte) 0 (const byte) doplasma::c2A#0 c2A = (byte) 0
(byte) doplasma::c2B (byte) doplasma::c2B
(const byte) doplasma::c2B#0 c2B = (byte) 0 (const byte) doplasma::c2B#0 c2B = (byte) 0
(byte) doplasma::c2a (byte) doplasma::c2a
(byte) doplasma::c2a#2 c2a zp[1]:2 66667.33333333333 (byte) doplasma::c2a#2 c2a zp[1]:3 66667.33333333333
(byte) doplasma::c2a#3 c2a zp[1]:2 75000.75 (byte) doplasma::c2a#3 c2a zp[1]:3 75000.75
(byte) doplasma::c2b (byte) doplasma::c2b
(byte) doplasma::c2b#2 c2b zp[1]:3 100001.0 (byte) doplasma::c2b#2 c2b zp[1]:4 100001.0
(byte) doplasma::c2b#3 c2b zp[1]:3 60000.600000000006 (byte) doplasma::c2b#3 c2b zp[1]:4 60000.600000000006
(byte) doplasma::i (byte) doplasma::i
(byte) doplasma::i#2 i zp[1]:23 200002.0 (byte) doplasma::i#2 i zp[1]:2 200002.0
(byte) doplasma::i#3 i zp[1]:23 66667.33333333333 (byte) doplasma::i#3 i zp[1]:2 66667.33333333333
(byte) doplasma::ii (byte) doplasma::ii
(byte) doplasma::ii#2 ii zp[1]:8 200002.0 (byte) doplasma::ii#2 ii zp[1]:11 200002.0
(byte) doplasma::ii#3 ii zp[1]:8 66667.33333333333 (byte) doplasma::ii#3 ii zp[1]:11 66667.33333333333
(byte) doplasma::j (byte) doplasma::j
(byte) doplasma::j#2 reg byte y 2000002.0 (byte) doplasma::j#2 reg byte y 2000002.0
(byte) doplasma::j#3 reg byte y 1250001.25 (byte) doplasma::j#3 reg byte y 1250001.25
@ -146,14 +145,14 @@
(byte) doplasma::jj#2 reg byte x 200002.0 (byte) doplasma::jj#2 reg byte x 200002.0
(byte) doplasma::jj#3 reg byte x 162500.5 (byte) doplasma::jj#3 reg byte x 162500.5
(byte*) doplasma::scrn (byte*) doplasma::scrn
(byte*) doplasma::scrn#0 scrn zp[2]:6 100001.0 (byte*) doplasma::scrn#0 scrn zp[2]:7 100001.0
(byte*) doplasma::scrn#13 scrn zp[2]:6 6666.733333333334 (byte*) doplasma::scrn#13 scrn zp[2]:7 6666.733333333334
(byte*) doplasma::scrn#6 scrn zp[2]:6 185714.85714285713 (byte*) doplasma::scrn#6 scrn zp[2]:7 185714.85714285713
(void()) end() (void()) end()
(label) end::@1 (label) end::@1
(label) end::@2 (label) end::@2
(label) end::@return (label) end::@return
(volatile word) last_time loadstore zp[2]:10 16.916666666666664 (volatile word) last_time loadstore zp[2]:12 17.652173913043477
(signed word()) main() (signed word()) main()
(label) main::@1 (label) main::@1
(label) main::@2 (label) main::@2
@ -166,8 +165,8 @@
(byte) main::block (byte) main::block
(byte) main::block#1 block zp[1]:14 2.5384615384615383 (byte) main::block#1 block zp[1]:14 2.5384615384615383
(word) main::count (word) main::count
(word) main::count#1 count zp[2]:4 202.0 (word) main::count#1 count zp[2]:5 202.0
(word) main::count#2 count zp[2]:4 43.285714285714285 (word) main::count#2 count zp[2]:5 43.285714285714285
(signed word) main::return (signed word) main::return
(byte) main::tmp (byte) main::tmp
(byte) main::tmp#1 reg byte a 22.0 (byte) main::tmp#1 reg byte a 22.0
@ -175,8 +174,8 @@
(byte) main::v#1 v zp[1]:15 2.4444444444444446 (byte) main::v#1 v zp[1]:15 2.4444444444444446
(void()) makechar() (void()) makechar()
(byte*~) makechar::$10 zp[2]:21 20002.0 (byte*~) makechar::$10 zp[2]:21 20002.0
(byte~) makechar::$3 reg byte a 200002.0 (word~) makechar::$3 zp[2]:23 200002.0
(byte~) makechar::$4 zp[1]:23 200002.0 (byte~) makechar::$4 zp[1]:25 200002.0
(word~) makechar::$7 zp[2]:21 20002.0 (word~) makechar::$7 zp[2]:21 20002.0
(word~) makechar::$8 zp[2]:21 20002.0 (word~) makechar::$8 zp[2]:21 20002.0
(byte~) makechar::$9 reg byte a 2002.0 (byte~) makechar::$9 reg byte a 2002.0
@ -192,18 +191,18 @@
(label) makechar::@9 (label) makechar::@9
(label) makechar::@return (label) makechar::@return
(byte) makechar::b (byte) makechar::b
(byte) makechar::b#2 b zp[1]:9 200002.0 (byte) makechar::b#2 reg byte y 200002.0
(byte) makechar::b#3 b zp[1]:9 28182.181818181816 (byte) makechar::b#3 reg byte y 28182.181818181816
(byte) makechar::b#7 b zp[1]:9 150001.5 (byte) makechar::b#7 reg byte y 150001.5
(word) makechar::c (word) makechar::c
(word) makechar::c#2 c zp[2]:16 2002.0 (word) makechar::c#2 c zp[2]:16 2002.0
(word) makechar::c#3 c zp[2]:16 591.090909090909 (word) makechar::c#3 c zp[2]:16 591.090909090909
(byte) makechar::i (byte) makechar::i
(byte) makechar::i#2 i zp[1]:8 20002.0 (byte) makechar::i#2 i zp[1]:11 20002.0
(byte) makechar::i#3 i zp[1]:8 2353.176470588235 (byte) makechar::i#3 i zp[1]:11 2353.176470588235
(byte) makechar::ii (byte) makechar::ii
(byte) makechar::ii#2 reg byte y 200002.0 (byte) makechar::ii#2 reg byte x 200002.0
(byte) makechar::ii#3 reg byte y 40000.4 (byte) makechar::ii#3 reg byte x 40000.4
(byte) makechar::s (byte) makechar::s
(byte) makechar::s#1 s zp[1]:20 5315.894736842105 (byte) makechar::s#1 s zp[1]:20 5315.894736842105
(void()) print_char((byte) print_char::ch) (void()) print_char((byte) print_char::ch)
@ -213,13 +212,13 @@
(byte) print_char::ch#1 reg byte a 20002.0 (byte) print_char::ch#1 reg byte a 20002.0
(byte) print_char::ch#2 reg byte a 120003.0 (byte) print_char::ch#2 reg byte a 120003.0
(byte*) print_char_cursor (byte*) print_char_cursor
(byte*) print_char_cursor#10 print_char_cursor zp[2]:6 7117.882352941177 (byte*) print_char_cursor#10 print_char_cursor zp[2]:7 7117.882352941177
(byte*) print_char_cursor#25 print_char_cursor zp[2]:6 110002.0 (byte*) print_char_cursor#25 print_char_cursor zp[2]:7 110002.0
(byte*) print_char_cursor#35 print_char_cursor zp[2]:6 3667.333333333333 (byte*) print_char_cursor#35 print_char_cursor zp[2]:7 3667.333333333333
(const to_nomodify byte*) print_hextab[] = (byte*) "0123456789abcdef"z (const to_nomodify byte*) print_hextab[] = (byte*) "0123456789abcdef"z
(byte*) print_line_cursor (byte*) print_line_cursor
(byte*) print_line_cursor#1 print_line_cursor zp[2]:4 15001.5 (byte*) print_line_cursor#1 print_line_cursor zp[2]:5 15001.5
(byte*) print_line_cursor#8 print_line_cursor zp[2]:4 20002.0 (byte*) print_line_cursor#8 print_line_cursor zp[2]:5 20002.0
(void()) print_ln() (void()) print_ln()
(label) print_ln::@1 (label) print_ln::@1
(label) print_ln::@return (label) print_ln::@return
@ -238,13 +237,21 @@
(label) print_uint::@return (label) print_uint::@return
(word) print_uint::w (word) print_uint::w
(word) print_uint::w#0 w zp[2]:18 701.0 (word) print_uint::w#0 w zp[2]:18 701.0
(byte()) rand() (word()) rand()
(word~) rand::$0 zp[2]:26 2000002.0
(word~) rand::$1 zp[2]:28 2000002.0
(word~) rand::$2 zp[2]:30 2000002.0
(label) rand::@return (label) rand::@return
(const nomodify word*) rand::RAND_SEED = &(volatile word) rand_seed (word) rand::return
(byte) rand::return (word) rand::return#0 return zp[2]:23 366667.3333333334
(byte) rand::return#0 reg byte a 366667.3333333334 (word) rand::return#2 return zp[2]:23 200002.0
(byte) rand::return#2 reg byte a 200002.0 (word) rand_state
(volatile word) rand_seed loadstore zp[2]:12 36.214285714285715 (word) rand_state#1 rand_state zp[2]:9 1500001.5
(word) rand_state#11 rand_state zp[2]:9 190909.36363636365
(word) rand_state#13 rand_state zp[2]:9 500.5
(word) rand_state#17 rand_state zp[2]:9 235556.11111111112
(word) rand_state#2 rand_state zp[2]:9 1500001.5
(word) rand_state#23 rand_state zp[2]:9 7334.666666666666
(const to_nomodify byte*) sinustable[(number) $100] = { (byte) $80, (byte) $7d, (byte) $7a, (byte) $77, (byte) $74, (byte) $70, (byte) $6d, (byte) $6a, (byte) $67, (byte) $64, (byte) $61, (byte) $5e, (byte) $5b, (byte) $58, (byte) $55, (byte) $52, (byte) $4f, (byte) $4d, (byte) $4a, (byte) $47, (byte) $44, (byte) $41, (byte) $3f, (byte) $3c, (byte) $39, (byte) $37, (byte) $34, (byte) $32, (byte) $2f, (byte) $2d, (byte) $2b, (byte) $28, (byte) $26, (byte) $24, (byte) $22, (byte) $20, (byte) $1e, (byte) $1c, (byte) $1a, (byte) $18, (byte) $16, (byte) $15, (byte) $13, (byte) $11, (byte) $10, (byte) $f, (byte) $d, (byte) $c, (byte) $b, (byte) $a, (byte) 8, (byte) 7, (byte) 6, (byte) 6, (byte) 5, (byte) 4, (byte) 3, (byte) 3, (byte) 2, (byte) 2, (byte) 2, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 2, (byte) 2, (byte) 2, (byte) 3, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 6, (byte) 7, (byte) 8, (byte) $a, (byte) $b, (byte) $c, (byte) $d, (byte) $f, (byte) $10, (byte) $11, (byte) $13, (byte) $15, (byte) $16, (byte) $18, (byte) $1a, (byte) $1c, (byte) $1e, (byte) $20, (byte) $22, (byte) $24, (byte) $26, (byte) $28, (byte) $2b, (byte) $2d, (byte) $2f, (byte) $32, (byte) $34, (byte) $37, (byte) $39, (byte) $3c, (byte) $3f, (byte) $41, (byte) $44, (byte) $47, (byte) $4a, (byte) $4d, (byte) $4f, (byte) $52, (byte) $55, (byte) $58, (byte) $5b, (byte) $5e, (byte) $61, (byte) $64, (byte) $67, (byte) $6a, (byte) $6d, (byte) $70, (byte) $74, (byte) $77, (byte) $7a, (byte) $7d, (byte) $80, (byte) $83, (byte) $86, (byte) $89, (byte) $8c, (byte) $90, (byte) $93, (byte) $96, (byte) $99, (byte) $9c, (byte) $9f, (byte) $a2, (byte) $a5, (byte) $a8, (byte) $ab, (byte) $ae, (byte) $b1, (byte) $b3, (byte) $b6, (byte) $b9, (byte) $bc, (byte) $bf, (byte) $c1, (byte) $c4, (byte) $c7, (byte) $c9, (byte) $cc, (byte) $ce, (byte) $d1, (byte) $d3, (byte) $d5, (byte) $d8, (byte) $da, (byte) $dc, (byte) $de, (byte) $e0, (byte) $e2, (byte) $e4, (byte) $e6, (byte) $e8, (byte) $ea, (byte) $eb, (byte) $ed, (byte) $ef, (byte) $f0, (byte) $f1, (byte) $f3, (byte) $f4, (byte) $f5, (byte) $f6, (byte) $f8, (byte) $f9, (byte) $fa, (byte) $fa, (byte) $fb, (byte) $fc, (byte) $fd, (byte) $fd, (byte) $fe, (byte) $fe, (byte) $fe, (byte) $ff, (byte) $ff, (byte) $ff, (byte) $ff, (byte) $ff, (byte) $ff, (byte) $ff, (byte) $fe, (byte) $fe, (byte) $fe, (byte) $fd, (byte) $fd, (byte) $fc, (byte) $fb, (byte) $fa, (byte) $fa, (byte) $f9, (byte) $f8, (byte) $f6, (byte) $f5, (byte) $f4, (byte) $f3, (byte) $f1, (byte) $f0, (byte) $ef, (byte) $ed, (byte) $eb, (byte) $ea, (byte) $e8, (byte) $e6, (byte) $e4, (byte) $e2, (byte) $e0, (byte) $de, (byte) $dc, (byte) $da, (byte) $d8, (byte) $d5, (byte) $d3, (byte) $d1, (byte) $ce, (byte) $cc, (byte) $c9, (byte) $c7, (byte) $c4, (byte) $c1, (byte) $bf, (byte) $bc, (byte) $b9, (byte) $b6, (byte) $b3, (byte) $b1, (byte) $ae, (byte) $ab, (byte) $a8, (byte) $a5, (byte) $a2, (byte) $9f, (byte) $9c, (byte) $99, (byte) $96, (byte) $93, (byte) $90, (byte) $8c, (byte) $89, (byte) $86, (byte) $83 } (const to_nomodify byte*) sinustable[(number) $100] = { (byte) $80, (byte) $7d, (byte) $7a, (byte) $77, (byte) $74, (byte) $70, (byte) $6d, (byte) $6a, (byte) $67, (byte) $64, (byte) $61, (byte) $5e, (byte) $5b, (byte) $58, (byte) $55, (byte) $52, (byte) $4f, (byte) $4d, (byte) $4a, (byte) $47, (byte) $44, (byte) $41, (byte) $3f, (byte) $3c, (byte) $39, (byte) $37, (byte) $34, (byte) $32, (byte) $2f, (byte) $2d, (byte) $2b, (byte) $28, (byte) $26, (byte) $24, (byte) $22, (byte) $20, (byte) $1e, (byte) $1c, (byte) $1a, (byte) $18, (byte) $16, (byte) $15, (byte) $13, (byte) $11, (byte) $10, (byte) $f, (byte) $d, (byte) $c, (byte) $b, (byte) $a, (byte) 8, (byte) 7, (byte) 6, (byte) 6, (byte) 5, (byte) 4, (byte) 3, (byte) 3, (byte) 2, (byte) 2, (byte) 2, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 2, (byte) 2, (byte) 2, (byte) 3, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 6, (byte) 7, (byte) 8, (byte) $a, (byte) $b, (byte) $c, (byte) $d, (byte) $f, (byte) $10, (byte) $11, (byte) $13, (byte) $15, (byte) $16, (byte) $18, (byte) $1a, (byte) $1c, (byte) $1e, (byte) $20, (byte) $22, (byte) $24, (byte) $26, (byte) $28, (byte) $2b, (byte) $2d, (byte) $2f, (byte) $32, (byte) $34, (byte) $37, (byte) $39, (byte) $3c, (byte) $3f, (byte) $41, (byte) $44, (byte) $47, (byte) $4a, (byte) $4d, (byte) $4f, (byte) $52, (byte) $55, (byte) $58, (byte) $5b, (byte) $5e, (byte) $61, (byte) $64, (byte) $67, (byte) $6a, (byte) $6d, (byte) $70, (byte) $74, (byte) $77, (byte) $7a, (byte) $7d, (byte) $80, (byte) $83, (byte) $86, (byte) $89, (byte) $8c, (byte) $90, (byte) $93, (byte) $96, (byte) $99, (byte) $9c, (byte) $9f, (byte) $a2, (byte) $a5, (byte) $a8, (byte) $ab, (byte) $ae, (byte) $b1, (byte) $b3, (byte) $b6, (byte) $b9, (byte) $bc, (byte) $bf, (byte) $c1, (byte) $c4, (byte) $c7, (byte) $c9, (byte) $cc, (byte) $ce, (byte) $d1, (byte) $d3, (byte) $d5, (byte) $d8, (byte) $da, (byte) $dc, (byte) $de, (byte) $e0, (byte) $e2, (byte) $e4, (byte) $e6, (byte) $e8, (byte) $ea, (byte) $eb, (byte) $ed, (byte) $ef, (byte) $f0, (byte) $f1, (byte) $f3, (byte) $f4, (byte) $f5, (byte) $f6, (byte) $f8, (byte) $f9, (byte) $fa, (byte) $fa, (byte) $fb, (byte) $fc, (byte) $fd, (byte) $fd, (byte) $fe, (byte) $fe, (byte) $fe, (byte) $ff, (byte) $ff, (byte) $ff, (byte) $ff, (byte) $ff, (byte) $ff, (byte) $ff, (byte) $fe, (byte) $fe, (byte) $fe, (byte) $fd, (byte) $fd, (byte) $fc, (byte) $fb, (byte) $fa, (byte) $fa, (byte) $f9, (byte) $f8, (byte) $f6, (byte) $f5, (byte) $f4, (byte) $f3, (byte) $f1, (byte) $f0, (byte) $ef, (byte) $ed, (byte) $eb, (byte) $ea, (byte) $e8, (byte) $e6, (byte) $e4, (byte) $e2, (byte) $e0, (byte) $de, (byte) $dc, (byte) $da, (byte) $d8, (byte) $d5, (byte) $d3, (byte) $d1, (byte) $ce, (byte) $cc, (byte) $c9, (byte) $c7, (byte) $c4, (byte) $c1, (byte) $bf, (byte) $bc, (byte) $b9, (byte) $b6, (byte) $b3, (byte) $b1, (byte) $ae, (byte) $ab, (byte) $a8, (byte) $a5, (byte) $a2, (byte) $9f, (byte) $9c, (byte) $99, (byte) $96, (byte) $93, (byte) $90, (byte) $8c, (byte) $89, (byte) $86, (byte) $83 }
(void()) start() (void()) start()
(label) start::@return (label) start::@return
@ -252,19 +259,20 @@
(const byte*) xbuf[(number) $28] = { fill( $28, 0) } (const byte*) xbuf[(number) $28] = { fill( $28, 0) }
(const byte*) ybuf[(number) $19] = { fill( $19, 0) } (const byte*) ybuf[(number) $19] = { fill( $19, 0) }
zp[1]:2 [ doplasma::c2a#3 doplasma::c2a#2 ] zp[1]:2 [ doplasma::i#3 doplasma::i#2 ]
zp[1]:3 [ doplasma::c2b#3 doplasma::c2b#2 ] zp[1]:3 [ doplasma::c2a#3 doplasma::c2a#2 ]
zp[1]:4 [ doplasma::c2b#3 doplasma::c2b#2 ]
reg byte x [ doplasma::jj#3 doplasma::jj#2 ] reg byte x [ doplasma::jj#3 doplasma::jj#2 ]
reg byte y [ doplasma::j#3 doplasma::j#2 ] reg byte y [ doplasma::j#3 doplasma::j#2 ]
zp[2]:4 [ print_line_cursor#8 print_line_cursor#1 main::count#2 main::count#1 ] zp[2]:5 [ print_line_cursor#8 print_line_cursor#1 main::count#2 main::count#1 ]
reg byte x [ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ] reg byte x [ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ]
reg byte a [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ] reg byte a [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
zp[2]:6 [ print_char_cursor#25 print_char_cursor#35 print_char_cursor#10 doplasma::scrn#6 doplasma::scrn#0 doplasma::scrn#13 ] zp[2]:7 [ print_char_cursor#25 print_char_cursor#35 print_char_cursor#10 doplasma::scrn#6 doplasma::scrn#0 doplasma::scrn#13 ]
zp[1]:8 [ makechar::i#3 makechar::i#2 doplasma::ii#3 doplasma::ii#2 ] zp[2]:9 [ rand_state#13 rand_state#23 rand_state#17 rand_state#11 rand_state#1 rand_state#2 ]
reg byte y [ makechar::ii#3 makechar::ii#2 ] zp[1]:11 [ makechar::i#3 makechar::i#2 doplasma::ii#3 doplasma::ii#2 ]
zp[1]:9 [ makechar::b#3 makechar::b#7 makechar::b#2 doplasma::c1a#3 doplasma::c1a#2 ] reg byte x [ makechar::ii#3 makechar::ii#2 ]
zp[2]:10 [ last_time ] reg byte y [ makechar::b#3 makechar::b#7 makechar::b#2 ]
zp[2]:12 [ rand_seed ] zp[2]:12 [ last_time ]
zp[1]:14 [ main::block#1 ] zp[1]:14 [ main::block#1 ]
reg byte a [ main::tmp#1 ] reg byte a [ main::tmp#1 ]
zp[1]:15 [ main::v#1 ] zp[1]:15 [ main::v#1 ]
@ -276,9 +284,10 @@ zp[2]:18 [ Ticks#12 print_uint::w#0 ]
reg byte a [ print_uchar::$0 ] reg byte a [ print_uchar::$0 ]
reg byte x [ print_uchar::$2 ] reg byte x [ print_uchar::$2 ]
reg byte a [ makechar::$9 ] reg byte a [ makechar::$9 ]
zp[1]:20 [ makechar::s#1 doplasma::c1b#3 doplasma::c1b#2 ] zp[1]:20 [ makechar::s#1 doplasma::c1a#3 doplasma::c1a#2 ]
zp[2]:21 [ makechar::$7 makechar::$8 makechar::$10 ] zp[2]:21 [ makechar::$7 makechar::$8 makechar::$10 ]
reg byte a [ rand::return#2 ] zp[2]:23 [ rand::return#2 makechar::$3 rand::return#0 ]
reg byte a [ makechar::$3 ] zp[1]:25 [ makechar::$4 doplasma::c1b#3 doplasma::c1b#2 ]
zp[1]:23 [ makechar::$4 doplasma::i#3 doplasma::i#2 ] zp[2]:26 [ rand::$0 ]
reg byte a [ rand::return#0 ] zp[2]:28 [ rand::$1 ]
zp[2]:30 [ rand::$2 ]

View File

@ -1,6 +1,4 @@
Resolved forward reference rand_seed to (word) rand_seed
Setting inferred volatile on symbol affected by address-of (word) last_time Setting inferred volatile on symbol affected by address-of (word) last_time
Setting inferred volatile on symbol affected by address-of (word) rand_seed
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA CONTROL FLOW GRAPH SSA

View File

@ -1,6 +1,4 @@
Resolved forward reference rand_seed to (word) rand_seed
Setting inferred volatile on symbol affected by address-of (word) last_time Setting inferred volatile on symbol affected by address-of (word) last_time
Setting inferred volatile on symbol affected by address-of (word) rand_seed
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA CONTROL FLOW GRAPH SSA

View File

@ -24,7 +24,7 @@
.label conio_textcolor = $1c .label conio_textcolor = $1c
// The maximal random value // The maximal random value
// The random state variable // The random state variable
.label rand_state = $11 .label _rand_state = $11
__bbegin: __bbegin:
// conio_cursor_x = 0 // conio_cursor_x = 0
// The current cursor x-position // The current cursor x-position
@ -68,17 +68,17 @@ main: {
lda #>s lda #>s
sta.z cputs.s+1 sta.z cputs.s+1
jsr cputs jsr cputs
// rand() // _rand()
lda #<1 lda #<1
sta.z rand_state sta.z _rand_state
lda #>1 lda #>1
sta.z rand_state+1 sta.z _rand_state+1
jsr rand jsr _rand
// rand() // _rand()
lda.z rand.return_1 lda.z _rand.return_1
sta.z rand.return sta.z _rand.return
lda.z rand.return_1+1 lda.z _rand.return_1+1
sta.z rand.return+1 sta.z _rand.return+1
// textcolor(LIGHT_BLUE) // textcolor(LIGHT_BLUE)
lda #LIGHT_BLUE lda #LIGHT_BLUE
jsr textcolor jsr textcolor
@ -140,10 +140,10 @@ main: {
lda #1 lda #1
sta.z row sta.z row
__b2: __b2:
// rand() // _rand()
jsr rand jsr _rand
// rand() // _rand()
// rnd = rand() // rnd = _rand()
// while(rnd!=first) // while(rnd!=first)
lda.z rnd+1 lda.z rnd+1
cmp.z first+1 cmp.z first+1
@ -909,56 +909,56 @@ gotoxy: {
rts rts
} }
// Returns a pseudo-random number in the range of 0 to RAND_MAX (65535) // Returns a pseudo-random number in the range of 0 to RAND_MAX (65535)
rand: { _rand: {
.label __0 = $23 .label __0 = $23
.label __1 = $27 .label __1 = $27
.label __2 = $25 .label __2 = $25
.label return = $1d .label return = $1d
.label return_1 = 8 .label return_1 = 8
// rand_state << 7 // _rand_state << 7
lda.z rand_state+1 lda.z _rand_state+1
lsr lsr
lda.z rand_state lda.z _rand_state
ror ror
sta.z __0+1 sta.z __0+1
lda #0 lda #0
ror ror
sta.z __0 sta.z __0
// rand_state ^= rand_state << 7 // _rand_state ^= _rand_state << 7
lda.z rand_state lda.z _rand_state
eor.z __0 eor.z __0
sta.z rand_state sta.z _rand_state
lda.z rand_state+1 lda.z _rand_state+1
eor.z __0+1 eor.z __0+1
sta.z rand_state+1 sta.z _rand_state+1
// rand_state >> 9 // _rand_state >> 9
lsr lsr
sta.z __1 sta.z __1
lda #0 lda #0
sta.z __1+1 sta.z __1+1
// rand_state ^= rand_state >> 9 // _rand_state ^= _rand_state >> 9
lda.z rand_state lda.z _rand_state
eor.z __1 eor.z __1
sta.z rand_state sta.z _rand_state
lda.z rand_state+1 lda.z _rand_state+1
eor.z __1+1 eor.z __1+1
sta.z rand_state+1 sta.z _rand_state+1
// rand_state << 8 // _rand_state << 8
lda.z rand_state lda.z _rand_state
sta.z __2+1 sta.z __2+1
lda #0 lda #0
sta.z __2 sta.z __2
// rand_state ^= rand_state << 8 // _rand_state ^= _rand_state << 8
lda.z rand_state lda.z _rand_state
eor.z __2 eor.z __2
sta.z rand_state sta.z _rand_state
lda.z rand_state+1 lda.z _rand_state+1
eor.z __2+1 eor.z __2+1
sta.z rand_state+1 sta.z _rand_state+1
// return rand_state; // return _rand_state;
lda.z rand_state lda.z _rand_state
sta.z return_1 sta.z return_1
lda.z rand_state+1 lda.z _rand_state+1
sta.z return_1+1 sta.z return_1+1
// } // }
rts rts

View File

@ -30,11 +30,11 @@ main::@7: scope:[main] from main::@6
to:main::@8 to:main::@8
main::@8: scope:[main] from main::@7 main::@8: scope:[main] from main::@7
[15] phi() [15] phi()
[16] call rand [16] call _rand
[17] (word) rand::return#0 ← (word) rand::return#2 [17] (word) _rand::return#0 ← (word) _rand::return#2
to:main::@9 to:main::@9
main::@9: scope:[main] from main::@8 main::@9: scope:[main] from main::@8
[18] (word) main::first#0 ← (word) rand::return#0 [18] (word) main::first#0 ← (word) _rand::return#0
[19] call textcolor [19] call textcolor
to:main::@10 to:main::@10
main::@10: scope:[main] from main::@9 main::@10: scope:[main] from main::@9
@ -72,11 +72,11 @@ main::@16: scope:[main] from main::@4
main::@2: scope:[main] from main::@1 main::@13 main::@16 main::@4 main::@2: scope:[main] from main::@1 main::@13 main::@16 main::@4
[35] (byte) main::row#7 ← phi( main::@1/(byte) main::row#3 main::@13/(byte) main::row#1 main::@16/(byte) 1 main::@4/(byte) 1 ) [35] (byte) main::row#7 ← phi( main::@1/(byte) main::row#3 main::@13/(byte) main::row#1 main::@16/(byte) 1 main::@4/(byte) 1 )
[35] (byte) main::col#7 ← phi( main::@1/(byte) main::col#3 main::@13/(byte) main::col#3 main::@16/(byte) main::col#1 main::@4/(byte) 3 ) [35] (byte) main::col#7 ← phi( main::@1/(byte) main::col#3 main::@13/(byte) main::col#3 main::@16/(byte) main::col#1 main::@4/(byte) 3 )
[36] call rand [36] call _rand
[37] (word) rand::return#1 ← (word) rand::return#2 [37] (word) _rand::return#1 ← (word) _rand::return#2
to:main::@11 to:main::@11
main::@11: scope:[main] from main::@2 main::@11: scope:[main] from main::@2
[38] (word) main::rnd#1 ← (word) rand::return#1 [38] (word) main::rnd#1 ← (word) _rand::return#1
[39] if((word) main::rnd#1!=(word) main::first#0) goto main::@1 [39] if((word) main::rnd#1!=(word) main::first#0) goto main::@1
to:main::@5 to:main::@5
main::@5: scope:[main] from main::@11 main::@5: scope:[main] from main::@11
@ -510,18 +510,18 @@ gotoxy::@return: scope:[gotoxy] from gotoxy::@2
[230] return [230] return
to:@return to:@return
(word()) rand() (word()) _rand()
rand: scope:[rand] from main::@2 main::@8 _rand: scope:[_rand] from main::@2 main::@8
[231] (word) rand_state#12 ← phi( main::@2/(word) rand_state#13 main::@8/(word) 1 ) [231] (word) _rand_state#12 ← phi( main::@2/(word) _rand_state#13 main::@8/(word) 1 )
[232] (word~) rand::$0 ← (word) rand_state#12 << (byte) 7 [232] (word~) _rand::$0 ← (word) _rand_state#12 << (byte) 7
[233] (word) rand_state#4 ← (word) rand_state#12 ^ (word~) rand::$0 [233] (word) _rand_state#4 ← (word) _rand_state#12 ^ (word~) _rand::$0
[234] (word~) rand::$1 ← (word) rand_state#4 >> (byte) 9 [234] (word~) _rand::$1 ← (word) _rand_state#4 >> (byte) 9
[235] (word) rand_state#5 ← (word) rand_state#4 ^ (word~) rand::$1 [235] (word) _rand_state#5 ← (word) _rand_state#4 ^ (word~) _rand::$1
[236] (word~) rand::$2 ← (word) rand_state#5 << (byte) 8 [236] (word~) _rand::$2 ← (word) _rand_state#5 << (byte) 8
[237] (word) rand_state#13 ← (word) rand_state#5 ^ (word~) rand::$2 [237] (word) _rand_state#13 ← (word) _rand_state#5 ^ (word~) _rand::$2
[238] (word) rand::return#2 ← (word) rand_state#13 [238] (word) _rand::return#2 ← (word) _rand_state#13
to:rand::@return to:_rand::@return
rand::@return: scope:[rand] from rand _rand::@return: scope:[_rand] from _rand
[239] return [239] return
to:@return to:@return

File diff suppressed because one or more lines are too long

View File

@ -100,6 +100,20 @@
(const dword*) RADIX_DECIMAL_VALUES_LONG[] = { (dword) $3b9aca00, (dword) $5f5e100, (dword) $989680, (dword) $f4240, (dword) $186a0, (dword) $2710, (dword) $3e8, (dword) $64, (dword) $a } (const dword*) RADIX_DECIMAL_VALUES_LONG[] = { (dword) $3b9aca00, (dword) $5f5e100, (dword) $989680, (dword) $f4240, (dword) $186a0, (dword) $2710, (dword) $3e8, (dword) $64, (dword) $a }
(const byte) SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER = (byte) $c (const byte) SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER = (byte) $c
(const nomodify byte) WHITE = (byte) 1 (const nomodify byte) WHITE = (byte) 1
(word()) _rand()
(word~) _rand::$0 zp[2]:35 2002.0
(word~) _rand::$1 zp[2]:39 2002.0
(word~) _rand::$2 zp[2]:37 2002.0
(label) _rand::@return
(word) _rand::return
(word) _rand::return#0 return zp[2]:29 22.0
(word) _rand::return#1 return_1 zp[2]:8 202.0
(word) _rand::return#2 return_1 zp[2]:8 278.25
(word) _rand_state
(word) _rand_state#12 _rand_state zp[2]:17 1051.5
(word) _rand_state#13 _rand_state zp[2]:17 77.88888888888889
(word) _rand_state#4 _rand_state zp[2]:17 1501.5
(word) _rand_state#5 _rand_state zp[2]:17 1501.5
(void()) clrscr() (void()) clrscr()
(label) clrscr::@1 (label) clrscr::@1
(label) clrscr::@2 (label) clrscr::@2
@ -365,20 +379,6 @@
(const byte) printf_ulong::format_zero_padding#0 format_zero_padding = (byte) 0 (const byte) printf_ulong::format_zero_padding#0 format_zero_padding = (byte) 0
(dword) printf_ulong::uvalue (dword) printf_ulong::uvalue
(dword) printf_ulong::uvalue#0 uvalue zp[4]:2 37.33333333333333 (dword) printf_ulong::uvalue#0 uvalue zp[4]:2 37.33333333333333
(word()) rand()
(word~) rand::$0 zp[2]:35 2002.0
(word~) rand::$1 zp[2]:39 2002.0
(word~) rand::$2 zp[2]:37 2002.0
(label) rand::@return
(word) rand::return
(word) rand::return#0 return zp[2]:29 22.0
(word) rand::return#1 return_1 zp[2]:8 202.0
(word) rand::return#2 return_1 zp[2]:8 278.25
(word) rand_state
(word) rand_state#12 rand_state zp[2]:17 1051.5
(word) rand_state#13 rand_state zp[2]:17 77.88888888888889
(word) rand_state#4 rand_state zp[2]:17 1501.5
(word) rand_state#5 rand_state zp[2]:17 1501.5
(word()) strlen((byte*) strlen::str) (word()) strlen((byte*) strlen::str)
(label) strlen::@1 (label) strlen::@1
(label) strlen::@2 (label) strlen::@2
@ -525,7 +525,7 @@
zp[4]:2 [ main::cnt#2 main::cnt#1 printf_ulong::uvalue#0 ultoa::value#2 ultoa::value#6 ultoa::value#1 ultoa::value#0 ultoa_append::value#2 ultoa_append::value#0 ultoa_append::value#1 ultoa_append::return#0 ] zp[4]:2 [ main::cnt#2 main::cnt#1 printf_ulong::uvalue#0 ultoa::value#2 ultoa::value#6 ultoa::value#1 ultoa::value#0 ultoa_append::value#2 ultoa_append::value#0 ultoa_append::value#1 ultoa_append::return#0 ]
zp[1]:6 [ main::col#3 main::col#7 main::col#1 ] zp[1]:6 [ main::col#3 main::col#7 main::col#1 ]
zp[1]:7 [ main::row#3 main::row#7 main::row#1 ] zp[1]:7 [ main::row#3 main::row#7 main::row#1 ]
zp[2]:8 [ main::rnd#2 main::rnd#5 main::rnd#1 printf_uint::uvalue#0 rand::return#1 utoa::value#2 utoa::value#6 utoa::value#1 utoa::value#0 utoa_append::value#2 utoa_append::value#0 utoa_append::value#1 utoa_append::return#0 rand::return#2 ] zp[2]:8 [ main::rnd#2 main::rnd#5 main::rnd#1 printf_uint::uvalue#0 _rand::return#1 utoa::value#2 utoa::value#6 utoa::value#1 utoa::value#0 utoa_append::value#2 utoa_append::value#0 utoa_append::value#1 utoa_append::return#0 _rand::return#2 ]
reg byte x [ printf_number_buffer::format_min_length#2 ] reg byte x [ printf_number_buffer::format_min_length#2 ]
zp[1]:10 [ printf_number_buffer::buffer_sign#10 printf_number_buffer::buffer_sign#1 printf_number_buffer::buffer_sign#0 ] zp[1]:10 [ printf_number_buffer::buffer_sign#10 printf_number_buffer::buffer_sign#1 printf_number_buffer::buffer_sign#0 ]
zp[1]:11 [ printf_number_buffer::format_upper_case#10 ] zp[1]:11 [ printf_number_buffer::format_upper_case#10 ]
@ -542,7 +542,7 @@ reg byte x [ ultoa::started#2 ultoa::started#4 ]
reg byte x [ ultoa_append::digit#2 ultoa_append::digit#1 ] reg byte x [ ultoa_append::digit#2 ultoa_append::digit#1 ]
reg byte a [ gotoxy::y#5 gotoxy::y#4 gotoxy::y#2 ] reg byte a [ gotoxy::y#5 gotoxy::y#4 gotoxy::y#2 ]
reg byte x [ gotoxy::x#5 gotoxy::x#4 gotoxy::x#2 ] reg byte x [ gotoxy::x#5 gotoxy::x#4 gotoxy::x#2 ]
zp[2]:17 [ rand_state#12 rand_state#13 rand_state#4 rand_state#5 ] zp[2]:17 [ _rand_state#12 _rand_state#13 _rand_state#4 _rand_state#5 ]
zp[1]:19 [ utoa::digit#2 utoa::digit#1 printf_number_buffer::format_zero_padding#10 ] zp[1]:19 [ utoa::digit#2 utoa::digit#1 printf_number_buffer::format_zero_padding#10 ]
reg byte x [ utoa::started#2 utoa::started#4 ] reg byte x [ utoa::started#2 utoa::started#4 ]
reg byte x [ utoa_append::digit#2 utoa_append::digit#1 ] reg byte x [ utoa_append::digit#2 utoa_append::digit#1 ]
@ -555,7 +555,7 @@ zp[1]:23 [ conio_cursor_y ]
zp[2]:24 [ conio_cursor_text cscroll::$7 cputln::$0 cputln::$1 gotoxy::$6 clrscr::line_cols#5 clrscr::line_cols#1 ] zp[2]:24 [ conio_cursor_text cscroll::$7 cputln::$0 cputln::$1 gotoxy::$6 clrscr::line_cols#5 clrscr::line_cols#1 ]
zp[2]:26 [ conio_cursor_color cscroll::$8 cputln::$2 cputln::$3 gotoxy::$7 gotoxy::$4 gotoxy::offset#0 gotoxy::$8 gotoxy::$10 ] zp[2]:26 [ conio_cursor_color cscroll::$8 cputln::$2 cputln::$3 gotoxy::$7 gotoxy::$4 gotoxy::offset#0 gotoxy::$8 gotoxy::$10 ]
zp[1]:28 [ conio_textcolor ] zp[1]:28 [ conio_textcolor ]
zp[2]:29 [ rand::return#0 main::first#0 ] zp[2]:29 [ _rand::return#0 main::first#0 ]
reg byte a [ main::$17 ] reg byte a [ main::$17 ]
reg byte a [ cputs::c#1 ] reg byte a [ cputs::c#1 ]
reg byte a [ toupper::return#3 ] reg byte a [ toupper::return#3 ]
@ -563,9 +563,9 @@ reg byte a [ strupr::$0 ]
reg byte a [ ultoa::$11 ] reg byte a [ ultoa::$11 ]
reg byte a [ ultoa::$10 ] reg byte a [ ultoa::$10 ]
zp[4]:31 [ ultoa::digit_value#0 ultoa_append::sub#0 ] zp[4]:31 [ ultoa::digit_value#0 ultoa_append::sub#0 ]
zp[2]:35 [ rand::$0 gotoxy::$9 strlen::str#2 strlen::str#0 cputs::s#4 cputs::s#5 cputs::s#0 ] zp[2]:35 [ _rand::$0 gotoxy::$9 strlen::str#2 strlen::str#0 cputs::s#4 cputs::s#5 cputs::s#0 ]
zp[2]:37 [ rand::$2 memcpy::src_end#0 memset::end#0 ] zp[2]:37 [ _rand::$2 memcpy::src_end#0 memset::end#0 ]
reg byte a [ utoa::$11 ] reg byte a [ utoa::$11 ]
reg byte a [ utoa::$10 ] reg byte a [ utoa::$10 ]
zp[2]:39 [ utoa::digit_value#0 utoa_append::sub#0 rand::$1 ultoa::buffer#11 ultoa::buffer#14 ultoa::buffer#4 ultoa::buffer#3 ultoa_append::buffer#0 strlen::len#2 strlen::len#1 strlen::return#2 printf_number_buffer::$19 memcpy::source#2 memcpy::src#2 memcpy::src#4 memcpy::src#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:39 [ utoa::digit_value#0 utoa_append::sub#0 _rand::$1 ultoa::buffer#11 ultoa::buffer#14 ultoa::buffer#4 ultoa::buffer#3 ultoa_append::buffer#0 strlen::len#2 strlen::len#1 strlen::return#2 printf_number_buffer::$19 memcpy::source#2 memcpy::src#2 memcpy::src#4 memcpy::src#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ]
mem[12] [ printf_buffer ] mem[12] [ printf_buffer ]