1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-12-18 08:30:18 +00:00

Moved tables into methods.

This commit is contained in:
jespergravgaard 2017-12-03 23:24:25 +01:00
parent 9ea1d4f2c1
commit c74b86a616
7 changed files with 672 additions and 945 deletions

View File

@ -23,11 +23,10 @@ void print_word(word w) {
print_byte(<w);
}
// Table of hexadecimal digits
byte[] hextab = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
// Print a byte as HEX
void print_byte(byte b) {
// Table of hexadecimal digits
const byte[] hextab = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
print_char(hextab[b>>4]);
print_char(hextab[b&$f]);
}

View File

@ -39,11 +39,10 @@ void print_word(word w) {
print_byte(<w);
}
// Table of hexadecimal digits
byte[] hextab = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
// Print a byte as HEX
void print_byte(byte b) {
// Table of hexadecimal digits
const byte[] hextab = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
print_char(hextab[b>>4]);
print_char(hextab[b&$f]);
}
@ -92,13 +91,13 @@ proc (void()) print_word((word) print_word::w)
print_word::@return:
return
endproc // print_word()
(byte[]) hextab ← { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' }
proc (void()) print_byte((byte) print_byte::b)
(byte[]) print_byte::hextab ← { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' }
(byte~) print_byte::$0 ← (byte) print_byte::b >> (byte/signed byte/word/signed word) 4
(byte~) print_byte::$1 ← (byte[]) hextab *idx (byte~) print_byte::$0
(byte~) print_byte::$1 ← (byte[]) print_byte::hextab *idx (byte~) print_byte::$0
(void~) print_byte::$2 ← call print_char (byte~) print_byte::$1
(byte~) print_byte::$3 ← (byte) print_byte::b & (byte/signed byte/word/signed word) 15
(byte~) print_byte::$4 ← (byte[]) hextab *idx (byte~) print_byte::$3
(byte~) print_byte::$4 ← (byte[]) print_byte::hextab *idx (byte~) print_byte::$3
(void~) print_byte::$5 ← call print_char (byte~) print_byte::$4
print_byte::@return:
return
@ -126,7 +125,6 @@ endproc // main()
SYMBOLS
(byte*) char_cursor
(byte[]) hextab
(byte*) line_cursor
(void()) main()
(void~) main::$0
@ -148,6 +146,7 @@ SYMBOLS
(void~) print_byte::$5
(label) print_byte::@return
(byte) print_byte::b
(byte[]) print_byte::hextab
(void()) print_char((byte) print_char::ch)
(label) print_char::@return
(byte) print_char::ch
@ -227,14 +226,14 @@ print_word::@return: scope:[print_word] from print_word
return
to:@return
@3: scope:[] from @2
(byte[]) hextab ← { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' }
to:@4
print_byte: scope:[print_byte] from
(byte[]) print_byte::hextab ← { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' }
(byte~) print_byte::$0 ← (byte) print_byte::b >> (byte/signed byte/word/signed word) 4
(byte~) print_byte::$1 ← (byte[]) hextab *idx (byte~) print_byte::$0
(byte~) print_byte::$1 ← (byte[]) print_byte::hextab *idx (byte~) print_byte::$0
(void~) print_byte::$2 ← call print_char (byte~) print_byte::$1
(byte~) print_byte::$3 ← (byte) print_byte::b & (byte/signed byte/word/signed word) 15
(byte~) print_byte::$4 ← (byte[]) hextab *idx (byte~) print_byte::$3
(byte~) print_byte::$4 ← (byte[]) print_byte::hextab *idx (byte~) print_byte::$3
(void~) print_byte::$5 ← call print_char (byte~) print_byte::$4
to:print_byte::@return
print_byte::@return: scope:[print_byte] from print_byte
@ -273,7 +272,6 @@ main::@return: scope:[main] from main
Removing unused procedure print_word
Removing unused procedure print_byte
Removing unused procedure print_char
Eliminating unused variable (byte[]) hextab and assignment [14] (byte[]) hextab ← { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' }
Eliminating unused variable - keeping the call (void~) main::$0
Eliminating unused variable - keeping the call (void~) main::$1
Eliminating unused variable - keeping the call (void~) main::$2

View File

@ -3,14 +3,11 @@
.pc = $80d "Program"
.const memLo = $fe
.const memHi = $ff
.const f_2pi = $e2e5
.label char_cursor = 5
.label line_cursor = 3
hextab: .byte '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
f_i: .byte 0, 0, 0, 0, 0
f_127: .byte 0, 0, 0, 0, 0
jsr main
main: {
.const f_2pi = $e2e5
.label _3 = 9
.label _12 = 9
.label i = 2
@ -78,6 +75,8 @@ main: {
lda print_ln._0+1
sta char_cursor+1
jmp b1
f_i: .byte 0, 0, 0, 0, 0
f_127: .byte 0, 0, 0, 0, 0
}
print_ln: {
.label _0 = 3
@ -124,6 +123,7 @@ print_byte: {
lda hextab,x
jsr print_char
rts
hextab: .byte '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
}
print_char: {
ldy #0
@ -149,9 +149,9 @@ getFAC: {
rts
}
addMEMtoFAC: {
lda #<f_127
lda #<main.f_127
sta prepareMEM.mem
lda #>f_127
lda #>main.f_127
sta prepareMEM.mem+1
jsr prepareMEM
lda $fe
@ -180,9 +180,9 @@ sinFAC: {
rts
}
divMEMbyFAC: {
lda #<f_i
lda #<main.f_i
sta prepareMEM.mem
lda #>f_i
lda #>main.f_i
sta prepareMEM.mem+1
jsr prepareMEM
lda $fe

View File

@ -21,7 +21,7 @@ main::@4: scope:[main] from main::@3
to:main::@1
main::@1: scope:[main] from main::@17 main::@4
[10] (byte*) line_cursor#13 ← phi( main::@17/(byte*~) print_ln::$0 main::@4/((byte*))(word/signed word) 1024 ) [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] )
[10] (byte*) char_cursor#32 ← phi( main::@17/(byte*~) char_cursor#50 main::@4/((byte*))(word/signed word) 1024 ) [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] )
[10] (byte*) char_cursor#32 ← phi( main::@17/(byte*~) char_cursor#48 main::@4/((byte*))(word/signed word) 1024 ) [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] )
[10] (byte) main::i#10 ← phi( main::@17/(byte) main::i#1 main::@4/(byte/signed byte/word/signed word) 1 ) [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] )
[11] (word~) main::$3 ← ((word)) (byte) main::i#10 [ main::i#10 char_cursor#32 line_cursor#13 main::$3 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$3 ] )
[12] (word) setFAC::w#1 ← (word~) main::$3 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] )
@ -77,7 +77,7 @@ main::@return: scope:[main] from main::@16
[38] return [ ] ( main:2 [ ] )
to:@return
main::@17: scope:[main] from main::@16
[39] (byte*~) char_cursor#50 ← (byte*~) print_ln::$0 [ main::i#1 char_cursor#50 print_ln::$0 ] ( main:2 [ main::i#1 char_cursor#50 print_ln::$0 ] )
[39] (byte*~) char_cursor#48 ← (byte*~) print_ln::$0 [ main::i#1 char_cursor#48 print_ln::$0 ] ( main:2 [ main::i#1 char_cursor#48 print_ln::$0 ] )
to:main::@1
print_ln: scope:[print_ln] from main::@15
[40] phi() [ line_cursor#13 char_cursor#10 ] ( main:2::print_ln:35 [ main::i#10 line_cursor#13 char_cursor#10 ] )
@ -107,13 +107,13 @@ print_byte: scope:[print_byte] from print_word print_word::@1
[52] (byte*) char_cursor#31 ← phi( print_word/(byte*) char_cursor#32 print_word::@1/(byte*) char_cursor#10 ) [ print_byte::b#2 char_cursor#31 ] ( main:2::print_word:33::print_byte:47 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 ] main:2::print_word:33::print_byte:50 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 ] )
[52] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) [ print_byte::b#2 char_cursor#31 ] ( main:2::print_word:33::print_byte:47 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 ] main:2::print_word:33::print_byte:50 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 ] )
[53] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 [ print_byte::b#2 char_cursor#31 print_byte::$0 ] ( main:2::print_word:33::print_byte:47 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_byte::$0 ] main:2::print_word:33::print_byte:50 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_byte::$0 ] )
[54] (byte~) print_byte::$1 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$0 [ print_byte::b#2 char_cursor#31 print_byte::$1 ] ( main:2::print_word:33::print_byte:47 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_byte::$1 ] main:2::print_word:33::print_byte:50 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_byte::$1 ] )
[54] (byte~) print_byte::$1 ← (const byte[]) print_byte::hextab#0 *idx (byte~) print_byte::$0 [ print_byte::b#2 char_cursor#31 print_byte::$1 ] ( main:2::print_word:33::print_byte:47 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_byte::$1 ] main:2::print_word:33::print_byte:50 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_byte::$1 ] )
[55] (byte) print_char::ch#0 ← (byte~) print_byte::$1 [ print_byte::b#2 char_cursor#31 print_char::ch#0 ] ( main:2::print_word:33::print_byte:47 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_char::ch#0 ] main:2::print_word:33::print_byte:50 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_char::ch#0 ] )
[56] call print_char param-assignment [ char_cursor#10 print_byte::b#2 ] ( main:2::print_word:33::print_byte:47 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::b#2 ] main:2::print_word:33::print_byte:50 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::b#2 ] )
to:print_byte::@1
print_byte::@1: scope:[print_byte] from print_byte
[57] (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 [ char_cursor#10 print_byte::$3 ] ( main:2::print_word:33::print_byte:47 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$3 ] main:2::print_word:33::print_byte:50 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$3 ] )
[58] (byte~) print_byte::$4 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$3 [ char_cursor#10 print_byte::$4 ] ( main:2::print_word:33::print_byte:47 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$4 ] main:2::print_word:33::print_byte:50 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$4 ] )
[58] (byte~) print_byte::$4 ← (const byte[]) print_byte::hextab#0 *idx (byte~) print_byte::$3 [ char_cursor#10 print_byte::$4 ] ( main:2::print_word:33::print_byte:47 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$4 ] main:2::print_word:33::print_byte:50 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$4 ] )
[59] (byte) print_char::ch#1 ← (byte~) print_byte::$4 [ char_cursor#10 print_char::ch#1 ] ( main:2::print_word:33::print_byte:47 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_char::ch#1 ] main:2::print_word:33::print_byte:50 [ main::i#10 line_cursor#13 char_cursor#10 print_char::ch#1 ] )
[60] call print_char param-assignment [ char_cursor#10 ] ( main:2::print_word:33::print_byte:47 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:33::print_byte:50 [ main::i#10 line_cursor#13 char_cursor#10 ] )
to:print_byte::@return
@ -148,7 +148,7 @@ addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1
[73] return [ ] ( main:2::addMEMtoFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 ] )
to:@return
prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC
[74] (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(const byte[]) f_127#0 divMEMbyFAC/(const byte[]) f_i#0 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) [ prepareMEM::mem#5 ] ( main:2::addMEMtoFAC:27::prepareMEM:71 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::mulFACbyMEM:15::prepareMEM:82 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::mulFACbyMEM:25::prepareMEM:82 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::divMEMbyFAC:21::prepareMEM:88 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::setFAC:5::prepareMEM:94 [ prepareMEM::mem#5 ] main:2::setFAC:13::prepareMEM:94 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::setFAC:19::prepareMEM:94 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::setMEMtoFAC:9::prepareMEM:99 [ prepareMEM::mem#5 ] main:2::setMEMtoFAC:17::prepareMEM:99 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] )
[74] (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(const byte[]) main::f_127#0 divMEMbyFAC/(const byte[]) main::f_i#0 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) [ prepareMEM::mem#5 ] ( main:2::addMEMtoFAC:27::prepareMEM:71 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::mulFACbyMEM:15::prepareMEM:82 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::mulFACbyMEM:25::prepareMEM:82 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::divMEMbyFAC:21::prepareMEM:88 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::setFAC:5::prepareMEM:94 [ prepareMEM::mem#5 ] main:2::setFAC:13::prepareMEM:94 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::setFAC:19::prepareMEM:94 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::setMEMtoFAC:9::prepareMEM:99 [ prepareMEM::mem#5 ] main:2::setMEMtoFAC:17::prepareMEM:99 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] )
[75] (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 [ prepareMEM::mem#5 prepareMEM::$0 ] ( main:2::addMEMtoFAC:27::prepareMEM:71 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 prepareMEM::$0 ] main:2::mulFACbyMEM:15::prepareMEM:82 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 prepareMEM::$0 ] main:2::mulFACbyMEM:25::prepareMEM:82 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 prepareMEM::$0 ] main:2::divMEMbyFAC:21::prepareMEM:88 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 prepareMEM::$0 ] main:2::setFAC:5::prepareMEM:94 [ prepareMEM::mem#5 prepareMEM::$0 ] main:2::setFAC:13::prepareMEM:94 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 prepareMEM::$0 ] main:2::setFAC:19::prepareMEM:94 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 prepareMEM::$0 ] main:2::setMEMtoFAC:9::prepareMEM:99 [ prepareMEM::mem#5 prepareMEM::$0 ] main:2::setMEMtoFAC:17::prepareMEM:99 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 prepareMEM::$0 ] )
[76] *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 [ prepareMEM::mem#5 ] ( main:2::addMEMtoFAC:27::prepareMEM:71 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::mulFACbyMEM:15::prepareMEM:82 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::mulFACbyMEM:25::prepareMEM:82 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::divMEMbyFAC:21::prepareMEM:88 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::setFAC:5::prepareMEM:94 [ prepareMEM::mem#5 ] main:2::setFAC:13::prepareMEM:94 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::setFAC:19::prepareMEM:94 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] main:2::setMEMtoFAC:9::prepareMEM:99 [ prepareMEM::mem#5 ] main:2::setMEMtoFAC:17::prepareMEM:99 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#5 ] )
[77] (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#5 [ prepareMEM::$1 ] ( main:2::addMEMtoFAC:27::prepareMEM:71 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:15::prepareMEM:82 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:25::prepareMEM:82 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::divMEMbyFAC:21::prepareMEM:88 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::setFAC:5::prepareMEM:94 [ prepareMEM::$1 ] main:2::setFAC:13::prepareMEM:94 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::setFAC:19::prepareMEM:94 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::setMEMtoFAC:9::prepareMEM:99 [ prepareMEM::$1 ] main:2::setMEMtoFAC:17::prepareMEM:99 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] )
@ -158,7 +158,7 @@ prepareMEM::@return: scope:[prepareMEM] from prepareMEM
[79] return [ ] ( main:2::addMEMtoFAC:27::prepareMEM:71 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:15::prepareMEM:82 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:25::prepareMEM:82 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::divMEMbyFAC:21::prepareMEM:88 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setFAC:5::prepareMEM:94 [ ] main:2::setFAC:13::prepareMEM:94 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setFAC:19::prepareMEM:94 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setMEMtoFAC:9::prepareMEM:99 [ ] main:2::setMEMtoFAC:17::prepareMEM:99 [ main::i#10 char_cursor#32 line_cursor#13 ] )
to:@return
mulFACbyMEM: scope:[mulFACbyMEM] from main::@11 main::@6
[80] (byte*) mulFACbyMEM::mem#2 ← phi( main::@11/(const byte[]) f_127#0 main::@6/(const byte*) f_2pi#0 ) [ mulFACbyMEM::mem#2 ] ( main:2::mulFACbyMEM:15 [ main::i#10 char_cursor#32 line_cursor#13 mulFACbyMEM::mem#2 ] main:2::mulFACbyMEM:25 [ main::i#10 char_cursor#32 line_cursor#13 mulFACbyMEM::mem#2 ] )
[80] (byte*) mulFACbyMEM::mem#2 ← phi( main::@11/(const byte[]) main::f_127#0 main::@6/(const byte*) main::f_2pi#0 ) [ mulFACbyMEM::mem#2 ] ( main:2::mulFACbyMEM:15 [ main::i#10 char_cursor#32 line_cursor#13 mulFACbyMEM::mem#2 ] main:2::mulFACbyMEM:25 [ main::i#10 char_cursor#32 line_cursor#13 mulFACbyMEM::mem#2 ] )
[81] (byte*) prepareMEM::mem#4 ← (byte*) mulFACbyMEM::mem#2 [ prepareMEM::mem#4 ] ( main:2::mulFACbyMEM:15 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:25 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] )
[82] call prepareMEM param-assignment [ ] ( main:2::mulFACbyMEM:15 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:25 [ main::i#10 char_cursor#32 line_cursor#13 ] )
to:mulFACbyMEM::@1
@ -197,7 +197,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1
[96] return [ ] ( main:2::setFAC:5 [ ] main:2::setFAC:13 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setFAC:19 [ main::i#10 char_cursor#32 line_cursor#13 ] )
to:@return
setMEMtoFAC: scope:[setMEMtoFAC] from main::@4 main::@7
[97] (byte*) setMEMtoFAC::mem#2 ← phi( main::@4/(const byte[]) f_127#0 main::@7/(const byte[]) f_i#0 ) [ setMEMtoFAC::mem#2 ] ( main:2::setMEMtoFAC:9 [ setMEMtoFAC::mem#2 ] main:2::setMEMtoFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setMEMtoFAC::mem#2 ] )
[97] (byte*) setMEMtoFAC::mem#2 ← phi( main::@4/(const byte[]) main::f_127#0 main::@7/(const byte[]) main::f_i#0 ) [ setMEMtoFAC::mem#2 ] ( main:2::setMEMtoFAC:9 [ setMEMtoFAC::mem#2 ] main:2::setMEMtoFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setMEMtoFAC::mem#2 ] )
[98] (byte*) prepareMEM::mem#1 ← (byte*) setMEMtoFAC::mem#2 [ prepareMEM::mem#1 ] ( main:2::setMEMtoFAC:9 [ prepareMEM::mem#1 ] main:2::setMEMtoFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#1 ] )
[99] call prepareMEM param-assignment [ ] ( main:2::setMEMtoFAC:9 [ ] main:2::setMEMtoFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 ] )
to:setMEMtoFAC::@1

File diff suppressed because it is too large Load Diff

View File

@ -10,19 +10,13 @@
(byte*) char_cursor#23 char_cursor zp ZP_PTR_BYTE:5 4.0
(byte*) char_cursor#31 char_cursor zp ZP_PTR_BYTE:5 1.5
(byte*) char_cursor#32 char_cursor zp ZP_PTR_BYTE:5 0.52
(byte*~) char_cursor#50 char_cursor zp ZP_PTR_BYTE:5 22.0
(byte*~) char_cursor#48 char_cursor zp ZP_PTR_BYTE:5 22.0
(void()) divFACby10()
(label) divFACby10::@return
(void()) divMEMbyFAC((byte*) divMEMbyFAC::mem)
(label) divMEMbyFAC::@1
(label) divMEMbyFAC::@return
(byte*) divMEMbyFAC::mem
(byte[]) f_127
(const byte[]) f_127#0 f_127 = { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 }
(byte*) f_2pi
(const byte*) f_2pi#0 f_2pi = ((byte*))(word) 58085
(byte[]) f_i
(const byte[]) f_i#0 f_i = { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 }
(word()) getFAC()
(label) getFAC::@return
(word) getFAC::return
@ -30,8 +24,6 @@
(word) getFAC::return#2 return zp ZP_WORD:9 22.0
(word) getFAC::w
(word) getFAC::w#1 w zp ZP_WORD:9 4.0
(byte[]) hextab
(const byte[]) hextab#0 hextab = { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' }
(byte*) line_cursor
(byte*) line_cursor#13 line_cursor zp ZP_PTR_BYTE:3 0.5
(byte*) line_cursor#6 line_cursor zp ZP_PTR_BYTE:3 204.0
@ -54,6 +46,12 @@
(label) main::@8
(label) main::@9
(label) main::@return
(byte[]) main::f_127
(const byte[]) main::f_127#0 f_127 = { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 }
(byte*) main::f_2pi
(const byte*) main::f_2pi#0 f_2pi = ((byte*))(word) 58085
(byte[]) main::f_i
(const byte[]) main::f_i#0 f_i = { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 }
(byte) main::i
(byte) main::i#1 i zp ZP_BYTE:2 11.0
(byte) main::i#10 i zp ZP_BYTE:2 1.2692307692307692
@ -86,6 +84,8 @@
(byte) print_byte::b#0 reg byte x 4.0
(byte) print_byte::b#1 reg byte x 4.0
(byte) print_byte::b#2 reg byte x 1.6
(byte[]) print_byte::hextab
(const byte[]) print_byte::hextab#0 hextab = { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' }
(void()) print_char((byte) print_char::ch)
(label) print_char::@return
(byte) print_char::ch
@ -122,7 +122,7 @@ zp ZP_BYTE:2 [ main::i#10 main::i#1 ]
zp ZP_PTR_BYTE:3 [ line_cursor#6 line_cursor#13 print_ln::$0 ]
reg byte x [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
reg byte a [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
zp ZP_PTR_BYTE:5 [ char_cursor#23 char_cursor#31 char_cursor#32 char_cursor#50 char_cursor#10 ]
zp ZP_PTR_BYTE:5 [ char_cursor#23 char_cursor#31 char_cursor#32 char_cursor#48 char_cursor#10 ]
zp ZP_PTR_BYTE:7 [ prepareMEM::mem#5 prepareMEM::mem#4 prepareMEM::mem#0 prepareMEM::mem#1 mulFACbyMEM::mem#2 setMEMtoFAC::mem#2 setFAC::$0 ]
zp ZP_WORD:9 [ setFAC::w#3 setFAC::w#1 main::$3 getFAC::return#2 main::$12 print_word::w#0 getFAC::w#1 getFAC::return#0 ]
reg byte a [ print_word::$0 ]

View File

@ -1,11 +1,10 @@
import "print"
import "basic-floats"
byte[] f_i = {0, 0, 0, 0, 0};
byte[] f_127 = {0, 0, 0, 0, 0};
byte* f_2pi = $e2e5;
void main() {
byte[] f_i = {0, 0, 0, 0, 0};
byte[] f_127 = {0, 0, 0, 0, 0};
const byte* f_2pi = $e2e5;
setFAC(1275);
divFACby10();
setMEMtoFAC(f_127);