1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-16 21:07:56 +00:00

Fixed test data.

This commit is contained in:
jespergravgaard 2021-01-17 13:01:07 +01:00
parent 6366d1a9fa
commit b11256030c
4 changed files with 460 additions and 436 deletions

View File

@ -180,18 +180,18 @@ do_perspective: {
jsr print_str
// perspective(x, y, z)
jsr perspective
// print_schar(xr)
// print_uchar((char)xr)
ldx.z xr
jsr print_schar
jsr print_uchar
// print_str(",")
lda #<str1
sta.z print_str.str
lda #>str1
sta.z print_str.str+1
jsr print_str
// print_schar(yr)
// print_uchar((char)yr)
ldx.z yr
jsr print_schar
jsr print_uchar
// print_str(")")
lda #<str5
sta.z print_str.str
@ -330,6 +330,29 @@ perspective: {
// }
rts
}
// Print a char as HEX
// print_uchar(byte register(X) b)
print_uchar: {
// b>>4
txa
lsr
lsr
lsr
lsr
// print_char(print_hextab[b>>4])
tay
lda print_hextab,y
// Table of hexadecimal digits
jsr print_char
// b&$f
lda #$f
axs #0
// print_char(print_hextab[b&$f])
lda print_hextab,x
jsr print_char
// }
rts
}
// Print a newline
print_ln: {
lda #<print_screen
@ -371,29 +394,6 @@ print_char: {
// }
rts
}
// Print a char as HEX
// print_uchar(byte register(X) b)
print_uchar: {
// b>>4
txa
lsr
lsr
lsr
lsr
// print_char(print_hextab[b>>4])
tay
lda print_hextab,y
// Table of hexadecimal digits
jsr print_char
// b&$f
lda #$f
axs #0
// print_char(print_hextab[b&$f])
lda print_hextab,x
jsr print_char
// }
rts
}
.segment Data
print_hextab: .text "0123456789abcdef"
// Multiplication tables for seriously fast multiplication.

View File

@ -107,16 +107,16 @@ do_perspective::@7: scope:[do_perspective] from do_perspective::@6
[53] call perspective
to:do_perspective::@8
do_perspective::@8: scope:[do_perspective] from do_perspective::@7
[54] print_schar::b#4 = xr
[55] call print_schar
[54] print_uchar::b#1 = (byte)xr
[55] call print_uchar
to:do_perspective::@9
do_perspective::@9: scope:[do_perspective] from do_perspective::@8
[56] phi()
[57] call print_str
to:do_perspective::@10
do_perspective::@10: scope:[do_perspective] from do_perspective::@9
[58] print_schar::b#5 = yr
[59] call print_schar
[58] print_uchar::b#2 = (byte)yr
[59] call print_uchar
to:do_perspective::@11
do_perspective::@11: scope:[do_perspective] from do_perspective::@10
[60] phi()
@ -168,17 +168,17 @@ print_str::@3: scope:[print_str] from print_str::@2
to:print_str::@1
void print_schar(signed byte print_schar::b)
print_schar: scope:[print_schar] from do_perspective::@1 do_perspective::@10 do_perspective::@3 do_perspective::@5 do_perspective::@8
[78] print_schar::b#10 = phi( do_perspective::@1/do_perspective::x#0, do_perspective::@10/print_schar::b#5, do_perspective::@3/do_perspective::y#0, do_perspective::@5/do_perspective::z#0, do_perspective::@8/print_schar::b#4 )
[79] if(print_schar::b#10<0) goto print_schar::@1
print_schar: scope:[print_schar] from do_perspective::@1 do_perspective::@3 do_perspective::@5
[78] print_schar::b#4 = phi( do_perspective::@1/do_perspective::x#0, do_perspective::@3/do_perspective::y#0, do_perspective::@5/do_perspective::z#0 )
[79] if(print_schar::b#4<0) goto print_schar::@1
to:print_schar::@3
print_schar::@3: scope:[print_schar] from print_schar
[80] phi()
[81] call print_char
to:print_schar::@2
print_schar::@2: scope:[print_schar] from print_schar::@3 print_schar::@4
[82] print_schar::b#8 = phi( print_schar::@4/print_schar::b#0, print_schar::@3/print_schar::b#10 )
[83] print_uchar::b#0 = (byte)print_schar::b#8
[82] print_schar::b#6 = phi( print_schar::@4/print_schar::b#0, print_schar::@3/print_schar::b#4 )
[83] print_uchar::b#0 = (byte)print_schar::b#6
[84] call print_uchar
to:print_schar::@return
print_schar::@return: scope:[print_schar] from print_schar::@2
@ -189,7 +189,7 @@ print_schar::@1: scope:[print_schar] from print_schar
[87] call print_char
to:print_schar::@4
print_schar::@4: scope:[print_schar] from print_schar::@1
[88] print_schar::b#0 = - print_schar::b#10
[88] print_schar::b#0 = - print_schar::b#4
to:print_schar::@2
void perspective(signed byte perspective::x , signed byte perspective::y , signed byte perspective::z)
@ -203,41 +203,43 @@ perspective::@return: scope:[perspective] from perspective
[93] return
to:@return
void print_uchar(byte print_uchar::b)
print_uchar: scope:[print_uchar] from do_perspective::@10 do_perspective::@8 print_schar::@2
[94] print_char_cursor#72 = phi( do_perspective::@10/print_char_cursor#1, do_perspective::@8/print_char_cursor#1, print_schar::@2/print_char_cursor#11 )
[94] print_uchar::b#3 = phi( do_perspective::@10/print_uchar::b#2, do_perspective::@8/print_uchar::b#1, print_schar::@2/print_uchar::b#0 )
[95] print_uchar::$0 = print_uchar::b#3 >> 4
[96] print_char::ch#3 = print_hextab[print_uchar::$0]
[97] call print_char
to:print_uchar::@1
print_uchar::@1: scope:[print_uchar] from print_uchar
[98] print_uchar::$2 = print_uchar::b#3 & $f
[99] print_char::ch#4 = print_hextab[print_uchar::$2]
[100] call print_char
to:print_uchar::@return
print_uchar::@return: scope:[print_uchar] from print_uchar::@1
[101] return
to:@return
void print_ln()
print_ln: scope:[print_ln] from do_perspective::@12
[94] phi()
[102] phi()
to:print_ln::@1
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
[95] print_line_cursor#12 = phi( print_ln/print_screen#0, print_ln::@1/print_line_cursor#0 )
[96] print_line_cursor#0 = print_line_cursor#12 + $28
[97] if(print_line_cursor#0<print_char_cursor#1) goto print_ln::@1
[103] print_line_cursor#12 = phi( print_ln/print_screen#0, print_ln::@1/print_line_cursor#0 )
[104] print_line_cursor#0 = print_line_cursor#12 + $28
[105] if(print_line_cursor#0<print_char_cursor#1) goto print_ln::@1
to:print_ln::@return
print_ln::@return: scope:[print_ln] from print_ln::@1
[98] return
[106] return
to:@return
void print_char(byte print_char::ch)
print_char: scope:[print_char] from print_schar::@1 print_schar::@3 print_str::@2 print_uchar print_uchar::@1
[99] print_char_cursor#45 = phi( print_schar::@1/print_char_cursor#1, print_schar::@3/print_char_cursor#1, print_str::@2/print_char_cursor#1, print_uchar/print_char_cursor#11, print_uchar::@1/print_char_cursor#11 )
[99] print_char::ch#5 = phi( print_schar::@1/'-', print_schar::@3/' ', print_str::@2/print_char::ch#0, print_uchar/print_char::ch#3, print_uchar::@1/print_char::ch#4 )
[100] *print_char_cursor#45 = print_char::ch#5
[101] print_char_cursor#11 = ++ print_char_cursor#45
[107] print_char_cursor#45 = phi( print_schar::@1/print_char_cursor#1, print_schar::@3/print_char_cursor#1, print_str::@2/print_char_cursor#1, print_uchar/print_char_cursor#72, print_uchar::@1/print_char_cursor#11 )
[107] print_char::ch#5 = phi( print_schar::@1/'-', print_schar::@3/' ', print_str::@2/print_char::ch#0, print_uchar/print_char::ch#3, print_uchar::@1/print_char::ch#4 )
[108] *print_char_cursor#45 = print_char::ch#5
[109] print_char_cursor#11 = ++ print_char_cursor#45
to:print_char::@return
print_char::@return: scope:[print_char] from print_char
[102] return
to:@return
void print_uchar(byte print_uchar::b)
print_uchar: scope:[print_uchar] from print_schar::@2
[103] print_uchar::$0 = print_uchar::b#0 >> 4
[104] print_char::ch#3 = print_hextab[print_uchar::$0]
[105] call print_char
to:print_uchar::@1
print_uchar::@1: scope:[print_uchar] from print_uchar
[106] print_uchar::$2 = print_uchar::b#0 & $f
[107] print_char::ch#4 = print_hextab[print_uchar::$2]
[108] call print_char
to:print_uchar::@return
print_uchar::@return: scope:[print_uchar] from print_uchar::@1
[109] return
[110] return
to:@return

File diff suppressed because one or more lines are too long

View File

@ -67,9 +67,10 @@ byte print_char::ch#3 reg byte a 20002.0
byte print_char::ch#4 reg byte a 20002.0
byte print_char::ch#5 reg byte a 130004.0
byte* print_char_cursor
byte* print_char_cursor#1 print_char_cursor zp[2]:6 1269.4615384615383
byte* print_char_cursor#11 print_char_cursor zp[2]:6 4661.035714285714
byte* print_char_cursor#1 print_char_cursor zp[2]:6 1277.230769230769
byte* print_char_cursor#11 print_char_cursor zp[2]:6 4673.423076923077
byte* print_char_cursor#45 print_char_cursor zp[2]:6 116003.5
byte* print_char_cursor#72 print_char_cursor zp[2]:6 3734.6666666666665
byte* print_char_cursor#77 print_char_cursor zp[2]:6 1506.0
void print_cls()
const to_nomodify byte* print_hextab[] = "0123456789abcdef"z
@ -80,10 +81,8 @@ void print_ln()
void print_schar(signed byte print_schar::b)
signed byte print_schar::b
signed byte print_schar::b#0 reg byte x 2002.0
signed byte print_schar::b#10 reg byte x 534.1666666666667
signed byte print_schar::b#4 reg byte x 202.0
signed byte print_schar::b#5 reg byte x 202.0
signed byte print_schar::b#8 reg byte x 2002.0
signed byte print_schar::b#4 reg byte x 500.5
signed byte print_schar::b#6 reg byte x 2002.0
byte* print_screen
const byte* print_screen#0 print_screen = (byte*) 1024
void print_str(byte* print_str::str)
@ -95,19 +94,23 @@ void print_uchar(byte print_uchar::b)
byte~ print_uchar::$0 reg byte a 20002.0
byte~ print_uchar::$2 reg byte x 20002.0
byte print_uchar::b
byte print_uchar::b#0 reg byte x 5250.75
byte print_uchar::b#0 reg byte x 2002.0
byte print_uchar::b#1 reg byte x 202.0
byte print_uchar::b#2 reg byte x 202.0
byte print_uchar::b#3 reg byte x 5301.25
volatile word psp1 loadstore zp[2]:11 0.5909090909090909
volatile word psp2 loadstore zp[2]:13 0.6190476190476191
volatile signed byte xr loadstore zp[1]:8 184.0
volatile signed byte yr loadstore zp[1]:9 122.66666666666667
volatile signed byte xr loadstore zp[1]:8 167.16666666666669
volatile signed byte yr loadstore zp[1]:9 111.44444444444446
volatile signed byte zr loadstore zp[1]:10 1003.0
reg byte y [ mulf_init::i#2 mulf_init::i#1 ]
zp[2]:2 [ print_str::str#7 print_str::str#10 print_str::str#0 mulf_init::add#2 mulf_init::add#1 ]
reg byte x [ print_schar::b#8 print_schar::b#0 print_schar::b#10 print_schar::b#5 print_schar::b#4 ]
reg byte x [ print_schar::b#6 print_schar::b#0 print_schar::b#4 ]
reg byte x [ print_uchar::b#3 print_uchar::b#2 print_uchar::b#1 print_uchar::b#0 ]
zp[2]:4 [ print_line_cursor#12 print_line_cursor#0 memset::dst#2 memset::dst#1 mulf_init::sqr#2 mulf_init::sqr#1 ]
reg byte a [ print_char::ch#5 print_char::ch#0 print_char::ch#3 print_char::ch#4 ]
zp[2]:6 [ print_char_cursor#45 print_char_cursor#1 print_char_cursor#77 print_char_cursor#11 ]
zp[2]:6 [ print_char_cursor#45 print_char_cursor#72 print_char_cursor#1 print_char_cursor#77 print_char_cursor#11 ]
zp[1]:8 [ xr ]
zp[1]:9 [ yr ]
zp[1]:10 [ zr ]
@ -116,6 +119,5 @@ zp[2]:13 [ psp2 ]
zp[1]:15 [ mulf_init::val#0 ]
reg byte x [ mulf_init::$2 ]
reg byte x [ mulf_init::$6 ]
reg byte x [ print_uchar::b#0 ]
reg byte a [ print_uchar::$0 ]
reg byte x [ print_uchar::$2 ]