mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-08-08 13:25:12 +00:00
Updated helloworld.c to use <stdio.h> and printf()
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
#include <print.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
print_str("hello world!");
|
printf("hello world!\n");
|
||||||
print_ln();
|
|
||||||
}
|
}
|
||||||
|
@@ -1,88 +1,225 @@
|
|||||||
.pc = $801 "Basic"
|
.pc = $801 "Basic"
|
||||||
:BasicUpstart(main)
|
:BasicUpstart(__bbegin)
|
||||||
.pc = $80d "Program"
|
.pc = $80d "Program"
|
||||||
.label print_line_cursor = 2
|
.label printf_cursor_x = 8
|
||||||
.label print_char_cursor = 6
|
.label printf_cursor_y = 9
|
||||||
|
.label printf_cursor_ptr = $a
|
||||||
|
__bbegin:
|
||||||
|
// printf_cursor_x = 0
|
||||||
|
// X-position of cursor
|
||||||
|
lda #0
|
||||||
|
sta.z printf_cursor_x
|
||||||
|
// printf_cursor_y = 0
|
||||||
|
// Y-position of cursor
|
||||||
|
sta.z printf_cursor_y
|
||||||
|
// printf_cursor_ptr = PRINTF_SCREEN_ADDRESS
|
||||||
|
// Pointer to cursor address
|
||||||
|
lda #<$400
|
||||||
|
sta.z printf_cursor_ptr
|
||||||
|
lda #>$400
|
||||||
|
sta.z printf_cursor_ptr+1
|
||||||
|
jsr main
|
||||||
|
rts
|
||||||
main: {
|
main: {
|
||||||
// print_str("hello world!")
|
// printf("hello world!\n")
|
||||||
jsr print_str
|
jsr printf_str
|
||||||
// print_ln()
|
|
||||||
jsr print_ln
|
|
||||||
// }
|
// }
|
||||||
rts
|
rts
|
||||||
str: .text "hello world!"
|
str: .text @"hello world!\n"
|
||||||
.byte 0
|
.byte 0
|
||||||
}
|
}
|
||||||
// Print a newline
|
|
||||||
print_ln: {
|
|
||||||
lda #<$400
|
|
||||||
sta.z print_line_cursor
|
|
||||||
lda #>$400
|
|
||||||
sta.z print_line_cursor+1
|
|
||||||
__b1:
|
|
||||||
// print_line_cursor + $28
|
|
||||||
lda #$28
|
|
||||||
clc
|
|
||||||
adc.z print_line_cursor
|
|
||||||
sta.z print_line_cursor
|
|
||||||
bcc !+
|
|
||||||
inc.z print_line_cursor+1
|
|
||||||
!:
|
|
||||||
// while (print_line_cursor<print_char_cursor)
|
|
||||||
lda.z print_line_cursor+1
|
|
||||||
cmp.z print_char_cursor+1
|
|
||||||
bcc __b1
|
|
||||||
bne !+
|
|
||||||
lda.z print_line_cursor
|
|
||||||
cmp.z print_char_cursor
|
|
||||||
bcc __b1
|
|
||||||
!:
|
|
||||||
// }
|
|
||||||
rts
|
|
||||||
}
|
|
||||||
// Print a zero-terminated string
|
// Print a zero-terminated string
|
||||||
// print_str(byte* zp(4) str)
|
// Handles escape codes such as newline
|
||||||
print_str: {
|
// printf_str(byte* zp(2) str)
|
||||||
.label str = 4
|
printf_str: {
|
||||||
lda #<$400
|
.label str = 2
|
||||||
sta.z print_char_cursor
|
|
||||||
lda #>$400
|
|
||||||
sta.z print_char_cursor+1
|
|
||||||
lda #<main.str
|
lda #<main.str
|
||||||
sta.z str
|
sta.z str
|
||||||
lda #>main.str
|
lda #>main.str
|
||||||
sta.z str+1
|
sta.z str+1
|
||||||
__b1:
|
|
||||||
// while(*str)
|
|
||||||
ldy #0
|
|
||||||
lda (str),y
|
|
||||||
cmp #0
|
|
||||||
bne __b2
|
|
||||||
// }
|
|
||||||
rts
|
|
||||||
__b2:
|
__b2:
|
||||||
// print_char(*(str++))
|
// ch = *str++
|
||||||
ldy #0
|
ldy #0
|
||||||
lda (str),y
|
lda (str),y
|
||||||
jsr print_char
|
|
||||||
// print_char(*(str++));
|
|
||||||
inc.z str
|
inc.z str
|
||||||
bne !+
|
bne !+
|
||||||
inc.z str+1
|
inc.z str+1
|
||||||
!:
|
!:
|
||||||
jmp __b1
|
// if(ch==0)
|
||||||
|
cmp #0
|
||||||
|
bne __b3
|
||||||
|
// }
|
||||||
|
rts
|
||||||
|
__b3:
|
||||||
|
// if(ch=='\n')
|
||||||
|
cmp #'\n'
|
||||||
|
beq __b4
|
||||||
|
// printf_char(ch)
|
||||||
|
jsr printf_char
|
||||||
|
jmp __b2
|
||||||
|
__b4:
|
||||||
|
// printf_ln()
|
||||||
|
jsr printf_ln
|
||||||
|
jmp __b2
|
||||||
}
|
}
|
||||||
// Print a single char
|
// Print a newline
|
||||||
// print_char(byte register(A) ch)
|
printf_ln: {
|
||||||
print_char: {
|
.label __0 = $a
|
||||||
// *(print_char_cursor++) = ch
|
.label __1 = $a
|
||||||
ldy #0
|
// printf_cursor_ptr - printf_cursor_x
|
||||||
sta (print_char_cursor),y
|
sec
|
||||||
// *(print_char_cursor++) = ch;
|
lda.z __0
|
||||||
inc.z print_char_cursor
|
sbc.z printf_cursor_x
|
||||||
bne !+
|
sta.z __0
|
||||||
inc.z print_char_cursor+1
|
bcs !+
|
||||||
|
dec.z __0+1
|
||||||
!:
|
!:
|
||||||
|
// printf_cursor_ptr - printf_cursor_x + PRINTF_SCREEN_WIDTH
|
||||||
|
lda #$28
|
||||||
|
clc
|
||||||
|
adc.z __1
|
||||||
|
sta.z __1
|
||||||
|
bcc !+
|
||||||
|
inc.z __1+1
|
||||||
|
!:
|
||||||
|
// printf_cursor_ptr = printf_cursor_ptr - printf_cursor_x + PRINTF_SCREEN_WIDTH
|
||||||
|
// printf_cursor_x = 0
|
||||||
|
lda #0
|
||||||
|
sta.z printf_cursor_x
|
||||||
|
// printf_cursor_y++;
|
||||||
|
inc.z printf_cursor_y
|
||||||
|
// printf_scroll()
|
||||||
|
jsr printf_scroll
|
||||||
|
// }
|
||||||
|
rts
|
||||||
|
}
|
||||||
|
// Scroll the entire screen if the cursor is on the last line
|
||||||
|
printf_scroll: {
|
||||||
|
.label __4 = $a
|
||||||
|
// if(printf_cursor_y==PRINTF_SCREEN_HEIGHT)
|
||||||
|
lda #$19
|
||||||
|
cmp.z printf_cursor_y
|
||||||
|
bne __breturn
|
||||||
|
// memcpy(PRINTF_SCREEN_ADDRESS, PRINTF_SCREEN_ADDRESS+PRINTF_SCREEN_WIDTH, PRINTF_SCREEN_BYTES-PRINTF_SCREEN_WIDTH)
|
||||||
|
jsr memcpy
|
||||||
|
// memset(PRINTF_SCREEN_ADDRESS+PRINTF_SCREEN_BYTES-PRINTF_SCREEN_WIDTH, ' ', PRINTF_SCREEN_WIDTH)
|
||||||
|
jsr memset
|
||||||
|
// printf_cursor_ptr-PRINTF_SCREEN_WIDTH
|
||||||
|
lda.z __4
|
||||||
|
sec
|
||||||
|
sbc #<$28
|
||||||
|
sta.z __4
|
||||||
|
lda.z __4+1
|
||||||
|
sbc #>$28
|
||||||
|
sta.z __4+1
|
||||||
|
// printf_cursor_ptr = printf_cursor_ptr-PRINTF_SCREEN_WIDTH
|
||||||
|
// printf_cursor_y--;
|
||||||
|
dec.z printf_cursor_y
|
||||||
|
__breturn:
|
||||||
|
// }
|
||||||
|
rts
|
||||||
|
}
|
||||||
|
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
|
||||||
|
memset: {
|
||||||
|
.const c = ' '
|
||||||
|
.const num = $28
|
||||||
|
.label str = $400+$28*$19-$28
|
||||||
|
.label end = str+num
|
||||||
|
.label dst = 4
|
||||||
|
lda #<str
|
||||||
|
sta.z dst
|
||||||
|
lda #>str
|
||||||
|
sta.z dst+1
|
||||||
|
__b1:
|
||||||
|
// for(char* dst = str; dst!=end; dst++)
|
||||||
|
lda.z dst+1
|
||||||
|
cmp #>end
|
||||||
|
bne __b2
|
||||||
|
lda.z dst
|
||||||
|
cmp #<end
|
||||||
|
bne __b2
|
||||||
|
// }
|
||||||
|
rts
|
||||||
|
__b2:
|
||||||
|
// *dst = c
|
||||||
|
lda #c
|
||||||
|
ldy #0
|
||||||
|
sta (dst),y
|
||||||
|
// for(char* dst = str; dst!=end; dst++)
|
||||||
|
inc.z dst
|
||||||
|
bne !+
|
||||||
|
inc.z dst+1
|
||||||
|
!:
|
||||||
|
jmp __b1
|
||||||
|
}
|
||||||
|
// Copy block of memory (forwards)
|
||||||
|
// Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination.
|
||||||
|
memcpy: {
|
||||||
|
.const num = $28*$19-$28
|
||||||
|
.label destination = $400
|
||||||
|
.label source = $400+$28
|
||||||
|
.label src_end = source+num
|
||||||
|
.label dst = 6
|
||||||
|
.label src = 4
|
||||||
|
lda #<destination
|
||||||
|
sta.z dst
|
||||||
|
lda #>destination
|
||||||
|
sta.z dst+1
|
||||||
|
lda #<source
|
||||||
|
sta.z src
|
||||||
|
lda #>source
|
||||||
|
sta.z src+1
|
||||||
|
__b1:
|
||||||
|
// while(src!=src_end)
|
||||||
|
lda.z src+1
|
||||||
|
cmp #>src_end
|
||||||
|
bne __b2
|
||||||
|
lda.z src
|
||||||
|
cmp #<src_end
|
||||||
|
bne __b2
|
||||||
|
// }
|
||||||
|
rts
|
||||||
|
__b2:
|
||||||
|
// *dst++ = *src++
|
||||||
|
ldy #0
|
||||||
|
lda (src),y
|
||||||
|
sta (dst),y
|
||||||
|
// *dst++ = *src++;
|
||||||
|
inc.z dst
|
||||||
|
bne !+
|
||||||
|
inc.z dst+1
|
||||||
|
!:
|
||||||
|
inc.z src
|
||||||
|
bne !+
|
||||||
|
inc.z src+1
|
||||||
|
!:
|
||||||
|
jmp __b1
|
||||||
|
}
|
||||||
|
// Print a single char
|
||||||
|
// If the end of the screen is reached scroll it up one char and place the cursor at the
|
||||||
|
// printf_char(byte register(A) ch)
|
||||||
|
printf_char: {
|
||||||
|
// *(printf_cursor_ptr++) = ch
|
||||||
|
ldy #0
|
||||||
|
sta (printf_cursor_ptr),y
|
||||||
|
// *(printf_cursor_ptr++) = ch;
|
||||||
|
inc.z printf_cursor_ptr
|
||||||
|
bne !+
|
||||||
|
inc.z printf_cursor_ptr+1
|
||||||
|
!:
|
||||||
|
// if(++printf_cursor_x==PRINTF_SCREEN_WIDTH)
|
||||||
|
inc.z printf_cursor_x
|
||||||
|
lda #$28
|
||||||
|
cmp.z printf_cursor_x
|
||||||
|
bne __breturn
|
||||||
|
// printf_cursor_x = 0
|
||||||
|
lda #0
|
||||||
|
sta.z printf_cursor_x
|
||||||
|
// ++printf_cursor_y;
|
||||||
|
inc.z printf_cursor_y
|
||||||
|
// printf_scroll()
|
||||||
|
jsr printf_scroll
|
||||||
|
__breturn:
|
||||||
// }
|
// }
|
||||||
rts
|
rts
|
||||||
}
|
}
|
||||||
|
@@ -2,63 +2,134 @@
|
|||||||
[0] phi()
|
[0] phi()
|
||||||
to:@1
|
to:@1
|
||||||
@1: scope:[] from @begin
|
@1: scope:[] from @begin
|
||||||
[1] phi()
|
[1] (byte) printf_cursor_x ← (byte) 0
|
||||||
[2] call main
|
[2] (byte) printf_cursor_y ← (byte) 0
|
||||||
|
[3] (byte*) printf_cursor_ptr ← (byte*) 1024
|
||||||
|
to:@2
|
||||||
|
@2: scope:[] from @1
|
||||||
|
[4] phi()
|
||||||
|
[5] call main
|
||||||
to:@end
|
to:@end
|
||||||
@end: scope:[] from @1
|
@end: scope:[] from @2
|
||||||
[3] phi()
|
[6] phi()
|
||||||
|
|
||||||
(void()) main()
|
(void()) main()
|
||||||
main: scope:[main] from @1
|
main: scope:[main] from @2
|
||||||
[4] phi()
|
[7] phi()
|
||||||
[5] call print_str
|
[8] call printf_str
|
||||||
to:main::@1
|
|
||||||
main::@1: scope:[main] from main
|
|
||||||
[6] phi()
|
|
||||||
[7] call print_ln
|
|
||||||
to:main::@return
|
to:main::@return
|
||||||
main::@return: scope:[main] from main::@1
|
main::@return: scope:[main] from main
|
||||||
[8] return
|
[9] return
|
||||||
to:@return
|
to:@return
|
||||||
|
|
||||||
(void()) print_ln()
|
(void()) printf_str((byte*) printf_str::str)
|
||||||
print_ln: scope:[print_ln] from main::@1
|
printf_str: scope:[printf_str] from main
|
||||||
[9] phi()
|
[10] phi()
|
||||||
to:print_ln::@1
|
to:printf_str::@1
|
||||||
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
|
printf_str::@1: scope:[printf_str] from printf_str printf_str::@4 printf_str::@5
|
||||||
[10] (byte*) print_line_cursor#6 ← phi( print_ln/(byte*) 1024 print_ln::@1/(byte*) print_line_cursor#1 )
|
[11] (byte*) printf_str::str#2 ← phi( printf_str/(const byte*) main::str printf_str::@4/(byte*) printf_str::str#0 printf_str::@5/(byte*) printf_str::str#0 )
|
||||||
[11] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#6 + (byte) $28
|
to:printf_str::@2
|
||||||
[12] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#12) goto print_ln::@1
|
printf_str::@2: scope:[printf_str] from printf_str::@1
|
||||||
to:print_ln::@return
|
[12] (byte) printf_str::ch#0 ← *((byte*) printf_str::str#2)
|
||||||
print_ln::@return: scope:[print_ln] from print_ln::@1
|
[13] (byte*) printf_str::str#0 ← ++ (byte*) printf_str::str#2
|
||||||
[13] return
|
[14] if((byte) printf_str::ch#0!=(byte) 0) goto printf_str::@3
|
||||||
|
to:printf_str::@return
|
||||||
|
printf_str::@return: scope:[printf_str] from printf_str::@2
|
||||||
|
[15] return
|
||||||
|
to:@return
|
||||||
|
printf_str::@3: scope:[printf_str] from printf_str::@2
|
||||||
|
[16] if((byte) printf_str::ch#0==(byte) '
|
||||||
|
') goto printf_str::@4
|
||||||
|
to:printf_str::@5
|
||||||
|
printf_str::@5: scope:[printf_str] from printf_str::@3
|
||||||
|
[17] (byte) printf_char::ch#0 ← (byte) printf_str::ch#0
|
||||||
|
[18] call printf_char
|
||||||
|
to:printf_str::@1
|
||||||
|
printf_str::@4: scope:[printf_str] from printf_str::@3
|
||||||
|
[19] phi()
|
||||||
|
[20] call printf_ln
|
||||||
|
to:printf_str::@1
|
||||||
|
|
||||||
|
(void()) printf_ln()
|
||||||
|
printf_ln: scope:[printf_ln] from printf_str::@4
|
||||||
|
[21] (byte*~) printf_ln::$0 ← (byte*) printf_cursor_ptr - (byte) printf_cursor_x
|
||||||
|
[22] (byte*~) printf_ln::$1 ← (byte*~) printf_ln::$0 + (byte) $28
|
||||||
|
[23] (byte*) printf_cursor_ptr ← (byte*~) printf_ln::$1
|
||||||
|
[24] (byte) printf_cursor_x ← (byte) 0
|
||||||
|
[25] (byte) printf_cursor_y ← ++ (byte) printf_cursor_y
|
||||||
|
[26] call printf_scroll
|
||||||
|
to:printf_ln::@return
|
||||||
|
printf_ln::@return: scope:[printf_ln] from printf_ln
|
||||||
|
[27] return
|
||||||
to:@return
|
to:@return
|
||||||
|
|
||||||
(void()) print_str((byte*) print_str::str)
|
(void()) printf_scroll()
|
||||||
print_str: scope:[print_str] from main
|
printf_scroll: scope:[printf_scroll] from printf_char::@1 printf_ln
|
||||||
[14] phi()
|
[28] if((byte) printf_cursor_y!=(byte) $19) goto printf_scroll::@return
|
||||||
to:print_str::@1
|
to:printf_scroll::@1
|
||||||
print_str::@1: scope:[print_str] from print_str print_str::@3
|
printf_scroll::@1: scope:[printf_scroll] from printf_scroll
|
||||||
[15] (byte*) print_char_cursor#12 ← phi( print_str/(byte*) 1024 print_str::@3/(byte*) print_char_cursor#16 )
|
[29] phi()
|
||||||
[15] (byte*) print_str::str#2 ← phi( print_str/(const byte*) main::str print_str::@3/(byte*) print_str::str#0 )
|
[30] call memcpy
|
||||||
[16] if((byte) 0!=*((byte*) print_str::str#2)) goto print_str::@2
|
to:printf_scroll::@2
|
||||||
to:print_str::@return
|
printf_scroll::@2: scope:[printf_scroll] from printf_scroll::@1
|
||||||
print_str::@return: scope:[print_str] from print_str::@1
|
[31] phi()
|
||||||
[17] return
|
[32] call memset
|
||||||
|
to:printf_scroll::@3
|
||||||
|
printf_scroll::@3: scope:[printf_scroll] from printf_scroll::@2
|
||||||
|
[33] (byte*~) printf_scroll::$4 ← (byte*) printf_cursor_ptr - (byte) $28
|
||||||
|
[34] (byte*) printf_cursor_ptr ← (byte*~) printf_scroll::$4
|
||||||
|
[35] (byte) printf_cursor_y ← -- (byte) printf_cursor_y
|
||||||
|
to:printf_scroll::@return
|
||||||
|
printf_scroll::@return: scope:[printf_scroll] from printf_scroll printf_scroll::@3
|
||||||
|
[36] return
|
||||||
to:@return
|
to:@return
|
||||||
print_str::@2: scope:[print_str] from print_str::@1
|
|
||||||
[18] (byte) print_char::ch#0 ← *((byte*) print_str::str#2)
|
|
||||||
[19] call print_char
|
|
||||||
to:print_str::@3
|
|
||||||
print_str::@3: scope:[print_str] from print_str::@2
|
|
||||||
[20] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#2
|
|
||||||
to:print_str::@1
|
|
||||||
|
|
||||||
(void()) print_char((byte) print_char::ch)
|
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
|
||||||
print_char: scope:[print_char] from print_str::@2
|
memset: scope:[memset] from printf_scroll::@2
|
||||||
[21] *((byte*) print_char_cursor#12) ← (byte) print_char::ch#0
|
[37] phi()
|
||||||
[22] (byte*) print_char_cursor#16 ← ++ (byte*) print_char_cursor#12
|
to:memset::@1
|
||||||
to:print_char::@return
|
memset::@1: scope:[memset] from memset memset::@2
|
||||||
print_char::@return: scope:[print_char] from print_char
|
[38] (byte*) memset::dst#2 ← phi( memset/(byte*)(const void*) memset::str#0 memset::@2/(byte*) memset::dst#1 )
|
||||||
[23] return
|
[39] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2
|
||||||
|
to:memset::@return
|
||||||
|
memset::@return: scope:[memset] from memset::@1
|
||||||
|
[40] return
|
||||||
|
to:@return
|
||||||
|
memset::@2: scope:[memset] from memset::@1
|
||||||
|
[41] *((byte*) memset::dst#2) ← (const byte) memset::c#0
|
||||||
|
[42] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
|
||||||
|
to:memset::@1
|
||||||
|
|
||||||
|
(void*()) memcpy((void*) memcpy::destination , (void*) memcpy::source , (word) memcpy::num)
|
||||||
|
memcpy: scope:[memcpy] from printf_scroll::@1
|
||||||
|
[43] phi()
|
||||||
|
to:memcpy::@1
|
||||||
|
memcpy::@1: scope:[memcpy] from memcpy memcpy::@2
|
||||||
|
[44] (byte*) memcpy::dst#2 ← phi( memcpy/(byte*)(const void*) memcpy::destination#0 memcpy::@2/(byte*) memcpy::dst#1 )
|
||||||
|
[44] (byte*) memcpy::src#2 ← phi( memcpy/(byte*)(const void*) memcpy::source#0 memcpy::@2/(byte*) memcpy::src#1 )
|
||||||
|
[45] if((byte*) memcpy::src#2!=(const byte*) memcpy::src_end#0) goto memcpy::@2
|
||||||
|
to:memcpy::@return
|
||||||
|
memcpy::@return: scope:[memcpy] from memcpy::@1
|
||||||
|
[46] return
|
||||||
|
to:@return
|
||||||
|
memcpy::@2: scope:[memcpy] from memcpy::@1
|
||||||
|
[47] *((byte*) memcpy::dst#2) ← *((byte*) memcpy::src#2)
|
||||||
|
[48] (byte*) memcpy::dst#1 ← ++ (byte*) memcpy::dst#2
|
||||||
|
[49] (byte*) memcpy::src#1 ← ++ (byte*) memcpy::src#2
|
||||||
|
to:memcpy::@1
|
||||||
|
|
||||||
|
(void()) printf_char((byte) printf_char::ch)
|
||||||
|
printf_char: scope:[printf_char] from printf_str::@5
|
||||||
|
[50] *((byte*) printf_cursor_ptr) ← (byte) printf_char::ch#0
|
||||||
|
[51] (byte*) printf_cursor_ptr ← ++ (byte*) printf_cursor_ptr
|
||||||
|
[52] (byte) printf_cursor_x ← ++ (byte) printf_cursor_x
|
||||||
|
[53] if((byte) printf_cursor_x!=(byte) $28) goto printf_char::@return
|
||||||
|
to:printf_char::@1
|
||||||
|
printf_char::@1: scope:[printf_char] from printf_char
|
||||||
|
[54] (byte) printf_cursor_x ← (byte) 0
|
||||||
|
[55] (byte) printf_cursor_y ← ++ (byte) printf_cursor_y
|
||||||
|
[56] call printf_scroll
|
||||||
|
to:printf_char::@return
|
||||||
|
printf_char::@return: scope:[printf_char] from printf_char printf_char::@1
|
||||||
|
[57] return
|
||||||
to:@return
|
to:@return
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
|||||||
(label) @1
|
(label) @1
|
||||||
|
(label) @2
|
||||||
(label) @begin
|
(label) @begin
|
||||||
(label) @end
|
(label) @end
|
||||||
(const byte) RADIX::BINARY = (number) 2
|
(const byte) RADIX::BINARY = (number) 2
|
||||||
@@ -6,33 +7,90 @@
|
|||||||
(const byte) RADIX::HEXADECIMAL = (number) $10
|
(const byte) RADIX::HEXADECIMAL = (number) $10
|
||||||
(const byte) RADIX::OCTAL = (number) 8
|
(const byte) RADIX::OCTAL = (number) 8
|
||||||
(void()) main()
|
(void()) main()
|
||||||
(label) main::@1
|
|
||||||
(label) main::@return
|
(label) main::@return
|
||||||
(const byte*) main::str[(byte) $d] = (byte*) "hello world!"
|
(const byte*) main::str[(byte) $e] = (byte*) "hello world!
|
||||||
(void()) print_char((byte) print_char::ch)
|
"
|
||||||
(label) print_char::@return
|
(void*()) memcpy((void*) memcpy::destination , (void*) memcpy::source , (word) memcpy::num)
|
||||||
(byte) print_char::ch
|
(label) memcpy::@1
|
||||||
(byte) print_char::ch#0 reg byte a 11002.0
|
(label) memcpy::@2
|
||||||
(byte*) print_char_cursor
|
(label) memcpy::@return
|
||||||
(byte*) print_char_cursor#12 print_char_cursor zp[2]:6 2000.363636363636
|
(void*) memcpy::destination
|
||||||
(byte*) print_char_cursor#16 print_char_cursor zp[2]:6 2750.5
|
(const void*) memcpy::destination#0 destination = (void*) 1024
|
||||||
(byte*) print_line_cursor
|
(byte*) memcpy::dst
|
||||||
(byte*) print_line_cursor#1 print_line_cursor zp[2]:2 1501.5
|
(byte*) memcpy::dst#1 dst zp[2]:6 1.00000001E8
|
||||||
(byte*) print_line_cursor#6 print_line_cursor zp[2]:2 2002.0
|
(byte*) memcpy::dst#2 dst zp[2]:6 1.00000001E8
|
||||||
(void()) print_ln()
|
(word) memcpy::num
|
||||||
(label) print_ln::@1
|
(const word) memcpy::num#0 num = (word)(number) $28*(number) $19-(number) $28
|
||||||
(label) print_ln::@return
|
(void*) memcpy::return
|
||||||
(byte*) print_screen
|
(void*) memcpy::source
|
||||||
(void()) print_str((byte*) print_str::str)
|
(const void*) memcpy::source#0 source = (void*)(number) $400+(number) $28
|
||||||
(label) print_str::@1
|
(byte*) memcpy::src
|
||||||
(label) print_str::@2
|
(byte*) memcpy::src#1 src zp[2]:4 2.00000002E8
|
||||||
(label) print_str::@3
|
(byte*) memcpy::src#2 src zp[2]:4 1.00000001E8
|
||||||
(label) print_str::@return
|
(byte*) memcpy::src_end
|
||||||
(byte*) print_str::str
|
(const byte*) memcpy::src_end#0 src_end = (byte*)(const void*) memcpy::source#0+(const word) memcpy::num#0
|
||||||
(byte*) print_str::str#0 str zp[2]:4 2002.0
|
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
|
||||||
(byte*) print_str::str#2 str zp[2]:4 1001.0
|
(label) memset::@1
|
||||||
|
(label) memset::@2
|
||||||
|
(label) memset::@return
|
||||||
|
(byte) memset::c
|
||||||
|
(const byte) memset::c#0 c = (byte) ' '
|
||||||
|
(byte*) memset::dst
|
||||||
|
(byte*) memset::dst#1 dst zp[2]:4 2.00000002E8
|
||||||
|
(byte*) memset::dst#2 dst zp[2]:4 1.3333333466666667E8
|
||||||
|
(byte*) memset::end
|
||||||
|
(const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0
|
||||||
|
(word) memset::num
|
||||||
|
(const word) memset::num#0 num = (byte) $28
|
||||||
|
(void*) memset::return
|
||||||
|
(void*) memset::str
|
||||||
|
(const void*) memset::str#0 str = (void*)(number) $400+(number) $28*(number) $19-(number) $28
|
||||||
|
(const byte*) printf_buffer_number::digits[(number) $b] = { fill( $b, 0) }
|
||||||
|
(byte) printf_buffer_number::sign
|
||||||
|
(void()) printf_char((byte) printf_char::ch)
|
||||||
|
(label) printf_char::@1
|
||||||
|
(label) printf_char::@return
|
||||||
|
(byte) printf_char::ch
|
||||||
|
(byte) printf_char::ch#0 reg byte a 11002.0
|
||||||
|
(byte*) printf_cursor_ptr loadstore zp[2]:10 7353.205882352942
|
||||||
|
(byte) printf_cursor_x loadstore zp[1]:8 2222.5185185185182
|
||||||
|
(byte) printf_cursor_y loadstore zp[1]:9 8947.605263157893
|
||||||
|
(byte) printf_format_number::justify_left
|
||||||
|
(byte) printf_format_number::min_length
|
||||||
|
(byte) printf_format_number::radix
|
||||||
|
(byte) printf_format_number::sign_always
|
||||||
|
(byte) printf_format_number::upper_case
|
||||||
|
(byte) printf_format_number::zero_padding
|
||||||
|
(byte) printf_format_string::justify_left
|
||||||
|
(byte) printf_format_string::min_length
|
||||||
|
(void()) printf_ln()
|
||||||
|
(byte*~) printf_ln::$0 zp[2]:10 20002.0
|
||||||
|
(byte*~) printf_ln::$1 zp[2]:10 20002.0
|
||||||
|
(label) printf_ln::@return
|
||||||
|
(void()) printf_scroll()
|
||||||
|
(byte*~) printf_scroll::$4 zp[2]:10 200002.0
|
||||||
|
(label) printf_scroll::@1
|
||||||
|
(label) printf_scroll::@2
|
||||||
|
(label) printf_scroll::@3
|
||||||
|
(label) printf_scroll::@return
|
||||||
|
(void()) printf_str((byte*) printf_str::str)
|
||||||
|
(label) printf_str::@1
|
||||||
|
(label) printf_str::@2
|
||||||
|
(label) printf_str::@3
|
||||||
|
(label) printf_str::@4
|
||||||
|
(label) printf_str::@5
|
||||||
|
(label) printf_str::@return
|
||||||
|
(byte) printf_str::ch
|
||||||
|
(byte) printf_str::ch#0 reg byte a 1001.0
|
||||||
|
(byte*) printf_str::str
|
||||||
|
(byte*) printf_str::str#0 str zp[2]:2 429.0
|
||||||
|
(byte*) printf_str::str#2 str zp[2]:2 2002.0
|
||||||
|
|
||||||
zp[2]:2 [ print_line_cursor#6 print_line_cursor#1 ]
|
zp[2]:2 [ printf_str::str#2 printf_str::str#0 ]
|
||||||
zp[2]:4 [ print_str::str#2 print_str::str#0 ]
|
zp[2]:4 [ memcpy::src#2 memcpy::src#1 memset::dst#2 memset::dst#1 ]
|
||||||
zp[2]:6 [ print_char_cursor#12 print_char_cursor#16 ]
|
zp[2]:6 [ memcpy::dst#2 memcpy::dst#1 ]
|
||||||
reg byte a [ print_char::ch#0 ]
|
zp[1]:8 [ printf_cursor_x ]
|
||||||
|
zp[1]:9 [ printf_cursor_y ]
|
||||||
|
zp[2]:10 [ printf_cursor_ptr printf_scroll::$4 printf_ln::$0 printf_ln::$1 ]
|
||||||
|
reg byte a [ printf_str::ch#0 ]
|
||||||
|
reg byte a [ printf_char::ch#0 ]
|
||||||
|
Reference in New Issue
Block a user