mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-12-23 13:31:12 +00:00
Added strncmp() and strcmp() to <string.h>. Closes #700
This commit is contained in:
parent
f60e1240e2
commit
912f93b93b
2164
src/main/fragment/cache/fragment-cache-csg65ce02.asm
vendored
2164
src/main/fragment/cache/fragment-cache-csg65ce02.asm
vendored
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
//KICKC FRAGMENT CACHE 81bc8cd4f 81bc8edac
|
||||
//KICKC FRAGMENT CACHE 8d6655dbd 8d6657e44
|
||||
//FRAGMENT _deref_pbuc1=vbuc2
|
||||
lda #{c2}
|
||||
sta {c1}
|
||||
|
@ -1,4 +1,4 @@
|
||||
//KICKC FRAGMENT CACHE 81bc8cd4f 81bc8edac
|
||||
//KICKC FRAGMENT CACHE 8d6655dbd 8d6657e44
|
||||
//FRAGMENT vbuz1=vbuc1
|
||||
lda #{c1}
|
||||
sta {z1}
|
||||
|
6105
src/main/fragment/cache/fragment-cache-mos6502x.asm
vendored
6105
src/main/fragment/cache/fragment-cache-mos6502x.asm
vendored
File diff suppressed because it is too large
Load Diff
400
src/main/fragment/cache/fragment-cache-rom6502x.asm
vendored
400
src/main/fragment/cache/fragment-cache-rom6502x.asm
vendored
@ -1,4 +1,4 @@
|
||||
//KICKC FRAGMENT CACHE 81bc8cd4f 81bc8edac
|
||||
//KICKC FRAGMENT CACHE 8d6655dbd 8d6657e44
|
||||
//FRAGMENT _deref_pbuc1=_inc__deref_pbuc1
|
||||
inc {c1}
|
||||
//FRAGMENT isr_hardware_all_entry
|
||||
@ -792,401 +792,3 @@ iny
|
||||
tax
|
||||
//FRAGMENT vbuyy=vbuaa
|
||||
tay
|
||||
//FRAGMENT vbuz1=vbuz2_band_vbuc1
|
||||
lda #{c1}
|
||||
and {z2}
|
||||
sta {z1}
|
||||
//FRAGMENT _deref_pbuc1=_dec__deref_pbuc1
|
||||
dec {c1}
|
||||
//FRAGMENT pbuz1=pbuc1_plus_vbuz2
|
||||
lda {z2}
|
||||
clc
|
||||
adc #<{c1}
|
||||
sta {z1}
|
||||
lda #>{c1}
|
||||
adc #0
|
||||
sta {z1}+1
|
||||
//FRAGMENT pvoz1=pvoz2
|
||||
lda {z2}
|
||||
sta {z1}
|
||||
lda {z2}+1
|
||||
sta {z1}+1
|
||||
//FRAGMENT vbuz1=vbuz1_plus_2
|
||||
lda {z1}
|
||||
clc
|
||||
adc #2
|
||||
sta {z1}
|
||||
//FRAGMENT vbuz1=pbuz2_derefidx_vbuc1
|
||||
ldy #{c1}
|
||||
lda ({z2}),y
|
||||
sta {z1}
|
||||
//FRAGMENT pbuz1=pbuz2_plus_vbuc1
|
||||
lda #{c1}
|
||||
clc
|
||||
adc {z2}
|
||||
sta {z1}
|
||||
lda #0
|
||||
adc {z2}+1
|
||||
sta {z1}+1
|
||||
//FRAGMENT pbuz1_neq_pbuc1_then_la1
|
||||
lda {z1}+1
|
||||
cmp #>{c1}
|
||||
bne {la1}
|
||||
lda {z1}
|
||||
cmp #<{c1}
|
||||
bne {la1}
|
||||
//FRAGMENT _deref_pbuz1=_deref_pbuz2
|
||||
ldy #0
|
||||
lda ({z2}),y
|
||||
ldy #0
|
||||
sta ({z1}),y
|
||||
//FRAGMENT vbuz1=vbuaa_band_vbuc1
|
||||
and #{c1}
|
||||
sta {z1}
|
||||
//FRAGMENT vbuz1=vbuxx_band_vbuc1
|
||||
lda #{c1}
|
||||
sax {z1}
|
||||
//FRAGMENT vbuz1=vbuyy_band_vbuc1
|
||||
tya
|
||||
and #{c1}
|
||||
sta {z1}
|
||||
//FRAGMENT vbuaa=vbuz1_band_vbuc1
|
||||
lda #{c1}
|
||||
and {z1}
|
||||
//FRAGMENT vbuaa=vbuaa_band_vbuc1
|
||||
and #{c1}
|
||||
//FRAGMENT vbuaa=vbuxx_band_vbuc1
|
||||
txa
|
||||
and #{c1}
|
||||
//FRAGMENT vbuaa=vbuyy_band_vbuc1
|
||||
tya
|
||||
and #{c1}
|
||||
//FRAGMENT vbuxx=vbuz1_band_vbuc1
|
||||
lda #{c1}
|
||||
and {z1}
|
||||
tax
|
||||
//FRAGMENT vbuxx=vbuaa_band_vbuc1
|
||||
ldx #{c1}
|
||||
axs #0
|
||||
//FRAGMENT vbuyy=vbuz1_band_vbuc1
|
||||
lda #{c1}
|
||||
and {z1}
|
||||
tay
|
||||
//FRAGMENT pbuz1=pbuc1_plus_vbuaa
|
||||
clc
|
||||
adc #<{c1}
|
||||
sta {z1}
|
||||
lda #>{c1}
|
||||
adc #0
|
||||
sta {z1}+1
|
||||
//FRAGMENT pbuz1=pbuc1_plus_vbuxx
|
||||
txa
|
||||
clc
|
||||
adc #<{c1}
|
||||
sta {z1}
|
||||
lda #>{c1}
|
||||
adc #0
|
||||
sta {z1}+1
|
||||
//FRAGMENT pbuz1=pbuc1_plus_vbuyy
|
||||
tya
|
||||
clc
|
||||
adc #<{c1}
|
||||
sta {z1}
|
||||
lda #>{c1}
|
||||
adc #0
|
||||
sta {z1}+1
|
||||
//FRAGMENT vbuxx=vbuxx_plus_2
|
||||
inx
|
||||
inx
|
||||
//FRAGMENT vbuaa=pbuz1_derefidx_vbuc1
|
||||
ldy #{c1}
|
||||
lda ({z1}),y
|
||||
//FRAGMENT vbuxx=pbuz1_derefidx_vbuc1
|
||||
ldy #{c1}
|
||||
lda ({z1}),y
|
||||
tax
|
||||
//FRAGMENT vbuyy=pbuz1_derefidx_vbuc1
|
||||
ldy #{c1}
|
||||
lda ({z1}),y
|
||||
tay
|
||||
//FRAGMENT pbuz1=pbuz1_plus_vbuc1
|
||||
lda #{c1}
|
||||
clc
|
||||
adc {z1}
|
||||
sta {z1}
|
||||
bcc !+
|
||||
inc {z1}+1
|
||||
!:
|
||||
//FRAGMENT vbuz1=_dec_vbuz1
|
||||
dec {z1}
|
||||
//FRAGMENT pbuz1=pbuz2
|
||||
lda {z2}
|
||||
sta {z1}
|
||||
lda {z2}+1
|
||||
sta {z1}+1
|
||||
//FRAGMENT _deref_pbuz1=pbuc1_derefidx_vbuz2
|
||||
ldy {z2}
|
||||
lda {c1},y
|
||||
ldy #0
|
||||
sta ({z1}),y
|
||||
//FRAGMENT pbuz1=_inc_pbuz2
|
||||
clc
|
||||
lda {z2}
|
||||
adc #1
|
||||
sta {z1}
|
||||
lda {z2}+1
|
||||
adc #0
|
||||
sta {z1}+1
|
||||
//FRAGMENT _deref_pbuz1=vbuc1
|
||||
lda #{c1}
|
||||
ldy #0
|
||||
sta ({z1}),y
|
||||
//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2
|
||||
ldy {z2}
|
||||
lda {c1},y
|
||||
sta {z1}
|
||||
//FRAGMENT vbuz1_ge_vbuz2_then_la1
|
||||
lda {z1}
|
||||
cmp {z2}
|
||||
bcs {la1}
|
||||
//FRAGMENT vbuz1=vbuz1_minus_vbuz2
|
||||
lda {z1}
|
||||
sec
|
||||
sbc {z2}
|
||||
sta {z1}
|
||||
//FRAGMENT vwuz1=_word_vbuz2
|
||||
lda {z2}
|
||||
sta {z1}
|
||||
lda #0
|
||||
sta {z1}+1
|
||||
//FRAGMENT vwuz1=vwuz2_rol_5
|
||||
lda {z2}
|
||||
asl
|
||||
sta {z1}
|
||||
lda {z2}+1
|
||||
rol
|
||||
sta {z1}+1
|
||||
asl {z1}
|
||||
rol {z1}+1
|
||||
asl {z1}
|
||||
rol {z1}+1
|
||||
asl {z1}
|
||||
rol {z1}+1
|
||||
asl {z1}
|
||||
rol {z1}+1
|
||||
//FRAGMENT pbuz1=pbuc1_plus_vwuz2
|
||||
lda {z2}
|
||||
clc
|
||||
adc #<{c1}
|
||||
sta {z1}
|
||||
lda {z2}+1
|
||||
adc #>{c1}
|
||||
sta {z1}+1
|
||||
//FRAGMENT pbuz1=pbuz2_plus_vbuz3
|
||||
lda {z3}
|
||||
clc
|
||||
adc {z2}
|
||||
sta {z1}
|
||||
lda #0
|
||||
adc {z2}+1
|
||||
sta {z1}+1
|
||||
//FRAGMENT pbuz1=pbuz1_minus_vbuc1
|
||||
sec
|
||||
lda {z1}
|
||||
sbc #{c1}
|
||||
sta {z1}
|
||||
lda {z1}+1
|
||||
sbc #0
|
||||
sta {z1}+1
|
||||
//FRAGMENT vbuz1=_deref_pbuc1
|
||||
lda {c1}
|
||||
sta {z1}
|
||||
//FRAGMENT _deref_pbuz1=vbuz2
|
||||
lda {z2}
|
||||
ldy #0
|
||||
sta ({z1}),y
|
||||
//FRAGMENT vbuxx=vbuxx_band_vbuc1
|
||||
lda #{c1}
|
||||
axs #0
|
||||
//FRAGMENT vbuyy=vbuxx_band_vbuc1
|
||||
txa
|
||||
and #{c1}
|
||||
tay
|
||||
//FRAGMENT vbuxx=vbuyy_band_vbuc1
|
||||
ldx #{c1}
|
||||
tya
|
||||
axs #0
|
||||
//FRAGMENT vbuyy=vbuyy_band_vbuc1
|
||||
tya
|
||||
and #{c1}
|
||||
tay
|
||||
//FRAGMENT _deref_pbuz1=pbuc1_derefidx_vbuaa
|
||||
tay
|
||||
lda {c1},y
|
||||
ldy #0
|
||||
sta ({z1}),y
|
||||
//FRAGMENT _deref_pbuz1=pbuc1_derefidx_vbuxx
|
||||
lda {c1},x
|
||||
ldy #0
|
||||
sta ({z1}),y
|
||||
//FRAGMENT _deref_pbuz1=pbuc1_derefidx_vbuyy
|
||||
lda {c1},y
|
||||
ldy #0
|
||||
sta ({z1}),y
|
||||
//FRAGMENT vbuaa=pbuc1_derefidx_vbuz1
|
||||
ldy {z1}
|
||||
lda {c1},y
|
||||
//FRAGMENT vbuxx=pbuc1_derefidx_vbuz1
|
||||
ldy {z1}
|
||||
ldx {c1},y
|
||||
//FRAGMENT vbuyy=pbuc1_derefidx_vbuz1
|
||||
ldx {z1}
|
||||
ldy {c1},x
|
||||
//FRAGMENT vbuz1=pbuc1_derefidx_vbuaa
|
||||
tay
|
||||
lda {c1},y
|
||||
sta {z1}
|
||||
//FRAGMENT vbuaa=pbuc1_derefidx_vbuaa
|
||||
tay
|
||||
lda {c1},y
|
||||
//FRAGMENT vbuxx=pbuc1_derefidx_vbuaa
|
||||
tay
|
||||
ldx {c1},y
|
||||
//FRAGMENT vbuyy=pbuc1_derefidx_vbuaa
|
||||
tax
|
||||
ldy {c1},x
|
||||
//FRAGMENT vbuz1=pbuc1_derefidx_vbuxx
|
||||
lda {c1},x
|
||||
sta {z1}
|
||||
//FRAGMENT 0_neq_vbuaa_then_la1
|
||||
cmp #0
|
||||
bne {la1}
|
||||
//FRAGMENT vbuaa_ge_vbuz1_then_la1
|
||||
cmp {z1}
|
||||
bcs {la1}
|
||||
//FRAGMENT vbuxx=vbuxx_minus_vbuz1
|
||||
txa
|
||||
sec
|
||||
sbc {z1}
|
||||
tax
|
||||
//FRAGMENT vbuz1=vbuz1_minus_vbuaa
|
||||
eor #$ff
|
||||
sec
|
||||
adc {z1}
|
||||
sta {z1}
|
||||
//FRAGMENT vbuxx=vbuxx_minus_vbuaa
|
||||
sta $ff
|
||||
txa
|
||||
sec
|
||||
sbc $ff
|
||||
tax
|
||||
//FRAGMENT vbuz1=vbuz1_minus_vbuxx
|
||||
txa
|
||||
eor #$ff
|
||||
sec
|
||||
adc {z1}
|
||||
sta {z1}
|
||||
//FRAGMENT vbuxx=vbuxx_minus_vbuxx
|
||||
lda #0
|
||||
tax
|
||||
//FRAGMENT vbuz1=vbuz1_minus_vbuyy
|
||||
tya
|
||||
eor #$ff
|
||||
sec
|
||||
adc {z1}
|
||||
sta {z1}
|
||||
//FRAGMENT vbuxx=vbuxx_minus_vbuyy
|
||||
txa
|
||||
sty $ff
|
||||
sec
|
||||
sbc $ff
|
||||
tax
|
||||
//FRAGMENT vwuz1=_word_vbuaa
|
||||
sta {z1}
|
||||
lda #0
|
||||
sta {z1}+1
|
||||
//FRAGMENT vwuz1=_word_vbuxx
|
||||
txa
|
||||
sta {z1}
|
||||
lda #0
|
||||
sta {z1}+1
|
||||
//FRAGMENT vwuz1=_word_vbuyy
|
||||
tya
|
||||
sta {z1}
|
||||
lda #0
|
||||
sta {z1}+1
|
||||
//FRAGMENT vbuaa_eq_vbuc1_then_la1
|
||||
cmp #{c1}
|
||||
beq {la1}
|
||||
//FRAGMENT vbuaa=_deref_pbuc1
|
||||
lda {c1}
|
||||
//FRAGMENT vbuxx=_deref_pbuc1
|
||||
ldx {c1}
|
||||
//FRAGMENT _deref_pbuz1=vbuaa
|
||||
ldy #0
|
||||
sta ({z1}),y
|
||||
//FRAGMENT _deref_pbuz1=vbuxx
|
||||
txa
|
||||
ldy #0
|
||||
sta ({z1}),y
|
||||
//FRAGMENT _deref_pbuz1=vbuyy
|
||||
tya
|
||||
ldy #0
|
||||
sta ({z1}),y
|
||||
//FRAGMENT vbuxx_ge_vbuz1_then_la1
|
||||
cpx {z1}
|
||||
bcs {la1}
|
||||
//FRAGMENT vbuxx_eq_vbuc1_then_la1
|
||||
cpx #{c1}
|
||||
beq {la1}
|
||||
//FRAGMENT vbuyy=_deref_pbuc1
|
||||
ldy {c1}
|
||||
//FRAGMENT vbuz1_ge_vbuxx_then_la1
|
||||
lda {z1}
|
||||
stx $ff
|
||||
cmp $ff
|
||||
bcs {la1}
|
||||
//FRAGMENT vbuz1_ge_vbuyy_then_la1
|
||||
lda {z1}
|
||||
sty $ff
|
||||
cmp $ff
|
||||
bcs {la1}
|
||||
//FRAGMENT vbuxx_ge_vbuyy_then_la1
|
||||
sty $ff
|
||||
cpx $ff
|
||||
bcs {la1}
|
||||
//FRAGMENT vbuaa=vbuxx
|
||||
txa
|
||||
//FRAGMENT vbuyy=vbuxx
|
||||
txa
|
||||
tay
|
||||
//FRAGMENT vbuyy_eq_vbuc1_then_la1
|
||||
cpy #{c1}
|
||||
beq {la1}
|
||||
//FRAGMENT vbuaa=vbuyy
|
||||
tya
|
||||
//FRAGMENT vbuxx=vbuyy
|
||||
tya
|
||||
tax
|
||||
//FRAGMENT vbuyy_ge_vbuz1_then_la1
|
||||
cpy {z1}
|
||||
bcs {la1}
|
||||
//FRAGMENT vwuz1=vwuz1_rol_5
|
||||
asl {z1}
|
||||
rol {z1}+1
|
||||
asl {z1}
|
||||
rol {z1}+1
|
||||
asl {z1}
|
||||
rol {z1}+1
|
||||
asl {z1}
|
||||
rol {z1}+1
|
||||
asl {z1}
|
||||
rol {z1}+1
|
||||
//FRAGMENT pbuz1=pbuc1_plus_vwuz1
|
||||
lda {z1}
|
||||
clc
|
||||
adc #<{c1}
|
||||
sta {z1}
|
||||
lda {z1}+1
|
||||
adc #>{c1}
|
||||
sta {z1}+1
|
||||
|
4218
src/main/fragment/cache/fragment-cache-wdc65c02.asm
vendored
4218
src/main/fragment/cache/fragment-cache-wdc65c02.asm
vendored
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,5 @@
|
||||
eor #{c1}
|
||||
beq !+
|
||||
lda #1
|
||||
!:
|
||||
eor #1
|
10
src/main/fragment/mos6502-common/vboaa=vbsaa_gt_vbsc1.asm
Normal file
10
src/main/fragment/mos6502-common/vboaa=vbsaa_gt_vbsc1.asm
Normal file
@ -0,0 +1,10 @@
|
||||
sec
|
||||
sbc #{c1}
|
||||
beq !a+
|
||||
bvs !+
|
||||
eor #$80
|
||||
!:
|
||||
asl
|
||||
lda #0
|
||||
rol
|
||||
!a:
|
@ -0,0 +1,8 @@
|
||||
sec
|
||||
sbc #{c1}
|
||||
bvc !+
|
||||
eor #$80
|
||||
!:
|
||||
asl
|
||||
lda #0
|
||||
rol
|
1
src/main/fragment/mos6502-common/vbsaa=vwsm1.asm
Normal file
1
src/main/fragment/mos6502-common/vbsaa=vwsm1.asm
Normal file
@ -0,0 +1 @@
|
||||
lda {m1}
|
@ -0,0 +1,10 @@
|
||||
ldy #0
|
||||
sec
|
||||
lda ({z2}),y
|
||||
sbc ({z3}),y
|
||||
sta {m1}
|
||||
ora #$7f
|
||||
bmi !+
|
||||
lda #0
|
||||
!:
|
||||
sta {m1}+1
|
@ -0,0 +1,11 @@
|
||||
ldy #0
|
||||
sec
|
||||
lda ({z2}),y
|
||||
sbc ({z1}),y
|
||||
pha
|
||||
iny
|
||||
lda ({z2}),y
|
||||
sbc ({z1}),y
|
||||
sta {z1}+1
|
||||
pla
|
||||
sta {z1}
|
@ -34,4 +34,21 @@ size_t strlen(char *str);
|
||||
/// @param c A character to search for
|
||||
/// @param n The number of bytes to look through
|
||||
/// @return A pointer to the matching byte or NULL if the character does not occur in the given memory area.
|
||||
void *memchr(const void *str, char c, size_t n);
|
||||
void *memchr(const void *str, char c, size_t n);
|
||||
|
||||
/// compares the string pointed to, by str1 to the string pointed to by str2.
|
||||
/// @param str1 This is the first string to be compared.
|
||||
/// @param str2 This is the second string to be compared.
|
||||
/// @return if Return value < 0 then it indicates str1 is less than str2.
|
||||
/// if Return value > 0 then it indicates str2 is less than str1.
|
||||
/// if Return value = 0 then it indicates str1 is equal to str2.
|
||||
int strcmp(const char *str1, const char *str2);
|
||||
|
||||
/// Compares at most the first n bytes of str1 and str2.
|
||||
/// @param str1 This is the first string to be compared.
|
||||
/// @param str2 This is the second string to be compared.
|
||||
/// @param The maximum number of characters to be compared.
|
||||
/// @return if Return value < 0 then it indicates str1 is less than str2.
|
||||
/// if Return value > 0 then it indicates str2 is less than str1.
|
||||
/// if Return value = 0 then it indicates str1 is equal to str2.
|
||||
int strncmp(const char *str1, const char *str2, size_t n);
|
@ -94,4 +94,36 @@ void *memchr(const void *str, char c, size_t n) {
|
||||
ptr++;
|
||||
}
|
||||
return (void*)0;
|
||||
}
|
||||
|
||||
/// compares the string pointed to, by str1 to the string pointed to by str2.
|
||||
/// @param str1 This is the first string to be compared.
|
||||
/// @param str2 This is the second string to be compared.
|
||||
/// @return if Return value < 0 then it indicates str1 is less than str2.
|
||||
/// if Return value > 0 then it indicates str2 is less than str1.
|
||||
/// if Return value = 0 then it indicates str1 is equal to str2.
|
||||
int strcmp(const char *str1, const char *str2) {
|
||||
char *s1 = str1, *s2 = str2;
|
||||
while(*s1==*s2) {
|
||||
if(*s1==0) return 0;
|
||||
s1++; s2++;
|
||||
}
|
||||
return (int)(signed char)(*s1-*s2);
|
||||
}
|
||||
|
||||
/// Compares at most the first n bytes of str1 and str2.
|
||||
/// @param str1 This is the first string to be compared.
|
||||
/// @param str2 This is the second string to be compared.
|
||||
/// @param The maximum number of characters to be compared.
|
||||
/// @return if Return value < 0 then it indicates str1 is less than str2.
|
||||
/// if Return value > 0 then it indicates str2 is less than str1.
|
||||
/// if Return value = 0 then it indicates str1 is equal to str2.
|
||||
int strncmp(const char *str1, const char *str2, size_t n) {
|
||||
char *s1 = str1, *s2 = str2;
|
||||
while(*s1==*s2) {
|
||||
n--;
|
||||
if(*s1==0 || n==0) return 0;
|
||||
s1++; s2++;
|
||||
}
|
||||
return (int)(signed char)(*s1-*s2);
|
||||
}
|
@ -9,6 +9,11 @@ import java.io.IOException;
|
||||
*/
|
||||
public class TestProgramsFast extends TestPrograms {
|
||||
|
||||
@Test
|
||||
public void testStrcmp0() throws IOException {
|
||||
compileAndCompare("strcmp-0.c");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLabelGoto5() throws IOException {
|
||||
compileAndCompare("labelgoto-5.c");
|
||||
|
56
src/test/kc/strcmp-0.c
Normal file
56
src/test/kc/strcmp-0.c
Normal file
@ -0,0 +1,56 @@
|
||||
/// Test strcmp()
|
||||
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <string.h>
|
||||
#include <6502.h>
|
||||
|
||||
#define LESS_THAN -1
|
||||
#define EQUAL 0
|
||||
#define GREATER_THAN 1
|
||||
|
||||
void assert_cmp(signed char expect, signed char actual, char* message);
|
||||
|
||||
void main() {
|
||||
|
||||
assert_cmp(LESS_THAN, strcmp("a","b"), "a<b");
|
||||
assert_cmp(LESS_THAN, strcmp("aaa","aab"), "aaa<aab");
|
||||
assert_cmp(LESS_THAN, strcmp("aa","aaa"), "aa<aaa");
|
||||
assert_cmp(EQUAL, strcmp("x","x"), "x=x");
|
||||
assert_cmp(EQUAL, strcmp("qwez","qwez"), "qwez=qwez");
|
||||
assert_cmp(GREATER_THAN, strcmp("q","k"), "q>k");
|
||||
assert_cmp(GREATER_THAN, strcmp("kkkq","kkkp"), "kkkq>kkkp");
|
||||
assert_cmp(GREATER_THAN, strcmp("kkkq","kkk"), "kkkq>kkk");
|
||||
|
||||
assert_cmp(LESS_THAN, strncmp("aaax","aabx", 3), "aaax<aabx (3)");
|
||||
assert_cmp(GREATER_THAN, strncmp("qwe","qee", 3), "qwe>qee (2)");
|
||||
assert_cmp(EQUAL, strncmp("aab","aac", 2), "aab=aac (2)");
|
||||
assert_cmp(EQUAL, strncmp("qwex","qwea", 3), "qwex=qwea (3)");
|
||||
|
||||
for(;;) ;
|
||||
}
|
||||
|
||||
|
||||
void assert_cmp(signed char expect, signed char actual, char* message) {
|
||||
char ok = 0;
|
||||
switch(expect) {
|
||||
case LESS_THAN:
|
||||
BREAK();
|
||||
ok = (char)(actual<0);
|
||||
break;
|
||||
case EQUAL:
|
||||
ok = (char)(actual==0);
|
||||
break;
|
||||
case GREATER_THAN:
|
||||
ok = (char)(actual>0);
|
||||
break;
|
||||
}
|
||||
|
||||
if(ok) {
|
||||
textcolor(GREEN);
|
||||
printf("ok! %s\n", message);
|
||||
} else {
|
||||
textcolor(RED);
|
||||
printf("Assert failed. expected:%d actual:%d. %s\n", expect, actual, message);
|
||||
}
|
||||
}
|
25
src/test/kc/test-signed-comparisons.c
Normal file
25
src/test/kc/test-signed-comparisons.c
Normal file
@ -0,0 +1,25 @@
|
||||
// Test signed char comparisons
|
||||
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <string.h>
|
||||
|
||||
void main() {
|
||||
clrscr();
|
||||
printf(" val <-50 < 0 < 50 >-50 > 0 >50 \n");
|
||||
for(signed char val=-100; val<=100;val+=10) {
|
||||
char lt_m50 = (char)(val<-50);
|
||||
char lt_0 = (char)(val<0);
|
||||
char lt_p50 = (char)(val<50);
|
||||
char gt_m50 = (char)(val>-50);
|
||||
char gt_0 = (char)(val>0);
|
||||
char gt_p50 = (char)(val>50);
|
||||
|
||||
printf("%4d %1u %1u %1u %1u %1u %1u\n", val, lt_m50, lt_0, lt_p50, gt_m50, gt_0, gt_p50);
|
||||
|
||||
}
|
||||
|
||||
for(;;) ;
|
||||
|
||||
|
||||
}
|
1134
src/test/ref/strcmp-0.asm
Normal file
1134
src/test/ref/strcmp-0.asm
Normal file
File diff suppressed because it is too large
Load Diff
571
src/test/ref/strcmp-0.cfg
Normal file
571
src/test/ref/strcmp-0.cfg
Normal file
@ -0,0 +1,571 @@
|
||||
|
||||
void __start()
|
||||
__start: scope:[__start] from
|
||||
[0] phi()
|
||||
to:__start::__init1
|
||||
__start::__init1: scope:[__start] from __start
|
||||
[1] conio_cursor_x = 0
|
||||
[2] conio_cursor_y = 0
|
||||
[3] conio_line_text = DEFAULT_SCREEN
|
||||
[4] conio_line_color = COLORRAM
|
||||
[5] conio_textcolor = LIGHT_BLUE
|
||||
[6] call conio_c64_init
|
||||
to:__start::@1
|
||||
__start::@1: scope:[__start] from __start::__init1
|
||||
[7] phi()
|
||||
[8] call main
|
||||
to:__start::@return
|
||||
__start::@return: scope:[__start] from __start::@1
|
||||
[9] return
|
||||
to:@return
|
||||
|
||||
void conio_c64_init()
|
||||
conio_c64_init: scope:[conio_c64_init] from __start::__init1
|
||||
[10] conio_c64_init::line#0 = *conio_c64_init::BASIC_CURSOR_LINE
|
||||
[11] if(conio_c64_init::line#0<$19) goto conio_c64_init::@2
|
||||
to:conio_c64_init::@1
|
||||
conio_c64_init::@2: scope:[conio_c64_init] from conio_c64_init
|
||||
[12] phi()
|
||||
to:conio_c64_init::@1
|
||||
conio_c64_init::@1: scope:[conio_c64_init] from conio_c64_init conio_c64_init::@2
|
||||
[13] conio_c64_init::line#2 = phi( conio_c64_init::@2/conio_c64_init::line#0, conio_c64_init/$19-1 )
|
||||
[14] gotoxy::y#2 = conio_c64_init::line#2
|
||||
[15] call gotoxy
|
||||
to:conio_c64_init::@return
|
||||
conio_c64_init::@return: scope:[conio_c64_init] from conio_c64_init::@1
|
||||
[16] return
|
||||
to:@return
|
||||
|
||||
void main()
|
||||
main: scope:[main] from __start::@1
|
||||
[17] phi()
|
||||
[18] call strcmp
|
||||
[19] strcmp::return#12 = strcmp::return#11
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main
|
||||
[20] assert_cmp::actual#0 = strcmp::return#12
|
||||
[21] call assert_cmp
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@2
|
||||
[22] phi()
|
||||
[23] call strcmp
|
||||
[24] strcmp::return#13 = strcmp::return#11
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@3
|
||||
[25] assert_cmp::actual#1 = strcmp::return#13
|
||||
[26] call assert_cmp
|
||||
to:main::@5
|
||||
main::@5: scope:[main] from main::@4
|
||||
[27] phi()
|
||||
[28] call strcmp
|
||||
[29] strcmp::return#14 = strcmp::return#11
|
||||
to:main::@6
|
||||
main::@6: scope:[main] from main::@5
|
||||
[30] assert_cmp::actual#2 = strcmp::return#14
|
||||
[31] call assert_cmp
|
||||
to:main::@7
|
||||
main::@7: scope:[main] from main::@6
|
||||
[32] phi()
|
||||
[33] call strcmp
|
||||
[34] strcmp::return#15 = strcmp::return#11
|
||||
to:main::@8
|
||||
main::@8: scope:[main] from main::@7
|
||||
[35] assert_cmp::actual#3 = strcmp::return#15
|
||||
[36] call assert_cmp
|
||||
to:main::@9
|
||||
main::@9: scope:[main] from main::@8
|
||||
[37] phi()
|
||||
[38] call strcmp
|
||||
[39] strcmp::return#16 = strcmp::return#11
|
||||
to:main::@10
|
||||
main::@10: scope:[main] from main::@9
|
||||
[40] assert_cmp::actual#4 = strcmp::return#16
|
||||
[41] call assert_cmp
|
||||
to:main::@11
|
||||
main::@11: scope:[main] from main::@10
|
||||
[42] phi()
|
||||
[43] call strcmp
|
||||
[44] strcmp::return#17 = strcmp::return#11
|
||||
to:main::@12
|
||||
main::@12: scope:[main] from main::@11
|
||||
[45] assert_cmp::actual#5 = strcmp::return#17
|
||||
[46] call assert_cmp
|
||||
to:main::@13
|
||||
main::@13: scope:[main] from main::@12
|
||||
[47] phi()
|
||||
[48] call strcmp
|
||||
[49] strcmp::return#18 = strcmp::return#11
|
||||
to:main::@14
|
||||
main::@14: scope:[main] from main::@13
|
||||
[50] assert_cmp::actual#6 = strcmp::return#18
|
||||
[51] call assert_cmp
|
||||
to:main::@15
|
||||
main::@15: scope:[main] from main::@14
|
||||
[52] phi()
|
||||
[53] call strcmp
|
||||
[54] strcmp::return#10 = strcmp::return#11
|
||||
to:main::@16
|
||||
main::@16: scope:[main] from main::@15
|
||||
[55] assert_cmp::actual#7 = strcmp::return#10
|
||||
[56] call assert_cmp
|
||||
to:main::@17
|
||||
main::@17: scope:[main] from main::@16
|
||||
[57] phi()
|
||||
[58] call strncmp
|
||||
[59] strncmp::return#3 = strncmp::return#2
|
||||
to:main::@18
|
||||
main::@18: scope:[main] from main::@17
|
||||
[60] assert_cmp::actual#8 = strncmp::return#3
|
||||
[61] call assert_cmp
|
||||
to:main::@19
|
||||
main::@19: scope:[main] from main::@18
|
||||
[62] phi()
|
||||
[63] call strncmp
|
||||
[64] strncmp::return#4 = strncmp::return#2
|
||||
to:main::@20
|
||||
main::@20: scope:[main] from main::@19
|
||||
[65] assert_cmp::actual#9 = strncmp::return#4
|
||||
[66] call assert_cmp
|
||||
to:main::@21
|
||||
main::@21: scope:[main] from main::@20
|
||||
[67] phi()
|
||||
[68] call strncmp
|
||||
[69] strncmp::return#10 = strncmp::return#2
|
||||
to:main::@22
|
||||
main::@22: scope:[main] from main::@21
|
||||
[70] assert_cmp::actual#10 = strncmp::return#10
|
||||
[71] call assert_cmp
|
||||
to:main::@23
|
||||
main::@23: scope:[main] from main::@22
|
||||
[72] phi()
|
||||
[73] call strncmp
|
||||
[74] strncmp::return#11 = strncmp::return#2
|
||||
to:main::@24
|
||||
main::@24: scope:[main] from main::@23
|
||||
[75] assert_cmp::actual#11 = strncmp::return#11
|
||||
[76] call assert_cmp
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main::@1 main::@24
|
||||
[77] phi()
|
||||
to:main::@1
|
||||
|
||||
void gotoxy(byte gotoxy::x , byte gotoxy::y)
|
||||
gotoxy: scope:[gotoxy] from conio_c64_init::@1
|
||||
[78] if(gotoxy::y#2<$19+1) goto gotoxy::@3
|
||||
to:gotoxy::@1
|
||||
gotoxy::@3: scope:[gotoxy] from gotoxy
|
||||
[79] phi()
|
||||
to:gotoxy::@1
|
||||
gotoxy::@1: scope:[gotoxy] from gotoxy gotoxy::@3
|
||||
[80] gotoxy::y#4 = phi( gotoxy::@3/gotoxy::y#2, gotoxy/0 )
|
||||
to:gotoxy::@2
|
||||
gotoxy::@2: scope:[gotoxy] from gotoxy::@1
|
||||
[81] conio_cursor_x = gotoxy::x#2
|
||||
[82] conio_cursor_y = gotoxy::y#4
|
||||
[83] gotoxy::$7 = (word)gotoxy::y#4
|
||||
[84] gotoxy::$8 = gotoxy::$7 << 2
|
||||
[85] gotoxy::$9 = gotoxy::$8 + gotoxy::$7
|
||||
[86] gotoxy::line_offset#0 = gotoxy::$9 << 3
|
||||
[87] gotoxy::$5 = DEFAULT_SCREEN + gotoxy::line_offset#0
|
||||
[88] conio_line_text = gotoxy::$5
|
||||
[89] gotoxy::$6 = COLORRAM + gotoxy::line_offset#0
|
||||
[90] conio_line_color = gotoxy::$6
|
||||
to:gotoxy::@return
|
||||
gotoxy::@return: scope:[gotoxy] from gotoxy::@2
|
||||
[91] return
|
||||
to:@return
|
||||
|
||||
signed word strcmp(const byte* strcmp::str1 , const byte* strcmp::str2)
|
||||
strcmp: scope:[strcmp] from main main::@11 main::@13 main::@15 main::@3 main::@5 main::@7 main::@9
|
||||
[92] strcmp::s2#0 = phi( main/main::str2, main::@11/main::str25, main::@13/main::str26, main::@15/main::str27, main::@3/main::str21, main::@5/main::str11, main::@7/main::str13, main::@9/main::str14 )
|
||||
[92] strcmp::s1#0 = phi( main/main::str1, main::@11/main::str15, main::@13/main::str16, main::@15/main::str16, main::@3/main::str11, main::@5/main::str12, main::@7/main::str13, main::@9/main::str14 )
|
||||
to:strcmp::@1
|
||||
strcmp::@1: scope:[strcmp] from strcmp strcmp::@4
|
||||
[93] strcmp::s2#2 = phi( strcmp/strcmp::s2#0, strcmp::@4/strcmp::s2#1 )
|
||||
[93] strcmp::s1#2 = phi( strcmp/strcmp::s1#0, strcmp::@4/strcmp::s1#1 )
|
||||
[94] if(*strcmp::s1#2==*strcmp::s2#2) goto strcmp::@2
|
||||
to:strcmp::@3
|
||||
strcmp::@3: scope:[strcmp] from strcmp::@1
|
||||
[95] strcmp::$0 = *strcmp::s1#2 - *strcmp::s2#2
|
||||
[96] strcmp::return#0 = (signed word)(signed byte)strcmp::$0
|
||||
to:strcmp::@return
|
||||
strcmp::@return: scope:[strcmp] from strcmp::@2 strcmp::@3
|
||||
[97] strcmp::return#11 = phi( strcmp::@3/strcmp::return#0, strcmp::@2/0 )
|
||||
[98] return
|
||||
to:@return
|
||||
strcmp::@2: scope:[strcmp] from strcmp::@1
|
||||
[99] if(*strcmp::s1#2!=0) goto strcmp::@4
|
||||
to:strcmp::@return
|
||||
strcmp::@4: scope:[strcmp] from strcmp::@2
|
||||
[100] strcmp::s1#1 = ++ strcmp::s1#2
|
||||
[101] strcmp::s2#1 = ++ strcmp::s2#2
|
||||
to:strcmp::@1
|
||||
|
||||
void assert_cmp(signed byte assert_cmp::expect , signed byte assert_cmp::actual , byte* assert_cmp::message)
|
||||
assert_cmp: scope:[assert_cmp] from main::@10 main::@12 main::@14 main::@16 main::@18 main::@2 main::@20 main::@22 main::@24 main::@4 main::@6 main::@8
|
||||
[102] assert_cmp::message#12 = phi( main::@10/main::message4, main::@12/main::message5, main::@14/main::message6, main::@16/main::message7, main::@18/main::message8, main::@2/main::message, main::@20/main::message9, main::@22/main::message10, main::@24/main::message11, main::@4/main::message1, main::@6/main::message2, main::@8/main::message3 )
|
||||
[102] assert_cmp::actual#12 = phi( main::@10/assert_cmp::actual#4, main::@12/assert_cmp::actual#5, main::@14/assert_cmp::actual#6, main::@16/assert_cmp::actual#7, main::@18/assert_cmp::actual#8, main::@2/assert_cmp::actual#0, main::@20/assert_cmp::actual#9, main::@22/assert_cmp::actual#10, main::@24/assert_cmp::actual#11, main::@4/assert_cmp::actual#1, main::@6/assert_cmp::actual#2, main::@8/assert_cmp::actual#3 )
|
||||
[102] assert_cmp::expect#12 = phi( main::@10/0, main::@12/1, main::@14/1, main::@16/1, main::@18/-1, main::@2/-1, main::@20/1, main::@22/0, main::@24/0, main::@4/-1, main::@6/-1, main::@8/0 )
|
||||
[103] if(assert_cmp::expect#12==-1) goto assert_cmp::BREAK1
|
||||
to:assert_cmp::@2
|
||||
assert_cmp::@2: scope:[assert_cmp] from assert_cmp
|
||||
[104] if(assert_cmp::expect#12==0) goto assert_cmp::@4
|
||||
to:assert_cmp::@3
|
||||
assert_cmp::@3: scope:[assert_cmp] from assert_cmp::@2
|
||||
[105] if(assert_cmp::expect#12!=1) goto assert_cmp::@6
|
||||
to:assert_cmp::@5
|
||||
assert_cmp::@5: scope:[assert_cmp] from assert_cmp::@3
|
||||
[106] assert_cmp::$3 = assert_cmp::actual#12 > 0
|
||||
[107] assert_cmp::ok#3 = (byte)assert_cmp::$3
|
||||
to:assert_cmp::@6
|
||||
assert_cmp::@6: scope:[assert_cmp] from assert_cmp::@3 assert_cmp::@4 assert_cmp::@5 assert_cmp::@8
|
||||
[108] assert_cmp::ok#4 = phi( assert_cmp::@3/0, assert_cmp::@4/assert_cmp::ok#2, assert_cmp::@5/assert_cmp::ok#3, assert_cmp::@8/assert_cmp::ok#1 )
|
||||
[109] if(0!=assert_cmp::ok#4) goto assert_cmp::@1
|
||||
to:assert_cmp::@7
|
||||
assert_cmp::@7: scope:[assert_cmp] from assert_cmp::@6
|
||||
[110] phi()
|
||||
[111] call textcolor
|
||||
to:assert_cmp::@12
|
||||
assert_cmp::@12: scope:[assert_cmp] from assert_cmp::@7
|
||||
[112] phi()
|
||||
[113] call cputs
|
||||
to:assert_cmp::@13
|
||||
assert_cmp::@13: scope:[assert_cmp] from assert_cmp::@12
|
||||
[114] printf_schar::value#1 = assert_cmp::expect#12
|
||||
[115] call printf_schar
|
||||
to:assert_cmp::@14
|
||||
assert_cmp::@14: scope:[assert_cmp] from assert_cmp::@13
|
||||
[116] phi()
|
||||
[117] call cputs
|
||||
to:assert_cmp::@15
|
||||
assert_cmp::@15: scope:[assert_cmp] from assert_cmp::@14
|
||||
[118] printf_schar::value#2 = assert_cmp::actual#12
|
||||
[119] call printf_schar
|
||||
to:assert_cmp::@16
|
||||
assert_cmp::@16: scope:[assert_cmp] from assert_cmp::@15
|
||||
[120] phi()
|
||||
[121] call cputs
|
||||
to:assert_cmp::@17
|
||||
assert_cmp::@17: scope:[assert_cmp] from assert_cmp::@16
|
||||
[122] printf_string::str#1 = assert_cmp::message#12
|
||||
[123] call printf_string
|
||||
to:assert_cmp::@18
|
||||
assert_cmp::@18: scope:[assert_cmp] from assert_cmp::@17
|
||||
[124] phi()
|
||||
[125] call cputs
|
||||
to:assert_cmp::@return
|
||||
assert_cmp::@return: scope:[assert_cmp] from assert_cmp::@11 assert_cmp::@18
|
||||
[126] return
|
||||
to:@return
|
||||
assert_cmp::@1: scope:[assert_cmp] from assert_cmp::@6
|
||||
[127] phi()
|
||||
[128] call textcolor
|
||||
to:assert_cmp::@9
|
||||
assert_cmp::@9: scope:[assert_cmp] from assert_cmp::@1
|
||||
[129] phi()
|
||||
[130] call cputs
|
||||
to:assert_cmp::@10
|
||||
assert_cmp::@10: scope:[assert_cmp] from assert_cmp::@9
|
||||
[131] printf_string::str#0 = assert_cmp::message#12
|
||||
[132] call printf_string
|
||||
to:assert_cmp::@11
|
||||
assert_cmp::@11: scope:[assert_cmp] from assert_cmp::@10
|
||||
[133] phi()
|
||||
[134] call cputs
|
||||
to:assert_cmp::@return
|
||||
assert_cmp::@4: scope:[assert_cmp] from assert_cmp::@2
|
||||
[135] assert_cmp::$2 = assert_cmp::actual#12 == 0
|
||||
[136] assert_cmp::ok#2 = (byte)assert_cmp::$2
|
||||
to:assert_cmp::@6
|
||||
assert_cmp::BREAK1: scope:[assert_cmp] from assert_cmp
|
||||
kickasm() {{ .break }}
|
||||
to:assert_cmp::@8
|
||||
assert_cmp::@8: scope:[assert_cmp] from assert_cmp::BREAK1
|
||||
[138] assert_cmp::$1 = assert_cmp::actual#12 < 0
|
||||
[139] assert_cmp::ok#1 = (byte)assert_cmp::$1
|
||||
to:assert_cmp::@6
|
||||
|
||||
signed word strncmp(const byte* strncmp::str1 , const byte* strncmp::str2 , word strncmp::n)
|
||||
strncmp: scope:[strncmp] from main::@17 main::@19 main::@21 main::@23
|
||||
[140] strncmp::n#7 = phi( main::@17/3, main::@19/3, main::@21/2, main::@23/3 )
|
||||
[140] strncmp::s2#0 = phi( main::@17/main::str28, main::@19/main::str29, main::@21/main::str210, main::@23/main::str211 )
|
||||
[140] strncmp::s1#0 = phi( main::@17/main::str18, main::@19/main::str19, main::@21/main::str21, main::@23/main::str111 )
|
||||
to:strncmp::@1
|
||||
strncmp::@1: scope:[strncmp] from strncmp strncmp::@4
|
||||
[141] strncmp::n#5 = phi( strncmp/strncmp::n#7, strncmp::@4/strncmp::n#0 )
|
||||
[141] strncmp::s2#2 = phi( strncmp/strncmp::s2#0, strncmp::@4/strncmp::s2#1 )
|
||||
[141] strncmp::s1#2 = phi( strncmp/strncmp::s1#0, strncmp::@4/strncmp::s1#1 )
|
||||
[142] if(*strncmp::s1#2==*strncmp::s2#2) goto strncmp::@2
|
||||
to:strncmp::@3
|
||||
strncmp::@3: scope:[strncmp] from strncmp::@1
|
||||
[143] strncmp::$0 = *strncmp::s1#2 - *strncmp::s2#2
|
||||
[144] strncmp::return#0 = (signed word)(signed byte)strncmp::$0
|
||||
to:strncmp::@return
|
||||
strncmp::@return: scope:[strncmp] from strncmp::@2 strncmp::@3 strncmp::@5
|
||||
[145] strncmp::return#2 = phi( strncmp::@3/strncmp::return#0, strncmp::@2/0, strncmp::@5/0 )
|
||||
[146] return
|
||||
to:@return
|
||||
strncmp::@2: scope:[strncmp] from strncmp::@1
|
||||
[147] strncmp::n#0 = -- strncmp::n#5
|
||||
[148] if(*strncmp::s1#2==0) goto strncmp::@return
|
||||
to:strncmp::@5
|
||||
strncmp::@5: scope:[strncmp] from strncmp::@2
|
||||
[149] if(strncmp::n#0==0) goto strncmp::@return
|
||||
to:strncmp::@4
|
||||
strncmp::@4: scope:[strncmp] from strncmp::@5
|
||||
[150] strncmp::s1#1 = ++ strncmp::s1#2
|
||||
[151] strncmp::s2#1 = ++ strncmp::s2#2
|
||||
to:strncmp::@1
|
||||
|
||||
byte textcolor(byte textcolor::color)
|
||||
textcolor: scope:[textcolor] from assert_cmp::@1 assert_cmp::@7
|
||||
[152] textcolor::color#2 = phi( assert_cmp::@1/GREEN, assert_cmp::@7/RED )
|
||||
[153] conio_textcolor = textcolor::color#2
|
||||
to:textcolor::@return
|
||||
textcolor::@return: scope:[textcolor] from textcolor
|
||||
[154] return
|
||||
to:@return
|
||||
|
||||
void cputs(const byte* cputs::s)
|
||||
cputs: scope:[cputs] from assert_cmp::@11 assert_cmp::@12 assert_cmp::@14 assert_cmp::@16 assert_cmp::@18 assert_cmp::@9 printf_number_buffer::@2 printf_string::@1
|
||||
[155] cputs::s#10 = phi( assert_cmp::@11/assert_cmp::s1, assert_cmp::@12/assert_cmp::s2, assert_cmp::@14/assert_cmp::s3, assert_cmp::@16/assert_cmp::s4, assert_cmp::@18/assert_cmp::s1, assert_cmp::@9/assert_cmp::s, printf_number_buffer::@2/printf_number_buffer::buffer_digits#0, printf_string::@1/cputs::s#2 )
|
||||
to:cputs::@1
|
||||
cputs::@1: scope:[cputs] from cputs cputs::@2
|
||||
[156] cputs::s#9 = phi( cputs/cputs::s#10, cputs::@2/cputs::s#0 )
|
||||
[157] cputs::c#1 = *cputs::s#9
|
||||
[158] cputs::s#0 = ++ cputs::s#9
|
||||
[159] if(0!=cputs::c#1) goto cputs::@2
|
||||
to:cputs::@return
|
||||
cputs::@return: scope:[cputs] from cputs::@1
|
||||
[160] return
|
||||
to:@return
|
||||
cputs::@2: scope:[cputs] from cputs::@1
|
||||
[161] cputc::c#0 = cputs::c#1
|
||||
[162] call cputc
|
||||
to:cputs::@1
|
||||
|
||||
void printf_schar(signed byte printf_schar::value , byte printf_schar::format_min_length , byte printf_schar::format_justify_left , byte printf_schar::format_sign_always , byte printf_schar::format_zero_padding , byte printf_schar::format_upper_case , byte printf_schar::format_radix)
|
||||
printf_schar: scope:[printf_schar] from assert_cmp::@13 assert_cmp::@15
|
||||
[163] printf_schar::value#3 = phi( assert_cmp::@13/printf_schar::value#1, assert_cmp::@15/printf_schar::value#2 )
|
||||
[164] *((byte*)&printf_buffer) = 0
|
||||
[165] if(printf_schar::value#3<0) goto printf_schar::@1
|
||||
to:printf_schar::@2
|
||||
printf_schar::@1: scope:[printf_schar] from printf_schar
|
||||
[166] printf_schar::value#0 = - printf_schar::value#3
|
||||
[167] *((byte*)&printf_buffer) = '-'
|
||||
to:printf_schar::@2
|
||||
printf_schar::@2: scope:[printf_schar] from printf_schar printf_schar::@1
|
||||
[168] printf_schar::value#5 = phi( printf_schar::@1/printf_schar::value#0, printf_schar/printf_schar::value#3 )
|
||||
[169] uctoa::value#1 = (byte)printf_schar::value#5
|
||||
[170] call uctoa
|
||||
to:printf_schar::@3
|
||||
printf_schar::@3: scope:[printf_schar] from printf_schar::@2
|
||||
[171] printf_number_buffer::buffer_sign#0 = *((byte*)&printf_buffer)
|
||||
[172] call printf_number_buffer
|
||||
to:printf_schar::@return
|
||||
printf_schar::@return: scope:[printf_schar] from printf_schar::@3
|
||||
[173] return
|
||||
to:@return
|
||||
|
||||
void printf_string(byte* printf_string::str , byte printf_string::format_min_length , byte printf_string::format_justify_left)
|
||||
printf_string: scope:[printf_string] from assert_cmp::@10 assert_cmp::@17
|
||||
[174] printf_string::str#2 = phi( assert_cmp::@10/printf_string::str#0, assert_cmp::@17/printf_string::str#1 )
|
||||
to:printf_string::@1
|
||||
printf_string::@1: scope:[printf_string] from printf_string
|
||||
[175] cputs::s#2 = printf_string::str#2
|
||||
[176] call cputs
|
||||
to:printf_string::@return
|
||||
printf_string::@return: scope:[printf_string] from printf_string::@1
|
||||
[177] return
|
||||
to:@return
|
||||
|
||||
void cputc(byte cputc::c)
|
||||
cputc: scope:[cputc] from cputs::@2 printf_number_buffer::@3
|
||||
[178] cputc::c#3 = phi( cputs::@2/cputc::c#0, printf_number_buffer::@3/cputc::c#2 )
|
||||
[179] if(cputc::c#3=='
|
||||
') goto cputc::@1
|
||||
to:cputc::@2
|
||||
cputc::@2: scope:[cputc] from cputc
|
||||
[180] conio_line_text[conio_cursor_x] = cputc::c#3
|
||||
[181] conio_line_color[conio_cursor_x] = conio_textcolor
|
||||
[182] conio_cursor_x = ++ conio_cursor_x
|
||||
[183] if(conio_cursor_x!=$28) goto cputc::@return
|
||||
to:cputc::@3
|
||||
cputc::@3: scope:[cputc] from cputc::@2
|
||||
[184] phi()
|
||||
[185] call cputln
|
||||
to:cputc::@return
|
||||
cputc::@return: scope:[cputc] from cputc::@1 cputc::@2 cputc::@3
|
||||
[186] return
|
||||
to:@return
|
||||
cputc::@1: scope:[cputc] from cputc
|
||||
[187] phi()
|
||||
[188] call cputln
|
||||
to:cputc::@return
|
||||
|
||||
void uctoa(byte uctoa::value , byte* uctoa::buffer , byte uctoa::radix)
|
||||
uctoa: scope:[uctoa] from printf_schar::@2
|
||||
[189] phi()
|
||||
to:uctoa::@1
|
||||
uctoa::@1: scope:[uctoa] from uctoa uctoa::@4
|
||||
[190] uctoa::buffer#11 = phi( uctoa::@4/uctoa::buffer#14, uctoa/(byte*)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS )
|
||||
[190] uctoa::started#2 = phi( uctoa::@4/uctoa::started#4, uctoa/0 )
|
||||
[190] uctoa::value#2 = phi( uctoa::@4/uctoa::value#6, uctoa/uctoa::value#1 )
|
||||
[190] uctoa::digit#2 = phi( uctoa::@4/uctoa::digit#1, uctoa/0 )
|
||||
[191] if(uctoa::digit#2<3-1) goto uctoa::@2
|
||||
to:uctoa::@3
|
||||
uctoa::@3: scope:[uctoa] from uctoa::@1
|
||||
[192] *uctoa::buffer#11 = DIGITS[uctoa::value#2]
|
||||
[193] uctoa::buffer#3 = ++ uctoa::buffer#11
|
||||
[194] *uctoa::buffer#3 = 0
|
||||
to:uctoa::@return
|
||||
uctoa::@return: scope:[uctoa] from uctoa::@3
|
||||
[195] return
|
||||
to:@return
|
||||
uctoa::@2: scope:[uctoa] from uctoa::@1
|
||||
[196] uctoa::digit_value#0 = RADIX_DECIMAL_VALUES_CHAR[uctoa::digit#2]
|
||||
[197] if(0!=uctoa::started#2) goto uctoa::@5
|
||||
to:uctoa::@7
|
||||
uctoa::@7: scope:[uctoa] from uctoa::@2
|
||||
[198] if(uctoa::value#2>=uctoa::digit_value#0) goto uctoa::@5
|
||||
to:uctoa::@4
|
||||
uctoa::@4: scope:[uctoa] from uctoa::@6 uctoa::@7
|
||||
[199] uctoa::buffer#14 = phi( uctoa::@7/uctoa::buffer#11, uctoa::@6/uctoa::buffer#4 )
|
||||
[199] uctoa::started#4 = phi( uctoa::@7/uctoa::started#2, uctoa::@6/1 )
|
||||
[199] uctoa::value#6 = phi( uctoa::@7/uctoa::value#2, uctoa::@6/uctoa::value#0 )
|
||||
[200] uctoa::digit#1 = ++ uctoa::digit#2
|
||||
to:uctoa::@1
|
||||
uctoa::@5: scope:[uctoa] from uctoa::@2 uctoa::@7
|
||||
[201] uctoa_append::buffer#0 = uctoa::buffer#11
|
||||
[202] uctoa_append::value#0 = uctoa::value#2
|
||||
[203] uctoa_append::sub#0 = uctoa::digit_value#0
|
||||
[204] call uctoa_append
|
||||
[205] uctoa_append::return#0 = uctoa_append::value#2
|
||||
to:uctoa::@6
|
||||
uctoa::@6: scope:[uctoa] from uctoa::@5
|
||||
[206] uctoa::value#0 = uctoa_append::return#0
|
||||
[207] uctoa::buffer#4 = ++ uctoa::buffer#11
|
||||
to:uctoa::@4
|
||||
|
||||
void printf_number_buffer(byte printf_number_buffer::buffer_sign , byte* printf_number_buffer::buffer_digits , byte printf_number_buffer::format_min_length , byte printf_number_buffer::format_justify_left , byte printf_number_buffer::format_sign_always , byte printf_number_buffer::format_zero_padding , byte printf_number_buffer::format_upper_case , byte printf_number_buffer::format_radix)
|
||||
printf_number_buffer: scope:[printf_number_buffer] from printf_schar::@3
|
||||
[208] phi()
|
||||
to:printf_number_buffer::@1
|
||||
printf_number_buffer::@1: scope:[printf_number_buffer] from printf_number_buffer
|
||||
[209] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2
|
||||
to:printf_number_buffer::@3
|
||||
printf_number_buffer::@3: scope:[printf_number_buffer] from printf_number_buffer::@1
|
||||
[210] cputc::c#2 = printf_number_buffer::buffer_sign#0
|
||||
[211] call cputc
|
||||
to:printf_number_buffer::@2
|
||||
printf_number_buffer::@2: scope:[printf_number_buffer] from printf_number_buffer::@1 printf_number_buffer::@3
|
||||
[212] phi()
|
||||
[213] call cputs
|
||||
to:printf_number_buffer::@return
|
||||
printf_number_buffer::@return: scope:[printf_number_buffer] from printf_number_buffer::@2
|
||||
[214] return
|
||||
to:@return
|
||||
|
||||
void cputln()
|
||||
cputln: scope:[cputln] from cputc::@1 cputc::@3
|
||||
[215] conio_line_text = conio_line_text + $28
|
||||
[216] conio_line_color = conio_line_color + $28
|
||||
[217] conio_cursor_x = 0
|
||||
[218] conio_cursor_y = ++ conio_cursor_y
|
||||
[219] call cscroll
|
||||
to:cputln::@return
|
||||
cputln::@return: scope:[cputln] from cputln
|
||||
[220] return
|
||||
to:@return
|
||||
|
||||
byte uctoa_append(byte* uctoa_append::buffer , byte uctoa_append::value , byte uctoa_append::sub)
|
||||
uctoa_append: scope:[uctoa_append] from uctoa::@5
|
||||
[221] phi()
|
||||
to:uctoa_append::@1
|
||||
uctoa_append::@1: scope:[uctoa_append] from uctoa_append uctoa_append::@2
|
||||
[222] uctoa_append::digit#2 = phi( uctoa_append/0, uctoa_append::@2/uctoa_append::digit#1 )
|
||||
[222] uctoa_append::value#2 = phi( uctoa_append/uctoa_append::value#0, uctoa_append::@2/uctoa_append::value#1 )
|
||||
[223] if(uctoa_append::value#2>=uctoa_append::sub#0) goto uctoa_append::@2
|
||||
to:uctoa_append::@3
|
||||
uctoa_append::@3: scope:[uctoa_append] from uctoa_append::@1
|
||||
[224] *uctoa_append::buffer#0 = DIGITS[uctoa_append::digit#2]
|
||||
to:uctoa_append::@return
|
||||
uctoa_append::@return: scope:[uctoa_append] from uctoa_append::@3
|
||||
[225] return
|
||||
to:@return
|
||||
uctoa_append::@2: scope:[uctoa_append] from uctoa_append::@1
|
||||
[226] uctoa_append::digit#1 = ++ uctoa_append::digit#2
|
||||
[227] uctoa_append::value#1 = uctoa_append::value#2 - uctoa_append::sub#0
|
||||
to:uctoa_append::@1
|
||||
|
||||
void cscroll()
|
||||
cscroll: scope:[cscroll] from cputln
|
||||
[228] if(conio_cursor_y!=$19) goto cscroll::@return
|
||||
to:cscroll::@1
|
||||
cscroll::@1: scope:[cscroll] from cscroll
|
||||
[229] phi()
|
||||
[230] call memcpy
|
||||
to:cscroll::@2
|
||||
cscroll::@2: scope:[cscroll] from cscroll::@1
|
||||
[231] phi()
|
||||
[232] call memcpy
|
||||
to:cscroll::@3
|
||||
cscroll::@3: scope:[cscroll] from cscroll::@2
|
||||
[233] phi()
|
||||
[234] call memset
|
||||
to:cscroll::@4
|
||||
cscroll::@4: scope:[cscroll] from cscroll::@3
|
||||
[235] memset::c#1 = conio_textcolor
|
||||
[236] call memset
|
||||
to:cscroll::@5
|
||||
cscroll::@5: scope:[cscroll] from cscroll::@4
|
||||
[237] conio_line_text = conio_line_text - $28
|
||||
[238] conio_line_color = conio_line_color - $28
|
||||
[239] conio_cursor_y = -- conio_cursor_y
|
||||
to:cscroll::@return
|
||||
cscroll::@return: scope:[cscroll] from cscroll cscroll::@5
|
||||
[240] return
|
||||
to:@return
|
||||
|
||||
void* memcpy(void* memcpy::destination , void* memcpy::source , word memcpy::num)
|
||||
memcpy: scope:[memcpy] from cscroll::@1 cscroll::@2
|
||||
[241] memcpy::destination#2 = phi( cscroll::@1/(void*)DEFAULT_SCREEN, cscroll::@2/(void*)COLORRAM )
|
||||
[241] memcpy::source#2 = phi( cscroll::@1/(void*)DEFAULT_SCREEN+$28, cscroll::@2/(void*)COLORRAM+$28 )
|
||||
[242] memcpy::src_end#0 = (byte*)memcpy::source#2 + (word)$19*$28-$28
|
||||
[243] memcpy::src#4 = (byte*)memcpy::source#2
|
||||
[244] memcpy::dst#4 = (byte*)memcpy::destination#2
|
||||
to:memcpy::@1
|
||||
memcpy::@1: scope:[memcpy] from memcpy memcpy::@2
|
||||
[245] memcpy::dst#2 = phi( memcpy/memcpy::dst#4, memcpy::@2/memcpy::dst#1 )
|
||||
[245] memcpy::src#2 = phi( memcpy/memcpy::src#4, memcpy::@2/memcpy::src#1 )
|
||||
[246] if(memcpy::src#2!=memcpy::src_end#0) goto memcpy::@2
|
||||
to:memcpy::@return
|
||||
memcpy::@return: scope:[memcpy] from memcpy::@1
|
||||
[247] return
|
||||
to:@return
|
||||
memcpy::@2: scope:[memcpy] from memcpy::@1
|
||||
[248] *memcpy::dst#2 = *memcpy::src#2
|
||||
[249] memcpy::dst#1 = ++ memcpy::dst#2
|
||||
[250] memcpy::src#1 = ++ memcpy::src#2
|
||||
to:memcpy::@1
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from cscroll::@3 cscroll::@4
|
||||
[251] memset::c#4 = phi( cscroll::@3/' ', cscroll::@4/memset::c#1 )
|
||||
[251] memset::str#3 = phi( cscroll::@3/(void*)DEFAULT_SCREEN+(word)$19*$28-$28, cscroll::@4/(void*)COLORRAM+(word)$19*$28-$28 )
|
||||
to:memset::@1
|
||||
memset::@1: scope:[memset] from memset
|
||||
[252] memset::end#0 = (byte*)memset::str#3 + $28
|
||||
[253] memset::dst#4 = (byte*)memset::str#3
|
||||
to:memset::@2
|
||||
memset::@2: scope:[memset] from memset::@1 memset::@3
|
||||
[254] memset::dst#2 = phi( memset::@1/memset::dst#4, memset::@3/memset::dst#1 )
|
||||
[255] if(memset::dst#2!=memset::end#0) goto memset::@3
|
||||
to:memset::@return
|
||||
memset::@return: scope:[memset] from memset::@2
|
||||
[256] return
|
||||
to:@return
|
||||
memset::@3: scope:[memset] from memset::@2
|
||||
[257] *memset::dst#2 = memset::c#4
|
||||
[258] memset::dst#1 = ++ memset::dst#2
|
||||
to:memset::@2
|
9543
src/test/ref/strcmp-0.log
Normal file
9543
src/test/ref/strcmp-0.log
Normal file
File diff suppressed because one or more lines are too long
314
src/test/ref/strcmp-0.sym
Normal file
314
src/test/ref/strcmp-0.sym
Normal file
@ -0,0 +1,314 @@
|
||||
constant byte* const COLORRAM = (byte*) 55296
|
||||
constant byte* const DEFAULT_SCREEN = (byte*) 1024
|
||||
constant byte* DIGITS[] = "0123456789abcdef"z
|
||||
constant const byte GREEN = 5
|
||||
constant const byte LIGHT_BLUE = $e
|
||||
constant byte OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS = 1
|
||||
constant byte RADIX::BINARY = 2
|
||||
constant byte RADIX::DECIMAL = $a
|
||||
constant byte RADIX::HEXADECIMAL = $10
|
||||
constant byte RADIX::OCTAL = 8
|
||||
constant byte* RADIX_DECIMAL_VALUES_CHAR[] = { $64, $a }
|
||||
constant const byte RED = 2
|
||||
constant byte SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER = $c
|
||||
void __start()
|
||||
void assert_cmp(signed byte assert_cmp::expect , signed byte assert_cmp::actual , byte* assert_cmp::message)
|
||||
bool~ assert_cmp::$1 reg byte a 101.0
|
||||
bool~ assert_cmp::$2 reg byte a 101.0
|
||||
bool~ assert_cmp::$3 reg byte a 101.0
|
||||
signed byte assert_cmp::actual
|
||||
signed byte assert_cmp::actual#0 actual zp[1]:3 22.0
|
||||
signed byte assert_cmp::actual#1 actual zp[1]:3 22.0
|
||||
signed byte assert_cmp::actual#10 actual zp[1]:3 22.0
|
||||
signed byte assert_cmp::actual#11 actual zp[1]:3 22.0
|
||||
signed byte assert_cmp::actual#12 actual zp[1]:3 25.523809523809526
|
||||
signed byte assert_cmp::actual#2 actual zp[1]:3 22.0
|
||||
signed byte assert_cmp::actual#3 actual zp[1]:3 22.0
|
||||
signed byte assert_cmp::actual#4 actual zp[1]:3 22.0
|
||||
signed byte assert_cmp::actual#5 actual zp[1]:3 22.0
|
||||
signed byte assert_cmp::actual#6 actual zp[1]:3 22.0
|
||||
signed byte assert_cmp::actual#7 actual zp[1]:3 22.0
|
||||
signed byte assert_cmp::actual#8 actual zp[1]:3 22.0
|
||||
signed byte assert_cmp::actual#9 actual zp[1]:3 22.0
|
||||
signed byte assert_cmp::expect
|
||||
signed byte assert_cmp::expect#12 expect zp[1]:2 23.764705882352942
|
||||
byte* assert_cmp::message
|
||||
byte* assert_cmp::message#12 message zp[2]:4 6.9655172413793105
|
||||
byte assert_cmp::ok
|
||||
byte assert_cmp::ok#1 reg byte a 202.0
|
||||
byte assert_cmp::ok#2 reg byte a 202.0
|
||||
byte assert_cmp::ok#3 reg byte a 202.0
|
||||
byte assert_cmp::ok#4 reg byte a 404.0
|
||||
constant byte* assert_cmp::s[5] = "ok! "
|
||||
constant byte* assert_cmp::s1[2] = "
|
||||
"
|
||||
constant byte* assert_cmp::s2[$19] = "Assert failed. expected:"
|
||||
constant byte* assert_cmp::s3[9] = " actual:"
|
||||
constant byte* assert_cmp::s4[3] = ". "
|
||||
void conio_c64_init()
|
||||
constant byte* const conio_c64_init::BASIC_CURSOR_LINE = (byte*) 214
|
||||
byte conio_c64_init::line
|
||||
byte conio_c64_init::line#0 reg byte x 11.0
|
||||
byte conio_c64_init::line#2 reg byte x 22.0
|
||||
byte conio_cursor_x loadstore zp[1]:12 967742.6387096774
|
||||
byte conio_cursor_y loadstore zp[1]:13 1.8713450923976608E7
|
||||
byte* conio_line_color loadstore zp[2]:16 1.3558282871165644E7
|
||||
byte* conio_line_text loadstore zp[2]:14 1.3393940048484847E7
|
||||
byte conio_textcolor loadstore zp[1]:18 1.2317085426829267E7
|
||||
void cputc(byte cputc::c)
|
||||
byte cputc::c
|
||||
byte cputc::c#0 reg byte a 2000002.0
|
||||
byte cputc::c#2 reg byte a 20002.0
|
||||
byte cputc::c#3 reg byte a 1.0505002E7
|
||||
void cputln()
|
||||
void cputs(const byte* cputs::s)
|
||||
byte cputs::c
|
||||
byte cputs::c#1 reg byte a 1000001.0
|
||||
const byte* cputs::s
|
||||
const byte* cputs::s#0 s zp[2]:6 500000.5
|
||||
const byte* cputs::s#10 s zp[2]:6 101002.0
|
||||
const byte* cputs::s#2 s zp[2]:6 2002.0
|
||||
const byte* cputs::s#9 s zp[2]:6 1550002.0
|
||||
void cscroll()
|
||||
void gotoxy(byte gotoxy::x , byte gotoxy::y)
|
||||
byte*~ gotoxy::$5 zp[2]:23 202.0
|
||||
byte*~ gotoxy::$6 zp[2]:19 202.0
|
||||
word~ gotoxy::$7 zp[2]:19 151.5
|
||||
word~ gotoxy::$8 zp[2]:21 202.0
|
||||
word~ gotoxy::$9 zp[2]:19 202.0
|
||||
word gotoxy::line_offset
|
||||
word gotoxy::line_offset#0 line_offset zp[2]:19 101.0
|
||||
byte gotoxy::x
|
||||
constant byte gotoxy::x#2 x = 0
|
||||
byte gotoxy::y
|
||||
byte gotoxy::y#2 reg byte x 71.0
|
||||
byte gotoxy::y#4 reg byte x 67.33333333333333
|
||||
void main()
|
||||
constant byte* main::message[4] = "a<b"
|
||||
constant byte* main::message1[8] = "aaa<aab"
|
||||
constant byte* main::message10[$c] = "aab=aac (2)"
|
||||
constant byte* main::message11[$e] = "qwex=qwea (3)"
|
||||
constant byte* main::message2[7] = "aa<aaa"
|
||||
constant byte* main::message3[4] = "x=x"
|
||||
constant byte* main::message4[$a] = "qwez=qwez"
|
||||
constant byte* main::message5[4] = "q>k"
|
||||
constant byte* main::message6[$a] = "kkkq>kkkp"
|
||||
constant byte* main::message7[9] = "kkkq>kkk"
|
||||
constant byte* main::message8[$e] = "aaax<aabx (3)"
|
||||
constant byte* main::message9[$c] = "qwe>qee (2)"
|
||||
constant byte* main::str1[2] = "a"
|
||||
constant byte* main::str11[4] = "aaa"
|
||||
constant byte* main::str111[5] = "qwex"
|
||||
constant byte* main::str12[3] = "aa"
|
||||
constant byte* main::str13[2] = "x"
|
||||
constant byte* main::str14[5] = "qwez"
|
||||
constant byte* main::str15[2] = "q"
|
||||
constant byte* main::str16[5] = "kkkq"
|
||||
constant byte* main::str18[5] = "aaax"
|
||||
constant byte* main::str19[4] = "qwe"
|
||||
constant byte* main::str2[2] = "b"
|
||||
constant byte* main::str21[4] = "aab"
|
||||
constant byte* main::str210[4] = "aac"
|
||||
constant byte* main::str211[5] = "qwea"
|
||||
constant byte* main::str25[2] = "k"
|
||||
constant byte* main::str26[5] = "kkkp"
|
||||
constant byte* main::str27[4] = "kkk"
|
||||
constant byte* main::str28[5] = "aabx"
|
||||
constant byte* main::str29[4] = "qee"
|
||||
void* memcpy(void* memcpy::destination , void* memcpy::source , word memcpy::num)
|
||||
void* memcpy::destination
|
||||
void* memcpy::destination#2 destination zp[2]:28
|
||||
byte* memcpy::dst
|
||||
byte* memcpy::dst#1 dst zp[2]:28 1.000000000001E12
|
||||
byte* memcpy::dst#2 dst zp[2]:28 1.0033333333346667E12
|
||||
byte* memcpy::dst#4 dst zp[2]:28 2.0000000002E10
|
||||
word memcpy::num
|
||||
void* memcpy::return
|
||||
void* memcpy::source
|
||||
void* memcpy::source#2 source zp[2]:10
|
||||
byte* memcpy::src
|
||||
byte* memcpy::src#1 src zp[2]:10 2.000000000002E12
|
||||
byte* memcpy::src#2 src zp[2]:10 1.00250000000125E12
|
||||
byte* memcpy::src#4 src zp[2]:10 1.0000000001E10
|
||||
byte* memcpy::src_end
|
||||
byte* memcpy::src_end#0 src_end zp[2]:26 1.2625000000025E11
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
byte memset::c
|
||||
byte memset::c#1 reg byte x 2.000000002E9
|
||||
byte memset::c#4 reg byte x 1.430000000002857E11
|
||||
byte* memset::dst
|
||||
byte* memset::dst#1 dst zp[2]:10 2.000000000002E12
|
||||
byte* memset::dst#2 dst zp[2]:10 1.3366666666683335E12
|
||||
byte* memset::dst#4 dst zp[2]:10 2.0000000002E10
|
||||
byte* memset::end
|
||||
byte* memset::end#0 end zp[2]:28 1.683333333336667E11
|
||||
word memset::num
|
||||
void* memset::return
|
||||
void* memset::str
|
||||
void* memset::str#3 str zp[2]:10
|
||||
struct printf_buffer_number printf_buffer loadstore mem[12] = {}
|
||||
void printf_number_buffer(byte printf_number_buffer::buffer_sign , byte* printf_number_buffer::buffer_digits , byte printf_number_buffer::format_min_length , byte printf_number_buffer::format_justify_left , byte printf_number_buffer::format_sign_always , byte printf_number_buffer::format_zero_padding , byte printf_number_buffer::format_upper_case , byte printf_number_buffer::format_radix)
|
||||
struct printf_buffer_number printf_number_buffer::buffer
|
||||
byte* printf_number_buffer::buffer_digits
|
||||
constant byte* printf_number_buffer::buffer_digits#0 buffer_digits = (byte*)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
|
||||
byte printf_number_buffer::buffer_sign
|
||||
byte printf_number_buffer::buffer_sign#0 reg byte a 7001.0
|
||||
struct printf_format_number printf_number_buffer::format
|
||||
byte printf_number_buffer::format_justify_left
|
||||
byte printf_number_buffer::format_min_length
|
||||
byte printf_number_buffer::format_radix
|
||||
byte printf_number_buffer::format_sign_always
|
||||
byte printf_number_buffer::format_upper_case
|
||||
byte printf_number_buffer::format_zero_padding
|
||||
signed byte printf_number_buffer::len
|
||||
signed byte printf_number_buffer::padding
|
||||
void printf_schar(signed byte printf_schar::value , byte printf_schar::format_min_length , byte printf_schar::format_justify_left , byte printf_schar::format_sign_always , byte printf_schar::format_zero_padding , byte printf_schar::format_upper_case , byte printf_schar::format_radix)
|
||||
struct printf_format_number printf_schar::format
|
||||
byte printf_schar::format_justify_left
|
||||
byte printf_schar::format_min_length
|
||||
byte printf_schar::format_radix
|
||||
byte printf_schar::format_sign_always
|
||||
byte printf_schar::format_upper_case
|
||||
byte printf_schar::format_zero_padding
|
||||
byte printf_schar::uvalue
|
||||
signed byte printf_schar::value
|
||||
signed byte printf_schar::value#0 reg byte x 1001.0
|
||||
signed byte printf_schar::value#1 reg byte x 202.0
|
||||
signed byte printf_schar::value#2 reg byte x 202.0
|
||||
signed byte printf_schar::value#3 reg byte x 1068.3333333333335
|
||||
signed byte printf_schar::value#5 reg byte x 2002.0
|
||||
void printf_string(byte* printf_string::str , byte printf_string::format_min_length , byte printf_string::format_justify_left)
|
||||
struct printf_format_string printf_string::format
|
||||
byte printf_string::format_justify_left
|
||||
byte printf_string::format_min_length
|
||||
signed byte printf_string::len
|
||||
signed byte printf_string::padding
|
||||
byte* printf_string::str
|
||||
byte* printf_string::str#0 str zp[2]:4 202.0
|
||||
byte* printf_string::str#1 str zp[2]:4 202.0
|
||||
byte* printf_string::str#2 str zp[2]:4 1203.0
|
||||
signed word strcmp(const byte* strcmp::str1 , const byte* strcmp::str2)
|
||||
byte~ strcmp::$0 reg byte a 101.0
|
||||
signed word strcmp::return
|
||||
signed word strcmp::return#0 return zp[2]:26 202.0
|
||||
signed word strcmp::return#10 return zp[2]:26 22.0
|
||||
signed word strcmp::return#11 return zp[2]:26 18.9
|
||||
signed word strcmp::return#12 return zp[2]:26 22.0
|
||||
signed word strcmp::return#13 return zp[2]:26 22.0
|
||||
signed word strcmp::return#14 return zp[2]:26 22.0
|
||||
signed word strcmp::return#15 return zp[2]:26 22.0
|
||||
signed word strcmp::return#16 return zp[2]:26 22.0
|
||||
signed word strcmp::return#17 return zp[2]:26 22.0
|
||||
signed word strcmp::return#18 return zp[2]:26 22.0
|
||||
byte* strcmp::s1
|
||||
byte* strcmp::s1#0 s1 zp[2]:4 101.0
|
||||
byte* strcmp::s1#1 s1 zp[2]:4 1001.0
|
||||
byte* strcmp::s1#2 s1 zp[2]:4 1402.0
|
||||
byte* strcmp::s2
|
||||
byte* strcmp::s2#0 s2 zp[2]:10 101.0
|
||||
byte* strcmp::s2#1 s2 zp[2]:10 2002.0
|
||||
byte* strcmp::s2#2 s2 zp[2]:10 801.25
|
||||
const byte* strcmp::str1
|
||||
const byte* strcmp::str2
|
||||
signed word strncmp(const byte* strncmp::str1 , const byte* strncmp::str2 , word strncmp::n)
|
||||
byte~ strncmp::$0 reg byte a 101.0
|
||||
word strncmp::n
|
||||
word strncmp::n#0 n zp[2]:6 600.5999999999999
|
||||
word strncmp::n#5 n zp[2]:6 1051.5
|
||||
word strncmp::n#7 n zp[2]:6 101.0
|
||||
signed word strncmp::return
|
||||
signed word strncmp::return#0 return zp[2]:28 202.0
|
||||
signed word strncmp::return#10 return zp[2]:28 22.0
|
||||
signed word strncmp::return#11 return zp[2]:28 22.0
|
||||
signed word strncmp::return#2 return zp[2]:28 24.166666666666664
|
||||
signed word strncmp::return#3 return zp[2]:28 22.0
|
||||
signed word strncmp::return#4 return zp[2]:28 22.0
|
||||
byte* strncmp::s1
|
||||
byte* strncmp::s1#0 s1 zp[2]:10 101.0
|
||||
byte* strncmp::s1#1 s1 zp[2]:10 1001.0
|
||||
byte* strncmp::s1#2 s1 zp[2]:10 841.2
|
||||
byte* strncmp::s2
|
||||
byte* strncmp::s2#0 s2 zp[2]:26 101.0
|
||||
byte* strncmp::s2#1 s2 zp[2]:26 2002.0
|
||||
byte* strncmp::s2#2 s2 zp[2]:26 534.1666666666666
|
||||
const byte* strncmp::str1
|
||||
const byte* strncmp::str2
|
||||
byte textcolor(byte textcolor::color)
|
||||
byte textcolor::color
|
||||
byte textcolor::color#2 reg byte a 1001.0
|
||||
byte textcolor::old
|
||||
byte textcolor::return
|
||||
void uctoa(byte uctoa::value , byte* uctoa::buffer , byte uctoa::radix)
|
||||
byte* uctoa::buffer
|
||||
byte* uctoa::buffer#11 buffer zp[2]:28 35000.49999999999
|
||||
byte* uctoa::buffer#14 buffer zp[2]:28 150001.5
|
||||
byte* uctoa::buffer#3 buffer zp[2]:28 20002.0
|
||||
byte* uctoa::buffer#4 buffer zp[2]:28 200002.0
|
||||
byte uctoa::digit
|
||||
byte uctoa::digit#1 digit zp[1]:8 200002.0
|
||||
byte uctoa::digit#2 digit zp[1]:8 30769.53846153846
|
||||
byte uctoa::digit_value
|
||||
byte uctoa::digit_value#0 digit_value zp[1]:25 60000.600000000006
|
||||
byte* uctoa::digit_values
|
||||
byte uctoa::max_digits
|
||||
byte uctoa::radix
|
||||
byte uctoa::started
|
||||
byte uctoa::started#2 started zp[1]:9 60000.600000000006
|
||||
byte uctoa::started#4 started zp[1]:9 100001.0
|
||||
byte uctoa::value
|
||||
byte uctoa::value#0 reg byte x 100001.0
|
||||
byte uctoa::value#1 reg byte x 5501.0
|
||||
byte uctoa::value#2 reg byte x 70000.99999999999
|
||||
byte uctoa::value#6 reg byte x 150001.5
|
||||
byte uctoa_append(byte* uctoa_append::buffer , byte uctoa_append::value , byte uctoa_append::sub)
|
||||
byte* uctoa_append::buffer
|
||||
byte* uctoa_append::buffer#0 buffer zp[2]:28 137500.25
|
||||
byte uctoa_append::digit
|
||||
byte uctoa_append::digit#1 reg byte y 1.00000001E8
|
||||
byte uctoa_append::digit#2 reg byte y 1.005000015E8
|
||||
byte uctoa_append::return
|
||||
byte uctoa_append::return#0 reg byte x 200002.0
|
||||
byte uctoa_append::sub
|
||||
byte uctoa_append::sub#0 sub zp[1]:25 3.33500005E7
|
||||
byte uctoa_append::value
|
||||
byte uctoa_append::value#0 reg byte x 366667.3333333334
|
||||
byte uctoa_append::value#1 reg byte x 2.00000002E8
|
||||
byte uctoa_append::value#2 reg byte x 5.018333416666667E7
|
||||
|
||||
reg byte x [ conio_c64_init::line#2 conio_c64_init::line#0 ]
|
||||
reg byte x [ gotoxy::y#4 gotoxy::y#2 ]
|
||||
zp[1]:2 [ assert_cmp::expect#12 ]
|
||||
zp[1]:3 [ assert_cmp::actual#12 assert_cmp::actual#4 assert_cmp::actual#5 assert_cmp::actual#6 assert_cmp::actual#7 assert_cmp::actual#8 assert_cmp::actual#0 assert_cmp::actual#9 assert_cmp::actual#10 assert_cmp::actual#11 assert_cmp::actual#1 assert_cmp::actual#2 assert_cmp::actual#3 ]
|
||||
zp[2]:4 [ assert_cmp::message#12 printf_string::str#2 printf_string::str#0 printf_string::str#1 strcmp::s1#2 strcmp::s1#0 strcmp::s1#1 ]
|
||||
reg byte a [ assert_cmp::ok#4 assert_cmp::ok#2 assert_cmp::ok#3 assert_cmp::ok#1 ]
|
||||
reg byte a [ textcolor::color#2 ]
|
||||
zp[2]:6 [ cputs::s#9 cputs::s#10 cputs::s#2 cputs::s#0 strncmp::n#5 strncmp::n#7 strncmp::n#0 ]
|
||||
reg byte x [ printf_schar::value#5 printf_schar::value#0 printf_schar::value#3 printf_schar::value#1 printf_schar::value#2 ]
|
||||
reg byte a [ cputc::c#3 cputc::c#0 cputc::c#2 ]
|
||||
zp[1]:8 [ uctoa::digit#2 uctoa::digit#1 ]
|
||||
reg byte x [ uctoa::value#2 uctoa::value#6 uctoa::value#1 uctoa::value#0 ]
|
||||
zp[1]:9 [ uctoa::started#2 uctoa::started#4 ]
|
||||
reg byte x [ uctoa_append::value#2 uctoa_append::value#0 uctoa_append::value#1 ]
|
||||
reg byte y [ uctoa_append::digit#2 uctoa_append::digit#1 ]
|
||||
zp[2]:10 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 memcpy::source#2 memcpy::src#2 memcpy::src#4 memcpy::src#1 strncmp::s1#2 strncmp::s1#0 strncmp::s1#1 strcmp::s2#2 strcmp::s2#0 strcmp::s2#1 ]
|
||||
reg byte x [ memset::c#4 memset::c#1 ]
|
||||
zp[1]:12 [ conio_cursor_x ]
|
||||
zp[1]:13 [ conio_cursor_y ]
|
||||
zp[2]:14 [ conio_line_text ]
|
||||
zp[2]:16 [ conio_line_color ]
|
||||
zp[1]:18 [ conio_textcolor ]
|
||||
zp[2]:19 [ gotoxy::$7 gotoxy::$9 gotoxy::line_offset#0 gotoxy::$6 ]
|
||||
zp[2]:21 [ gotoxy::$8 ]
|
||||
zp[2]:23 [ gotoxy::$5 ]
|
||||
reg byte a [ strcmp::$0 ]
|
||||
reg byte a [ assert_cmp::$3 ]
|
||||
reg byte a [ assert_cmp::$2 ]
|
||||
reg byte a [ assert_cmp::$1 ]
|
||||
reg byte a [ strncmp::$0 ]
|
||||
reg byte a [ cputs::c#1 ]
|
||||
reg byte a [ printf_number_buffer::buffer_sign#0 ]
|
||||
zp[1]:25 [ uctoa::digit_value#0 uctoa_append::sub#0 ]
|
||||
reg byte x [ uctoa_append::return#0 ]
|
||||
zp[2]:26 [ memcpy::src_end#0 strncmp::s2#2 strncmp::s2#0 strncmp::s2#1 strcmp::return#11 strcmp::return#0 strcmp::return#12 strcmp::return#13 strcmp::return#14 strcmp::return#15 strcmp::return#16 strcmp::return#17 strcmp::return#18 strcmp::return#10 ]
|
||||
zp[2]:28 [ memset::end#0 memcpy::destination#2 memcpy::dst#2 memcpy::dst#4 memcpy::dst#1 uctoa::buffer#11 uctoa::buffer#14 uctoa::buffer#4 uctoa::buffer#3 uctoa_append::buffer#0 strncmp::return#2 strncmp::return#0 strncmp::return#3 strncmp::return#4 strncmp::return#10 strncmp::return#11 ]
|
||||
mem[12] [ printf_buffer ]
|
Loading…
Reference in New Issue
Block a user