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

Using labels for constant integers referenced outside scope.

This commit is contained in:
jespergravgaard 2018-02-18 17:49:03 +01:00
parent 76d3e25b84
commit d3898d717e
20 changed files with 10845 additions and 4026 deletions

View File

@ -1,8 +1,8 @@
lda {z2}
sta {z1}
lda {z2}+1
sta {z1}+1
lda {z3}
sta {z1}+2
lda {z2}+1
sta {z1}+3
lda {z3}
sta {z1}
lda {z3}+1
sta {z1}+3
sta {z1}+1

View File

@ -173,6 +173,16 @@ public interface SymbolType {
}
}
/**
* Is the type an integer type or compatible {@link SymbolTypeInline}
*
* @param type The type to examine
* @return true if the type is integer
*/
static boolean isInteger(SymbolType type) {
return isSDWord(type) || isDWord(type) || isSWord(type) || isWord(type) || isSByte(type) || isByte(type);
}
/**
* Get the name of the type
*

View File

@ -141,5 +141,14 @@ public class VariableReferenceInfos {
return unusedInStmts && unusedInConsts;
}
/**
* Get all statements referencing constant
* @param constRef The constant to look for
* @return Index of all statements referencing the constant
*/
public Collection<Integer> getConstRefStatements(ConstantRef constRef) {
return constRefStmts.get(constRef);
}
}

View File

@ -235,6 +235,8 @@ public class Pass2ConstantIdentification extends Pass2SsaOptimization {
return new ConstantBinary(c1, operator, c2);
case "w=":
return new ConstantBinary(new ConstantBinary(c1, Operator.MULTIPLY, new ConstantInteger(256L)), Operator.PLUS, c2);
case "dw=":
return new ConstantBinary(new ConstantBinary(c1, Operator.MULTIPLY, new ConstantInteger(65536L)), Operator.PLUS, c2);
case "*idx":
// Pointer dereference - not constant
return null;

View File

@ -115,8 +115,27 @@ public class Pass4CodeGeneration {
if(constantVar.getType() instanceof SymbolTypePointer) {
// Must use a label for pointers
asm.addLabelDecl(asmName.replace("#", "_").replace("$", "_"), asmConstant);
} else if(SymbolType.isInteger(constantVar.getType()) && constantVar.getRef().getScopeDepth()>0) {
// Use label for integers referenced in other scope - to allow cross-scope referencing
boolean gen = false;
Collection<Integer> constRefStatements = program.getVariableReferenceInfos().getConstRefStatements(constantVar.getRef());
if(constRefStatements!=null) {
for(Integer constRefStmtIdx : constRefStatements) {
ScopeRef refScope = program.getStatementInfos().getBlock(constRefStmtIdx).getScope();
if(!refScope.equals(scopeRef)) {
// Use label for integers referenced in other scope - to allow cross-scope referencing
asm.addLabelDecl(asmName.replace("#", "_").replace("$", "_"), asmConstant);
gen = true;
break;
}
}
}
if(!gen) {
// Use constant for constant integers not referenced outside scope
asm.addConstant(asmName.replace("#", "_").replace("$", "_"), asmConstant);
}
} else {
// Use constant for non-pointers
// Use constant otherwise
asm.addConstant(asmName.replace("#", "_").replace("$", "_"), asmConstant);
}
}

View File

@ -45,10 +45,10 @@ public class TestPrograms {
AsmFragmentTemplateUsages.logUsages(log, false, false, false, false, false, false);
}
//@Test
//public void testLineGen() throws IOException, URISyntaxException {
// compileAndCompare("linegen");
//}
@Test
public void testLineGen() throws IOException, URISyntaxException {
compileAndCompare("linegen");
}
@Test
public void testLowHigh() throws IOException, URISyntaxException {

View File

@ -10,7 +10,14 @@ byte rem8u =0;
// The remainder will be set into the global variable rem8u
// Implemented using simple binary division
byte div8u(byte dividend, byte divisor) {
byte rem = 0;
return divr8u(dividend, divisor, 0);
}
// Performs division on two 8 bit unsigned bytes and an initial remainder
// Returns dividend/divisor.
// The final remainder will be set into the global variable rem8u
// Implemented using simple binary division
byte divr8u(byte dividend, byte divisor, byte rem) {
byte quotient = 0;
for( byte i : 0..7) {
rem = rem << 1;
@ -31,12 +38,19 @@ byte div8u(byte dividend, byte divisor) {
// Remainder after unsigned 16-bit division
word rem16u = 0;
// Performs division on two 16 bit unsigned bytes
// Returns dividend/divisor.
// Performs division on two 16 bit unsigned words
// Returns the quotient dividend/divisor.
// The remainder will be set into the global variable rem16u
// Implemented using simple binary division
word div16u(word dividend, word divisor) {
word rem = 0;
return divr16u(dividend, divisor, 0);
}
// Performs division on two 16 bit unsigned words and an initial remainder
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
word divr16u(word dividend, word divisor, word rem) {
word quotient = 0;
for( byte i : 0..15) {
rem = rem << 1;

View File

@ -20,8 +20,10 @@ void main() {
// length - the number of points in a total sinus wavelength (the size of the table)
void lin16u_gen(word min, word max, word* lintab, word length) {
word ampl = max-min;
dword step = { rem16u, div16u(ampl, length-1) };
dword val = { 0, min };
word stepi = div16u(ampl, length-1);
word stepf = divr16u(0, length-1, rem16u);
dword step = { stepi, stepf };
dword val = { min, 0 };
for(word i=0; i<length; i++) {
*lintab = >val;
val = val + step;

View File

@ -19,7 +19,7 @@ main: {
jmp b2
}
line: {
.const x0 = 0
.label x0 = 0
.const x1 = $a
.label x = 2
lda #x0

View File

@ -628,7 +628,7 @@ main: {
}
//SEG26 line
line: {
.const x0 = 0
.label x0 = 0
.const x1 = $a
.label x = 3
//SEG27 [14] if((const byte) line::x0#0>=(const byte) line::x1#0) goto line::@1 [ ] ( main:2::line:11 [ ] ) -- vbuc1_ge_vbuc2_then_la1
@ -809,7 +809,7 @@ main: {
}
//SEG26 line
line: {
.const x0 = 0
.label x0 = 0
.const x1 = $a
.label x = 2
//SEG27 [14] if((const byte) line::x0#0>=(const byte) line::x1#0) goto line::@1 [ ] ( main:2::line:11 [ ] ) -- vbuc1_ge_vbuc2_then_la1
@ -1020,7 +1020,7 @@ main: {
}
//SEG26 line
line: {
.const x0 = 0
.label x0 = 0
.const x1 = $a
.label x = 2
//SEG27 [14] if((const byte) line::x0#0>=(const byte) line::x1#0) goto line::@1 [ ] ( main:2::line:11 [ ] ) -- vbuc1_ge_vbuc2_then_la1

View File

@ -17,11 +17,11 @@ main: {
rts
}
test_sbytes: {
.const bb = 0
.const bc = bb+2
.const bd = bc-4
.const bf = $ff & -$7f-$7f
.const be = -bd
.label bb = 0
.label bc = bb+2
.label bd = bc-4
.label bf = $ff & -$7f-$7f
.label be = -bd
lda #0
sta assert_sbyte.c
ldx #bb
@ -147,9 +147,9 @@ print_ln: {
rts
}
test_bytes: {
.const bb = 0
.const bc = bb+2
.const bd = bc-4
.label bb = 0
.label bc = bb+2
.label bd = bc-4
lda #<SCREEN
sta line_cursor
lda #>SCREEN

View File

@ -2561,11 +2561,11 @@ main: {
}
//SEG22 test_sbytes
test_sbytes: {
.const bb = 0
.const bc = bb+2
.const bd = bc-4
.const bf = $ff & -$7f-$7f
.const be = -bd
.label bb = 0
.label bc = bb+2
.label bd = bc-4
.label bf = $ff & -$7f-$7f
.label be = -bd
//SEG23 [12] call assert_sbyte param-assignment [ line_cursor#1 ] ( main:2::test_sbytes:9 [ line_cursor#1 ] )
//SEG24 [22] phi from test_sbytes to assert_sbyte [phi:test_sbytes->assert_sbyte]
assert_sbyte_from_test_sbytes:
@ -2841,9 +2841,9 @@ print_ln: {
}
//SEG112 test_bytes
test_bytes: {
.const bb = 0
.const bc = bb+2
.const bd = bc-4
.label bb = 0
.label bc = bb+2
.label bd = bc-4
//SEG113 [49] call assert_byte param-assignment [ line_cursor#1 ] ( main:2::test_bytes:7 [ line_cursor#1 ] )
//SEG114 [55] phi from test_bytes to assert_byte [phi:test_bytes->assert_byte]
assert_byte_from_test_bytes:
@ -3199,11 +3199,11 @@ main: {
}
//SEG22 test_sbytes
test_sbytes: {
.const bb = 0
.const bc = bb+2
.const bd = bc-4
.const bf = $ff & -$7f-$7f
.const be = -bd
.label bb = 0
.label bc = bb+2
.label bd = bc-4
.label bf = $ff & -$7f-$7f
.label be = -bd
//SEG23 [12] call assert_sbyte param-assignment [ line_cursor#1 ] ( main:2::test_sbytes:9 [ line_cursor#1 ] )
//SEG24 [22] phi from test_sbytes to assert_sbyte [phi:test_sbytes->assert_sbyte]
assert_sbyte_from_test_sbytes:
@ -3469,9 +3469,9 @@ print_ln: {
}
//SEG112 test_bytes
test_bytes: {
.const bb = 0
.const bc = bb+2
.const bd = bc-4
.label bb = 0
.label bc = bb+2
.label bd = bc-4
//SEG113 [49] call assert_byte param-assignment [ line_cursor#1 ] ( main:2::test_bytes:7 [ line_cursor#1 ] )
//SEG114 [55] phi from test_bytes to assert_byte [phi:test_bytes->assert_byte]
assert_byte_from_test_bytes:
@ -3963,11 +3963,11 @@ main: {
}
//SEG22 test_sbytes
test_sbytes: {
.const bb = 0
.const bc = bb+2
.const bd = bc-4
.const bf = $ff & -$7f-$7f
.const be = -bd
.label bb = 0
.label bc = bb+2
.label bd = bc-4
.label bf = $ff & -$7f-$7f
.label be = -bd
//SEG23 [12] call assert_sbyte param-assignment [ line_cursor#1 ] ( main:2::test_sbytes:9 [ line_cursor#1 ] )
//SEG24 [22] phi from test_sbytes to assert_sbyte [phi:test_sbytes->assert_sbyte]
//SEG25 [22] phi (signed byte) assert_sbyte::c#5 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:test_sbytes->assert_sbyte#0] -- vbsz1=vbuc1
@ -4184,9 +4184,9 @@ print_ln: {
}
//SEG112 test_bytes
test_bytes: {
.const bb = 0
.const bc = bb+2
.const bd = bc-4
.label bb = 0
.label bc = bb+2
.label bd = bc-4
//SEG113 [49] call assert_byte param-assignment [ line_cursor#1 ] ( main:2::test_bytes:7 [ line_cursor#1 ] )
//SEG114 [55] phi from test_bytes to assert_byte [phi:test_bytes->assert_byte]
//SEG115 [55] phi (byte*) line_cursor#50 = (const byte*) SCREEN#0 [phi:test_bytes->assert_byte#0] -- pbuz1=pbuc1

View File

@ -0,0 +1,313 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label SCREEN = $400
.label char_cursor = 5
.label line_cursor = 3
.label rem16u = 5
jsr main
main: {
.label i = 2
jsr lin16u_gen
jsr print_cls
lda #<SCREEN
sta line_cursor
lda #>SCREEN
sta line_cursor+1
lda #<SCREEN
sta char_cursor
lda #>SCREEN
sta char_cursor+1
lda #0
sta i
b1:
ldx i
jsr print_byte
jsr print_str
ldy i
lda lintab,y
sta print_word.w
lda lintab+1,y
sta print_word.w+1
jsr print_word
jsr print_ln
lda #2
clc
adc i
sta i
cmp #$14*2
bcc b9
rts
b9:
lda line_cursor
sta char_cursor
lda line_cursor+1
sta char_cursor+1
jmp b1
str: .text " @"
lintab: .fill $28, 0
}
print_ln: {
b1:
lda line_cursor
clc
adc #$28
sta line_cursor
bcc !+
inc line_cursor+1
!:
lda line_cursor+1
cmp char_cursor+1
bcc b1
bne !+
lda line_cursor
cmp char_cursor
bcc b1
!:
rts
}
print_word: {
.label w = 7
lda w+1
tax
jsr print_byte
lda w
tax
jsr print_byte
rts
}
print_byte: {
txa
lsr
lsr
lsr
lsr
tay
lda hextab,y
jsr print_char
txa
and #$f
tay
lda hextab,y
jsr print_char
rts
hextab: .text "0123456789abcdef"
}
print_char: {
ldy #0
sta (char_cursor),y
inc char_cursor
bne !+
inc char_cursor+1
!:
rts
}
print_str: {
.label str = 7
lda #<main.str
sta str
lda #>main.str
sta str+1
b1:
ldy #0
lda (str),y
cmp #'@'
bne b2
rts
b2:
ldy #0
lda (str),y
sta (char_cursor),y
inc char_cursor
bne !+
inc char_cursor+1
!:
inc str
bne !+
inc str+1
!:
jmp b1
}
print_cls: {
.label sc = 3
lda #<SCREEN
sta sc
lda #>SCREEN
sta sc+1
b1:
lda #' '
ldy #0
sta (sc),y
inc sc
bne !+
inc sc+1
!:
lda sc+1
cmp #>SCREEN+$3e8
bne b1
lda sc
cmp #<SCREEN+$3e8
bne b1
rts
}
lin16u_gen: {
.const min = $22d
.const max = $7461
.label length = $14
.label ampl = max-min
.label _5 = 7
.label stepi = $f
.label stepf = $d
.label step = $11
.label val = 9
.label lintab = 3
.label i = 5
jsr div16u
lda div16u.return
sta stepi
lda div16u.return+1
sta stepi+1
lda #<length-1
sta divr16u.divisor
lda #>length-1
sta divr16u.divisor+1
lda #<0
sta divr16u.dividend
sta divr16u.dividend+1
jsr divr16u
lda stepi
sta step+2
lda stepi+1
sta step+3
lda stepf
sta step
lda stepf+1
sta step+1
lda #<0
sta i
sta i+1
lda #<main.lintab
sta lintab
lda #>main.lintab
sta lintab+1
lda #<min*$10000+0
sta val
lda #>min*$10000+0
sta val+1
lda #<min*$10000+0>>$10
sta val+2
lda #>min*$10000+0>>$10
sta val+3
b1:
lda val+2
sta _5
lda val+3
sta _5+1
ldy #0
lda _5
sta (lintab),y
iny
lda _5+1
sta (lintab),y
lda val
clc
adc step
sta val
lda val+1
adc step+1
sta val+1
lda val+2
adc step+2
sta val+2
lda val+3
adc step+3
sta val+3
clc
lda lintab
adc #<2
sta lintab
lda lintab+1
adc #>2
sta lintab+1
inc i
bne !+
inc i+1
!:
lda i+1
cmp #>length
bcc b1
bne !+
lda i
cmp #<length
bcc b1
!:
rts
}
divr16u: {
.label return = $d
.label rem = 5
.label dividend = 7
.label quotient = $d
.label divisor = 3
ldx #0
txa
sta quotient
sta quotient+1
b1:
asl rem
rol rem+1
lda dividend+1
and #$80
cmp #0
beq b2
inc rem
bne !+
inc rem+1
!:
b2:
asl dividend
rol dividend+1
asl quotient
rol quotient+1
lda rem+1
cmp divisor+1
bcc b3
bne !+
lda rem
cmp divisor
bcc b3
!:
inc quotient
bne !+
inc quotient+1
!:
lda rem
sec
sbc divisor
sta rem
lda rem+1
sbc divisor+1
sta rem+1
b3:
inx
cpx #$10
bne b1
rts
}
div16u: {
.label divisor = lin16u_gen.length-1
.label return = $d
lda #<divisor
sta divr16u.divisor
lda #>divisor
sta divr16u.divisor+1
lda #<lin16u_gen.ampl
sta divr16u.dividend
lda #>lin16u_gen.ampl
sta divr16u.dividend+1
lda #<0
sta divr16u.rem
sta divr16u.rem+1
jsr divr16u
rts
}

View File

@ -0,0 +1,200 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@18
@18: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main param-assignment [ ] ( )
to:@end
@end: scope:[] from @18
[3] phi() [ ] ( )
main: scope:[main] from @18
[4] phi() [ ] ( main:2 [ ] )
[5] call lin16u_gen param-assignment [ ] ( main:2 [ ] )
to:main::@3
main::@3: scope:[main] from main
[6] phi() [ ] ( main:2 [ ] )
[7] call print_cls param-assignment [ ] ( main:2 [ ] )
to:main::@1
main::@1: scope:[main] from main::@3 main::@9
[8] (byte*) line_cursor#19 ← phi( main::@3/(const byte*) SCREEN#0 main::@9/(byte*) line_cursor#1 ) [ main::i#2 char_cursor#47 line_cursor#19 ] ( main:2 [ main::i#2 char_cursor#47 line_cursor#19 ] )
[8] (byte*) char_cursor#47 ← phi( main::@3/(const byte*) SCREEN#0 main::@9/(byte*~) char_cursor#51 ) [ main::i#2 char_cursor#47 line_cursor#19 ] ( main:2 [ main::i#2 char_cursor#47 line_cursor#19 ] )
[8] (byte) main::i#2 ← phi( main::@3/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@9/(byte) main::i#1 ) [ main::i#2 char_cursor#47 line_cursor#19 ] ( main:2 [ main::i#2 char_cursor#47 line_cursor#19 ] )
[9] (byte) print_byte::b#2 ← (byte) main::i#2 [ main::i#2 char_cursor#47 line_cursor#19 print_byte::b#2 ] ( main:2 [ main::i#2 char_cursor#47 line_cursor#19 print_byte::b#2 ] )
[10] call print_byte param-assignment [ main::i#2 line_cursor#19 char_cursor#11 ] ( main:2 [ main::i#2 line_cursor#19 char_cursor#11 ] )
to:main::@5
main::@5: scope:[main] from main::@1
[11] phi() [ main::i#2 line_cursor#19 char_cursor#11 ] ( main:2 [ main::i#2 line_cursor#19 char_cursor#11 ] )
[12] call print_str param-assignment [ main::i#2 line_cursor#19 char_cursor#2 ] ( main:2 [ main::i#2 line_cursor#19 char_cursor#2 ] )
to:main::@6
main::@6: scope:[main] from main::@5
[13] (word) print_word::w#0 ← *((const word[20]) main::lintab#0 + (byte) main::i#2) [ main::i#2 line_cursor#19 print_word::w#0 char_cursor#2 ] ( main:2 [ main::i#2 line_cursor#19 print_word::w#0 char_cursor#2 ] )
[14] call print_word param-assignment [ main::i#2 line_cursor#19 char_cursor#11 ] ( main:2 [ main::i#2 line_cursor#19 char_cursor#11 ] )
to:main::@7
main::@7: scope:[main] from main::@6
[15] phi() [ main::i#2 line_cursor#19 char_cursor#11 ] ( main:2 [ main::i#2 line_cursor#19 char_cursor#11 ] )
[16] call print_ln param-assignment [ main::i#2 line_cursor#1 ] ( main:2 [ main::i#2 line_cursor#1 ] )
to:main::@8
main::@8: scope:[main] from main::@7
[17] (byte) main::i#1 ← (byte) main::i#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 [ main::i#1 line_cursor#1 ] ( main:2 [ main::i#1 line_cursor#1 ] )
[18] if((byte) main::i#1<(byte/signed byte/word/signed word/dword/signed dword) 20*(byte/signed byte/word/signed word/dword/signed dword) 2) goto main::@9 [ main::i#1 line_cursor#1 ] ( main:2 [ main::i#1 line_cursor#1 ] )
to:main::@return
main::@return: scope:[main] from main::@8
[19] return [ ] ( main:2 [ ] )
to:@return
main::@9: scope:[main] from main::@8
[20] (byte*~) char_cursor#51 ← (byte*) line_cursor#1 [ main::i#1 char_cursor#51 line_cursor#1 ] ( main:2 [ main::i#1 char_cursor#51 line_cursor#1 ] )
to:main::@1
print_ln: scope:[print_ln] from main::@7
[21] phi() [ line_cursor#19 char_cursor#11 ] ( main:2::print_ln:16 [ main::i#2 line_cursor#19 char_cursor#11 ] )
to:print_ln::@1
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
[22] (byte*) line_cursor#9 ← phi( print_ln/(byte*) line_cursor#19 print_ln::@1/(byte*) line_cursor#1 ) [ line_cursor#9 char_cursor#11 ] ( main:2::print_ln:16 [ main::i#2 line_cursor#9 char_cursor#11 ] )
[23] (byte*) line_cursor#1 ← (byte*) line_cursor#9 + (byte/signed byte/word/signed word/dword/signed dword) 40 [ line_cursor#1 char_cursor#11 ] ( main:2::print_ln:16 [ main::i#2 line_cursor#1 char_cursor#11 ] )
[24] if((byte*) line_cursor#1<(byte*) char_cursor#11) goto print_ln::@1 [ line_cursor#1 char_cursor#11 ] ( main:2::print_ln:16 [ main::i#2 line_cursor#1 char_cursor#11 ] )
to:print_ln::@return
print_ln::@return: scope:[print_ln] from print_ln::@1
[25] return [ line_cursor#1 ] ( main:2::print_ln:16 [ main::i#2 line_cursor#1 ] )
to:@return
print_word: scope:[print_word] from main::@6
[26] (byte) print_byte::b#0 ← > (word) print_word::w#0 [ print_word::w#0 print_byte::b#0 char_cursor#2 ] ( main:2::print_word:14 [ main::i#2 line_cursor#19 print_word::w#0 print_byte::b#0 char_cursor#2 ] )
[27] call print_byte param-assignment [ print_word::w#0 char_cursor#11 ] ( main:2::print_word:14 [ main::i#2 line_cursor#19 print_word::w#0 char_cursor#11 ] )
to:print_word::@1
print_word::@1: scope:[print_word] from print_word
[28] (byte) print_byte::b#1 ← < (word) print_word::w#0 [ char_cursor#11 print_byte::b#1 ] ( main:2::print_word:14 [ main::i#2 line_cursor#19 char_cursor#11 print_byte::b#1 ] )
[29] call print_byte param-assignment [ char_cursor#11 ] ( main:2::print_word:14 [ main::i#2 line_cursor#19 char_cursor#11 ] )
to:print_word::@return
print_word::@return: scope:[print_word] from print_word::@1
[30] return [ char_cursor#11 ] ( main:2::print_word:14 [ main::i#2 line_cursor#19 char_cursor#11 ] )
to:@return
print_byte: scope:[print_byte] from main::@1 print_word print_word::@1
[31] (byte*) char_cursor#45 ← phi( main::@1/(byte*) char_cursor#47 print_word/(byte*) char_cursor#2 print_word::@1/(byte*) char_cursor#11 ) [ print_byte::b#3 char_cursor#45 ] ( main:2::print_byte:10 [ main::i#2 line_cursor#19 print_byte::b#3 char_cursor#45 ] main:2::print_word:14::print_byte:27 [ main::i#2 line_cursor#19 print_word::w#0 print_byte::b#3 char_cursor#45 ] main:2::print_word:14::print_byte:29 [ main::i#2 line_cursor#19 print_byte::b#3 char_cursor#45 ] )
[31] (byte) print_byte::b#3 ← phi( main::@1/(byte) print_byte::b#2 print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) [ print_byte::b#3 char_cursor#45 ] ( main:2::print_byte:10 [ main::i#2 line_cursor#19 print_byte::b#3 char_cursor#45 ] main:2::print_word:14::print_byte:27 [ main::i#2 line_cursor#19 print_word::w#0 print_byte::b#3 char_cursor#45 ] main:2::print_word:14::print_byte:29 [ main::i#2 line_cursor#19 print_byte::b#3 char_cursor#45 ] )
[32] (byte~) print_byte::$0 ← (byte) print_byte::b#3 >> (byte/signed byte/word/signed word/dword/signed dword) 4 [ print_byte::b#3 char_cursor#45 print_byte::$0 ] ( main:2::print_byte:10 [ main::i#2 line_cursor#19 print_byte::b#3 char_cursor#45 print_byte::$0 ] main:2::print_word:14::print_byte:27 [ main::i#2 line_cursor#19 print_word::w#0 print_byte::b#3 char_cursor#45 print_byte::$0 ] main:2::print_word:14::print_byte:29 [ main::i#2 line_cursor#19 print_byte::b#3 char_cursor#45 print_byte::$0 ] )
[33] (byte) print_char::ch#0 ← *((const string) print_byte::hextab#0 + (byte~) print_byte::$0) [ print_byte::b#3 char_cursor#45 print_char::ch#0 ] ( main:2::print_byte:10 [ main::i#2 line_cursor#19 print_byte::b#3 char_cursor#45 print_char::ch#0 ] main:2::print_word:14::print_byte:27 [ main::i#2 line_cursor#19 print_word::w#0 print_byte::b#3 char_cursor#45 print_char::ch#0 ] main:2::print_word:14::print_byte:29 [ main::i#2 line_cursor#19 print_byte::b#3 char_cursor#45 print_char::ch#0 ] )
[34] call print_char param-assignment [ char_cursor#11 print_byte::b#3 ] ( main:2::print_byte:10 [ main::i#2 line_cursor#19 char_cursor#11 print_byte::b#3 ] main:2::print_word:14::print_byte:27 [ main::i#2 line_cursor#19 print_word::w#0 char_cursor#11 print_byte::b#3 ] main:2::print_word:14::print_byte:29 [ main::i#2 line_cursor#19 char_cursor#11 print_byte::b#3 ] )
to:print_byte::@1
print_byte::@1: scope:[print_byte] from print_byte
[35] (byte~) print_byte::$2 ← (byte) print_byte::b#3 & (byte/signed byte/word/signed word/dword/signed dword) 15 [ char_cursor#11 print_byte::$2 ] ( main:2::print_byte:10 [ main::i#2 line_cursor#19 char_cursor#11 print_byte::$2 ] main:2::print_word:14::print_byte:27 [ main::i#2 line_cursor#19 print_word::w#0 char_cursor#11 print_byte::$2 ] main:2::print_word:14::print_byte:29 [ main::i#2 line_cursor#19 char_cursor#11 print_byte::$2 ] )
[36] (byte) print_char::ch#1 ← *((const string) print_byte::hextab#0 + (byte~) print_byte::$2) [ char_cursor#11 print_char::ch#1 ] ( main:2::print_byte:10 [ main::i#2 line_cursor#19 char_cursor#11 print_char::ch#1 ] main:2::print_word:14::print_byte:27 [ main::i#2 line_cursor#19 print_word::w#0 char_cursor#11 print_char::ch#1 ] main:2::print_word:14::print_byte:29 [ main::i#2 line_cursor#19 char_cursor#11 print_char::ch#1 ] )
[37] call print_char param-assignment [ char_cursor#11 ] ( main:2::print_byte:10 [ main::i#2 line_cursor#19 char_cursor#11 ] main:2::print_word:14::print_byte:27 [ main::i#2 line_cursor#19 print_word::w#0 char_cursor#11 ] main:2::print_word:14::print_byte:29 [ main::i#2 line_cursor#19 char_cursor#11 ] )
to:print_byte::@return
print_byte::@return: scope:[print_byte] from print_byte::@1
[38] return [ char_cursor#11 ] ( main:2::print_byte:10 [ main::i#2 line_cursor#19 char_cursor#11 ] main:2::print_word:14::print_byte:27 [ main::i#2 line_cursor#19 print_word::w#0 char_cursor#11 ] main:2::print_word:14::print_byte:29 [ main::i#2 line_cursor#19 char_cursor#11 ] )
to:@return
print_char: scope:[print_char] from print_byte print_byte::@1
[39] (byte*) char_cursor#32 ← phi( print_byte/(byte*) char_cursor#45 print_byte::@1/(byte*) char_cursor#11 ) [ print_char::ch#2 char_cursor#32 ] ( main:2::print_byte:10::print_char:34 [ main::i#2 line_cursor#19 print_byte::b#3 print_char::ch#2 char_cursor#32 ] main:2::print_word:14::print_byte:27::print_char:34 [ main::i#2 line_cursor#19 print_word::w#0 print_byte::b#3 print_char::ch#2 char_cursor#32 ] main:2::print_word:14::print_byte:29::print_char:34 [ main::i#2 line_cursor#19 print_byte::b#3 print_char::ch#2 char_cursor#32 ] main:2::print_byte:10::print_char:37 [ main::i#2 line_cursor#19 print_char::ch#2 char_cursor#32 ] main:2::print_word:14::print_byte:27::print_char:37 [ main::i#2 line_cursor#19 print_word::w#0 print_char::ch#2 char_cursor#32 ] main:2::print_word:14::print_byte:29::print_char:37 [ main::i#2 line_cursor#19 print_char::ch#2 char_cursor#32 ] )
[39] (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 ) [ print_char::ch#2 char_cursor#32 ] ( main:2::print_byte:10::print_char:34 [ main::i#2 line_cursor#19 print_byte::b#3 print_char::ch#2 char_cursor#32 ] main:2::print_word:14::print_byte:27::print_char:34 [ main::i#2 line_cursor#19 print_word::w#0 print_byte::b#3 print_char::ch#2 char_cursor#32 ] main:2::print_word:14::print_byte:29::print_char:34 [ main::i#2 line_cursor#19 print_byte::b#3 print_char::ch#2 char_cursor#32 ] main:2::print_byte:10::print_char:37 [ main::i#2 line_cursor#19 print_char::ch#2 char_cursor#32 ] main:2::print_word:14::print_byte:27::print_char:37 [ main::i#2 line_cursor#19 print_word::w#0 print_char::ch#2 char_cursor#32 ] main:2::print_word:14::print_byte:29::print_char:37 [ main::i#2 line_cursor#19 print_char::ch#2 char_cursor#32 ] )
[40] *((byte*) char_cursor#32) ← (byte) print_char::ch#2 [ char_cursor#32 ] ( main:2::print_byte:10::print_char:34 [ main::i#2 line_cursor#19 print_byte::b#3 char_cursor#32 ] main:2::print_word:14::print_byte:27::print_char:34 [ main::i#2 line_cursor#19 print_word::w#0 print_byte::b#3 char_cursor#32 ] main:2::print_word:14::print_byte:29::print_char:34 [ main::i#2 line_cursor#19 print_byte::b#3 char_cursor#32 ] main:2::print_byte:10::print_char:37 [ main::i#2 line_cursor#19 char_cursor#32 ] main:2::print_word:14::print_byte:27::print_char:37 [ main::i#2 line_cursor#19 print_word::w#0 char_cursor#32 ] main:2::print_word:14::print_byte:29::print_char:37 [ main::i#2 line_cursor#19 char_cursor#32 ] )
[41] (byte*) char_cursor#11 ← ++ (byte*) char_cursor#32 [ char_cursor#11 ] ( main:2::print_byte:10::print_char:34 [ main::i#2 line_cursor#19 print_byte::b#3 char_cursor#11 ] main:2::print_word:14::print_byte:27::print_char:34 [ main::i#2 line_cursor#19 print_word::w#0 print_byte::b#3 char_cursor#11 ] main:2::print_word:14::print_byte:29::print_char:34 [ main::i#2 line_cursor#19 print_byte::b#3 char_cursor#11 ] main:2::print_byte:10::print_char:37 [ main::i#2 line_cursor#19 char_cursor#11 ] main:2::print_word:14::print_byte:27::print_char:37 [ main::i#2 line_cursor#19 print_word::w#0 char_cursor#11 ] main:2::print_word:14::print_byte:29::print_char:37 [ main::i#2 line_cursor#19 char_cursor#11 ] )
to:print_char::@return
print_char::@return: scope:[print_char] from print_char
[42] return [ char_cursor#11 ] ( main:2::print_byte:10::print_char:34 [ main::i#2 line_cursor#19 print_byte::b#3 char_cursor#11 ] main:2::print_word:14::print_byte:27::print_char:34 [ main::i#2 line_cursor#19 print_word::w#0 print_byte::b#3 char_cursor#11 ] main:2::print_word:14::print_byte:29::print_char:34 [ main::i#2 line_cursor#19 print_byte::b#3 char_cursor#11 ] main:2::print_byte:10::print_char:37 [ main::i#2 line_cursor#19 char_cursor#11 ] main:2::print_word:14::print_byte:27::print_char:37 [ main::i#2 line_cursor#19 print_word::w#0 char_cursor#11 ] main:2::print_word:14::print_byte:29::print_char:37 [ main::i#2 line_cursor#19 char_cursor#11 ] )
to:@return
print_str: scope:[print_str] from main::@5
[43] phi() [ char_cursor#11 ] ( main:2::print_str:12 [ main::i#2 line_cursor#19 char_cursor#11 ] )
to:print_str::@1
print_str::@1: scope:[print_str] from print_str print_str::@2
[44] (byte*) char_cursor#2 ← phi( print_str/(byte*) char_cursor#11 print_str::@2/(byte*) char_cursor#1 ) [ char_cursor#2 print_str::str#2 ] ( main:2::print_str:12 [ main::i#2 line_cursor#19 char_cursor#2 print_str::str#2 ] )
[44] (byte*) print_str::str#2 ← phi( print_str/(const string) main::str print_str::@2/(byte*) print_str::str#0 ) [ char_cursor#2 print_str::str#2 ] ( main:2::print_str:12 [ main::i#2 line_cursor#19 char_cursor#2 print_str::str#2 ] )
[45] if(*((byte*) print_str::str#2)!=(byte) '@') goto print_str::@2 [ char_cursor#2 print_str::str#2 ] ( main:2::print_str:12 [ main::i#2 line_cursor#19 char_cursor#2 print_str::str#2 ] )
to:print_str::@return
print_str::@return: scope:[print_str] from print_str::@1
[46] return [ char_cursor#2 ] ( main:2::print_str:12 [ main::i#2 line_cursor#19 char_cursor#2 ] )
to:@return
print_str::@2: scope:[print_str] from print_str::@1
[47] *((byte*) char_cursor#2) ← *((byte*) print_str::str#2) [ char_cursor#2 print_str::str#2 ] ( main:2::print_str:12 [ main::i#2 line_cursor#19 char_cursor#2 print_str::str#2 ] )
[48] (byte*) char_cursor#1 ← ++ (byte*) char_cursor#2 [ print_str::str#2 char_cursor#1 ] ( main:2::print_str:12 [ main::i#2 line_cursor#19 print_str::str#2 char_cursor#1 ] )
[49] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#2 [ print_str::str#0 char_cursor#1 ] ( main:2::print_str:12 [ main::i#2 line_cursor#19 print_str::str#0 char_cursor#1 ] )
to:print_str::@1
print_cls: scope:[print_cls] from main::@3
[50] phi() [ ] ( main:2::print_cls:7 [ ] )
to:print_cls::@1
print_cls::@1: scope:[print_cls] from print_cls print_cls::@1
[51] (byte*) print_cls::sc#2 ← phi( print_cls/(const byte*) SCREEN#0 print_cls::@1/(byte*) print_cls::sc#1 ) [ print_cls::sc#2 ] ( main:2::print_cls:7 [ print_cls::sc#2 ] )
[52] *((byte*) print_cls::sc#2) ← (byte) ' ' [ print_cls::sc#2 ] ( main:2::print_cls:7 [ print_cls::sc#2 ] )
[53] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2 [ print_cls::sc#1 ] ( main:2::print_cls:7 [ print_cls::sc#1 ] )
[54] if((byte*) print_cls::sc#1!=(const byte*) SCREEN#0+(word/signed word/dword/signed dword) 1000) goto print_cls::@1 [ print_cls::sc#1 ] ( main:2::print_cls:7 [ print_cls::sc#1 ] )
to:print_cls::@return
print_cls::@return: scope:[print_cls] from print_cls::@1
[55] return [ ] ( main:2::print_cls:7 [ ] )
to:@return
lin16u_gen: scope:[lin16u_gen] from main
[56] phi() [ ] ( main:2::lin16u_gen:5 [ ] )
[57] call div16u param-assignment [ div16u::return#0 rem16u#13 ] ( main:2::lin16u_gen:5 [ div16u::return#0 rem16u#13 ] )
[58] (word) div16u::return#2 ← (word) div16u::return#0 [ div16u::return#2 rem16u#13 ] ( main:2::lin16u_gen:5 [ div16u::return#2 rem16u#13 ] )
to:lin16u_gen::@3
lin16u_gen::@3: scope:[lin16u_gen] from lin16u_gen
[59] (word) lin16u_gen::stepi#0 ← (word) div16u::return#2 [ lin16u_gen::stepi#0 rem16u#13 ] ( main:2::lin16u_gen:5 [ lin16u_gen::stepi#0 rem16u#13 ] )
[60] (word) divr16u::rem#4 ← (word) rem16u#13 [ lin16u_gen::stepi#0 divr16u::rem#4 ] ( main:2::lin16u_gen:5 [ lin16u_gen::stepi#0 divr16u::rem#4 ] )
[61] call divr16u param-assignment [ lin16u_gen::stepi#0 divr16u::return#1 ] ( main:2::lin16u_gen:5 [ lin16u_gen::stepi#0 divr16u::return#1 ] )
[62] (word) divr16u::return#3 ← (word) divr16u::return#1 [ lin16u_gen::stepi#0 divr16u::return#3 ] ( main:2::lin16u_gen:5 [ lin16u_gen::stepi#0 divr16u::return#3 ] )
to:lin16u_gen::@4
lin16u_gen::@4: scope:[lin16u_gen] from lin16u_gen::@3
[63] (word) lin16u_gen::stepf#0 ← (word) divr16u::return#3 [ lin16u_gen::stepi#0 lin16u_gen::stepf#0 ] ( main:2::lin16u_gen:5 [ lin16u_gen::stepi#0 lin16u_gen::stepf#0 ] )
[64] (dword) lin16u_gen::step#0 ← (word) lin16u_gen::stepi#0 dw= (word) lin16u_gen::stepf#0 [ lin16u_gen::step#0 ] ( main:2::lin16u_gen:5 [ lin16u_gen::step#0 ] )
to:lin16u_gen::@1
lin16u_gen::@1: scope:[lin16u_gen] from lin16u_gen::@1 lin16u_gen::@4
[65] (word) lin16u_gen::i#2 ← phi( lin16u_gen::@1/(word) lin16u_gen::i#1 lin16u_gen::@4/(byte/signed byte/word/signed word/dword/signed dword) 0 ) [ lin16u_gen::step#0 lin16u_gen::val#2 lin16u_gen::lintab#2 lin16u_gen::i#2 ] ( main:2::lin16u_gen:5 [ lin16u_gen::step#0 lin16u_gen::val#2 lin16u_gen::lintab#2 lin16u_gen::i#2 ] )
[65] (word*) lin16u_gen::lintab#2 ← phi( lin16u_gen::@1/(word*) lin16u_gen::lintab#1 lin16u_gen::@4/(const word[20]) main::lintab#0 ) [ lin16u_gen::step#0 lin16u_gen::val#2 lin16u_gen::lintab#2 lin16u_gen::i#2 ] ( main:2::lin16u_gen:5 [ lin16u_gen::step#0 lin16u_gen::val#2 lin16u_gen::lintab#2 lin16u_gen::i#2 ] )
[65] (dword) lin16u_gen::val#2 ← phi( lin16u_gen::@1/(dword) lin16u_gen::val#1 lin16u_gen::@4/(const word) lin16u_gen::min#0*(dword/signed dword) 65536+(byte/signed byte/word/signed word/dword/signed dword) 0 ) [ lin16u_gen::step#0 lin16u_gen::val#2 lin16u_gen::lintab#2 lin16u_gen::i#2 ] ( main:2::lin16u_gen:5 [ lin16u_gen::step#0 lin16u_gen::val#2 lin16u_gen::lintab#2 lin16u_gen::i#2 ] )
[66] (word~) lin16u_gen::$5 ← > (dword) lin16u_gen::val#2 [ lin16u_gen::step#0 lin16u_gen::val#2 lin16u_gen::lintab#2 lin16u_gen::i#2 lin16u_gen::$5 ] ( main:2::lin16u_gen:5 [ lin16u_gen::step#0 lin16u_gen::val#2 lin16u_gen::lintab#2 lin16u_gen::i#2 lin16u_gen::$5 ] )
[67] *((word*) lin16u_gen::lintab#2) ← (word~) lin16u_gen::$5 [ lin16u_gen::step#0 lin16u_gen::val#2 lin16u_gen::lintab#2 lin16u_gen::i#2 ] ( main:2::lin16u_gen:5 [ lin16u_gen::step#0 lin16u_gen::val#2 lin16u_gen::lintab#2 lin16u_gen::i#2 ] )
[68] (dword) lin16u_gen::val#1 ← (dword) lin16u_gen::val#2 + (dword) lin16u_gen::step#0 [ lin16u_gen::step#0 lin16u_gen::lintab#2 lin16u_gen::i#2 lin16u_gen::val#1 ] ( main:2::lin16u_gen:5 [ lin16u_gen::step#0 lin16u_gen::lintab#2 lin16u_gen::i#2 lin16u_gen::val#1 ] )
[69] (word*) lin16u_gen::lintab#1 ← (word*) lin16u_gen::lintab#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 [ lin16u_gen::step#0 lin16u_gen::i#2 lin16u_gen::val#1 lin16u_gen::lintab#1 ] ( main:2::lin16u_gen:5 [ lin16u_gen::step#0 lin16u_gen::i#2 lin16u_gen::val#1 lin16u_gen::lintab#1 ] )
[70] (word) lin16u_gen::i#1 ← ++ (word) lin16u_gen::i#2 [ lin16u_gen::step#0 lin16u_gen::val#1 lin16u_gen::lintab#1 lin16u_gen::i#1 ] ( main:2::lin16u_gen:5 [ lin16u_gen::step#0 lin16u_gen::val#1 lin16u_gen::lintab#1 lin16u_gen::i#1 ] )
[71] if((word) lin16u_gen::i#1<(const word) lin16u_gen::length#0) goto lin16u_gen::@1 [ lin16u_gen::step#0 lin16u_gen::val#1 lin16u_gen::lintab#1 lin16u_gen::i#1 ] ( main:2::lin16u_gen:5 [ lin16u_gen::step#0 lin16u_gen::val#1 lin16u_gen::lintab#1 lin16u_gen::i#1 ] )
to:lin16u_gen::@return
lin16u_gen::@return: scope:[lin16u_gen] from lin16u_gen::@1
[72] return [ ] ( main:2::lin16u_gen:5 [ ] )
to:@return
divr16u: scope:[divr16u] from div16u lin16u_gen::@3
[73] (word) divr16u::divisor#6 ← phi( div16u/(const word) div16u::divisor#0 lin16u_gen::@3/(const word) lin16u_gen::length#0-(byte/signed byte/word/signed word/dword/signed dword) 1 ) [ divr16u::rem#10 divr16u::dividend#5 divr16u::divisor#6 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::rem#10 divr16u::dividend#5 divr16u::divisor#6 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::rem#10 divr16u::dividend#5 divr16u::divisor#6 ] )
[73] (word) divr16u::dividend#5 ← phi( div16u/(const word) lin16u_gen::ampl#0 lin16u_gen::@3/(byte/signed byte/word/signed word/dword/signed dword) 0 ) [ divr16u::rem#10 divr16u::dividend#5 divr16u::divisor#6 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::rem#10 divr16u::dividend#5 divr16u::divisor#6 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::rem#10 divr16u::dividend#5 divr16u::divisor#6 ] )
[73] (word) divr16u::rem#10 ← phi( div16u/(byte/signed byte/word/signed word/dword/signed dword) 0 lin16u_gen::@3/(word) divr16u::rem#4 ) [ divr16u::rem#10 divr16u::dividend#5 divr16u::divisor#6 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::rem#10 divr16u::dividend#5 divr16u::divisor#6 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::rem#10 divr16u::dividend#5 divr16u::divisor#6 ] )
to:divr16u::@1
divr16u::@1: scope:[divr16u] from divr16u divr16u::@3
[74] (byte) divr16u::i#2 ← phi( divr16u/(byte/signed byte/word/signed word/dword/signed dword) 0 divr16u::@3/(byte) divr16u::i#1 ) [ divr16u::divisor#6 divr16u::rem#5 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::divisor#6 divr16u::rem#5 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::divisor#6 divr16u::rem#5 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 ] )
[74] (word) divr16u::quotient#3 ← phi( divr16u/(byte/signed byte/word/signed word/dword/signed dword) 0 divr16u::@3/(word) divr16u::return#1 ) [ divr16u::divisor#6 divr16u::rem#5 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::divisor#6 divr16u::rem#5 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::divisor#6 divr16u::rem#5 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 ] )
[74] (word) divr16u::dividend#3 ← phi( divr16u/(word) divr16u::dividend#5 divr16u::@3/(word) divr16u::dividend#1 ) [ divr16u::divisor#6 divr16u::rem#5 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::divisor#6 divr16u::rem#5 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::divisor#6 divr16u::rem#5 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 ] )
[74] (word) divr16u::rem#5 ← phi( divr16u/(word) divr16u::rem#10 divr16u::@3/(word) divr16u::rem#11 ) [ divr16u::divisor#6 divr16u::rem#5 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::divisor#6 divr16u::rem#5 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::divisor#6 divr16u::rem#5 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 ] )
[75] (word) divr16u::rem#1 ← (word) divr16u::rem#5 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] )
[76] (byte~) divr16u::$1 ← > (word) divr16u::dividend#3 [ divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 divr16u::$1 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 divr16u::$1 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 divr16u::$1 ] )
[77] (byte~) divr16u::$2 ← (byte~) divr16u::$1 & (byte/word/signed word/dword/signed dword) 128 [ divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 divr16u::$2 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 divr16u::$2 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 divr16u::$2 ] )
[78] if((byte~) divr16u::$2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto divr16u::@2 [ divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] )
to:divr16u::@4
divr16u::@4: scope:[divr16u] from divr16u::@1
[79] (word) divr16u::rem#2 ← ++ (word) divr16u::rem#1 [ divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#2 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#2 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#2 ] )
to:divr16u::@2
divr16u::@2: scope:[divr16u] from divr16u::@1 divr16u::@4
[80] (word) divr16u::rem#6 ← phi( divr16u::@1/(word) divr16u::rem#1 divr16u::@4/(word) divr16u::rem#2 ) [ divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#6 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#6 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::divisor#6 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#6 ] )
[81] (word) divr16u::dividend#1 ← (word) divr16u::dividend#3 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ divr16u::divisor#6 divr16u::quotient#3 divr16u::i#2 divr16u::dividend#1 divr16u::rem#6 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::divisor#6 divr16u::quotient#3 divr16u::i#2 divr16u::dividend#1 divr16u::rem#6 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::divisor#6 divr16u::quotient#3 divr16u::i#2 divr16u::dividend#1 divr16u::rem#6 ] )
[82] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ divr16u::divisor#6 divr16u::i#2 divr16u::dividend#1 divr16u::rem#6 divr16u::quotient#1 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::divisor#6 divr16u::i#2 divr16u::dividend#1 divr16u::rem#6 divr16u::quotient#1 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::divisor#6 divr16u::i#2 divr16u::dividend#1 divr16u::rem#6 divr16u::quotient#1 ] )
[83] if((word) divr16u::rem#6<(word) divr16u::divisor#6) goto divr16u::@3 [ divr16u::divisor#6 divr16u::i#2 divr16u::dividend#1 divr16u::rem#6 divr16u::quotient#1 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::divisor#6 divr16u::i#2 divr16u::dividend#1 divr16u::rem#6 divr16u::quotient#1 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::divisor#6 divr16u::i#2 divr16u::dividend#1 divr16u::rem#6 divr16u::quotient#1 ] )
to:divr16u::@5
divr16u::@5: scope:[divr16u] from divr16u::@2
[84] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1 [ divr16u::divisor#6 divr16u::i#2 divr16u::dividend#1 divr16u::rem#6 divr16u::quotient#2 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::divisor#6 divr16u::i#2 divr16u::dividend#1 divr16u::rem#6 divr16u::quotient#2 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::divisor#6 divr16u::i#2 divr16u::dividend#1 divr16u::rem#6 divr16u::quotient#2 ] )
[85] (word) divr16u::rem#3 ← (word) divr16u::rem#6 - (word) divr16u::divisor#6 [ divr16u::divisor#6 divr16u::i#2 divr16u::dividend#1 divr16u::quotient#2 divr16u::rem#3 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::divisor#6 divr16u::i#2 divr16u::dividend#1 divr16u::quotient#2 divr16u::rem#3 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::divisor#6 divr16u::i#2 divr16u::dividend#1 divr16u::quotient#2 divr16u::rem#3 ] )
to:divr16u::@3
divr16u::@3: scope:[divr16u] from divr16u::@2 divr16u::@5
[86] (word) divr16u::return#1 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 ) [ divr16u::return#1 divr16u::divisor#6 divr16u::i#2 divr16u::rem#11 divr16u::dividend#1 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::return#1 divr16u::divisor#6 divr16u::i#2 divr16u::rem#11 divr16u::dividend#1 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::return#1 divr16u::divisor#6 divr16u::i#2 divr16u::rem#11 divr16u::dividend#1 ] )
[86] (word) divr16u::rem#11 ← phi( divr16u::@2/(word) divr16u::rem#6 divr16u::@5/(word) divr16u::rem#3 ) [ divr16u::return#1 divr16u::divisor#6 divr16u::i#2 divr16u::rem#11 divr16u::dividend#1 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::return#1 divr16u::divisor#6 divr16u::i#2 divr16u::rem#11 divr16u::dividend#1 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::return#1 divr16u::divisor#6 divr16u::i#2 divr16u::rem#11 divr16u::dividend#1 ] )
[87] (byte) divr16u::i#1 ← ++ (byte) divr16u::i#2 [ divr16u::return#1 divr16u::divisor#6 divr16u::rem#11 divr16u::dividend#1 divr16u::i#1 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::return#1 divr16u::divisor#6 divr16u::rem#11 divr16u::dividend#1 divr16u::i#1 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::return#1 divr16u::divisor#6 divr16u::rem#11 divr16u::dividend#1 divr16u::i#1 ] )
[88] if((byte) divr16u::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 16) goto divr16u::@1 [ divr16u::return#1 divr16u::divisor#6 divr16u::rem#11 divr16u::dividend#1 divr16u::i#1 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 divr16u::return#1 divr16u::divisor#6 divr16u::rem#11 divr16u::dividend#1 divr16u::i#1 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ divr16u::return#1 divr16u::divisor#6 divr16u::rem#11 divr16u::dividend#1 divr16u::i#1 ] )
to:divr16u::@6
divr16u::@6: scope:[divr16u] from divr16u::@3
[89] (word) rem16u#13 ← (word) divr16u::rem#11 [ rem16u#13 divr16u::return#1 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 rem16u#13 divr16u::return#1 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ rem16u#13 divr16u::return#1 ] )
to:divr16u::@return
divr16u::@return: scope:[divr16u] from divr16u::@6
[90] return [ rem16u#13 divr16u::return#1 ] ( main:2::lin16u_gen:5::divr16u:61 [ lin16u_gen::stepi#0 rem16u#13 divr16u::return#1 ] main:2::lin16u_gen:5::div16u:57::divr16u:92 [ rem16u#13 divr16u::return#1 ] )
to:@return
div16u: scope:[div16u] from lin16u_gen
[91] phi() [ ] ( main:2::lin16u_gen:5::div16u:57 [ ] )
[92] call divr16u param-assignment [ rem16u#13 divr16u::return#1 ] ( main:2::lin16u_gen:5::div16u:57 [ rem16u#13 divr16u::return#1 ] )
[93] (word) divr16u::return#0 ← (word) divr16u::return#1 [ rem16u#13 divr16u::return#0 ] ( main:2::lin16u_gen:5::div16u:57 [ rem16u#13 divr16u::return#0 ] )
to:div16u::@2
div16u::@2: scope:[div16u] from div16u
[94] (word) div16u::return#0 ← (word) divr16u::return#0 [ div16u::return#0 rem16u#13 ] ( main:2::lin16u_gen:5::div16u:57 [ div16u::return#0 rem16u#13 ] )
to:div16u::@return
div16u::@return: scope:[div16u] from div16u::@2
[95] return [ div16u::return#0 rem16u#13 ] ( main:2::lin16u_gen:5::div16u:57 [ div16u::return#0 rem16u#13 ] )
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,163 @@
(label) @18
(label) @begin
(label) @end
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024
(byte*) char_cursor
(byte*) char_cursor#1 char_cursor zp ZP_WORD:5 101.0
(byte*) char_cursor#11 char_cursor zp ZP_WORD:5 5.449999999999998
(byte*) char_cursor#2 char_cursor zp ZP_WORD:5 43.85714285714286
(byte*) char_cursor#32 char_cursor zp ZP_WORD:5 4.0
(byte*) char_cursor#45 char_cursor zp ZP_WORD:5 5.666666666666667
(byte*) char_cursor#47 char_cursor zp ZP_WORD:5 11.0
(byte*~) char_cursor#51 char_cursor zp ZP_WORD:5 22.0
(word()) div16u((word) div16u::dividend , (word) div16u::divisor)
(label) div16u::@2
(label) div16u::@return
(word) div16u::dividend
(word) div16u::divisor
(const word) div16u::divisor#0 divisor = (const word) lin16u_gen::length#0-(byte/signed byte/word/signed word/dword/signed dword) 1
(word) div16u::return
(word) div16u::return#0 return zp ZP_WORD:13 1.3333333333333333
(word) div16u::return#2 return zp ZP_WORD:13 4.0
(word()) divr16u((word) divr16u::dividend , (word) divr16u::divisor , (word) divr16u::rem)
(byte~) divr16u::$1 reg byte a 22.0
(byte~) divr16u::$2 reg byte a 22.0
(label) divr16u::@1
(label) divr16u::@2
(label) divr16u::@3
(label) divr16u::@4
(label) divr16u::@5
(label) divr16u::@6
(label) divr16u::@return
(word) divr16u::dividend
(word) divr16u::dividend#1 dividend zp ZP_WORD:7 2.75
(word) divr16u::dividend#3 dividend zp ZP_WORD:7 5.0
(word) divr16u::dividend#5 dividend zp ZP_WORD:7 2.0
(word) divr16u::divisor
(word) divr16u::divisor#6 divisor zp ZP_WORD:3 1.375
(byte) divr16u::i
(byte) divr16u::i#1 reg byte x 16.5
(byte) divr16u::i#2 reg byte x 1.6923076923076923
(word) divr16u::quotient
(word) divr16u::quotient#1 quotient zp ZP_WORD:13 16.5
(word) divr16u::quotient#2 quotient zp ZP_WORD:13 11.0
(word) divr16u::quotient#3 quotient zp ZP_WORD:13 2.75
(word) divr16u::rem
(word) divr16u::rem#1 rem zp ZP_WORD:5 8.25
(word) divr16u::rem#10 rem zp ZP_WORD:5 4.0
(word) divr16u::rem#11 rem zp ZP_WORD:5 11.666666666666666
(word) divr16u::rem#2 rem zp ZP_WORD:5 22.0
(word) divr16u::rem#3 rem zp ZP_WORD:5 22.0
(word) divr16u::rem#4 rem zp ZP_WORD:5 4.0
(word) divr16u::rem#5 rem zp ZP_WORD:5 24.0
(word) divr16u::rem#6 rem zp ZP_WORD:5 11.0
(word) divr16u::return
(word) divr16u::return#0 return zp ZP_WORD:13 4.0
(word) divr16u::return#1 return zp ZP_WORD:13 5.285714285714286
(word) divr16u::return#3 return zp ZP_WORD:13 4.0
(void()) lin16u_gen((word) lin16u_gen::min , (word) lin16u_gen::max , (word*) lin16u_gen::lintab , (word) lin16u_gen::length)
(word~) lin16u_gen::$5 $5 zp ZP_WORD:7 22.0
(label) lin16u_gen::@1
(label) lin16u_gen::@3
(label) lin16u_gen::@4
(label) lin16u_gen::@return
(word) lin16u_gen::ampl
(const word) lin16u_gen::ampl#0 ampl = (const word) lin16u_gen::max#0-(const word) lin16u_gen::min#0
(word) lin16u_gen::i
(word) lin16u_gen::i#1 i zp ZP_WORD:5 16.5
(word) lin16u_gen::i#2 i zp ZP_WORD:5 4.4
(word) lin16u_gen::length
(const word) lin16u_gen::length#0 length = (byte/signed byte/word/signed word/dword/signed dword) 20
(word*) lin16u_gen::lintab
(word*) lin16u_gen::lintab#1 lintab zp ZP_WORD:3 7.333333333333333
(word*) lin16u_gen::lintab#2 lintab zp ZP_WORD:3 8.25
(word) lin16u_gen::max
(const word) lin16u_gen::max#0 max = (word/signed word/dword/signed dword) 29793
(word) lin16u_gen::min
(const word) lin16u_gen::min#0 min = (word/signed word/dword/signed dword) 557
(dword) lin16u_gen::step
(dword) lin16u_gen::step#0 step zp ZP_DWORD:17 1.625
(word) lin16u_gen::stepf
(word) lin16u_gen::stepf#0 stepf zp ZP_WORD:13 4.0
(word) lin16u_gen::stepi
(word) lin16u_gen::stepi#0 stepi zp ZP_WORD:15 0.8
(dword) lin16u_gen::val
(dword) lin16u_gen::val#1 val zp ZP_DWORD:9 5.5
(dword) lin16u_gen::val#2 val zp ZP_DWORD:9 11.0
(byte*) line_cursor
(byte*) line_cursor#1 line_cursor zp ZP_WORD:3 46.42857142857143
(byte*) line_cursor#19 line_cursor zp ZP_WORD:3 1.4444444444444446
(byte*) line_cursor#9 line_cursor zp ZP_WORD:3 204.0
(void()) main()
(label) main::@1
(label) main::@3
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@8
(label) main::@9
(label) main::@return
(byte) main::i
(byte) main::i#1 i zp ZP_BYTE:2 11.0
(byte) main::i#2 i zp ZP_BYTE:2 4.888888888888889
(word[20]) main::lintab
(const word[20]) main::lintab#0 lintab = { fill( 20, 0) }
(const string) main::str str = (string) " @"
(void()) print_byte((byte) print_byte::b)
(byte~) print_byte::$0 reg byte a 4.0
(byte~) print_byte::$2 reg byte a 4.0
(label) print_byte::@1
(label) print_byte::@return
(byte) print_byte::b
(byte) print_byte::b#0 reg byte x 4.0
(byte) print_byte::b#1 reg byte x 4.0
(byte) print_byte::b#2 reg byte x 22.0
(byte) print_byte::b#3 reg byte x 4.75
(byte[]) print_byte::hextab
(const string) print_byte::hextab#0 hextab = (string) "0123456789abcdef"
(void()) print_char((byte) print_char::ch)
(label) print_char::@return
(byte) print_char::ch
(byte) print_char::ch#0 reg byte a 4.0
(byte) print_char::ch#1 reg byte a 4.0
(byte) print_char::ch#2 reg byte a 6.0
(void()) print_cls()
(label) print_cls::@1
(label) print_cls::@return
(byte*) print_cls::sc
(byte*) print_cls::sc#1 sc zp ZP_WORD:3 16.5
(byte*) print_cls::sc#2 sc zp ZP_WORD:3 16.5
(void()) print_ln()
(label) print_ln::@1
(label) print_ln::@return
(void()) print_str((byte*) print_str::str)
(label) print_str::@1
(label) print_str::@2
(label) print_str::@return
(byte*) print_str::str
(byte*) print_str::str#0 str zp ZP_WORD:7 202.0
(byte*) print_str::str#2 str zp ZP_WORD:7 101.0
(void()) print_word((word) print_word::w)
(label) print_word::@1
(label) print_word::@return
(word) print_word::w
(word) print_word::w#0 w zp ZP_WORD:7 5.0
(word) rem16u
(word) rem16u#13 rem16u zp ZP_WORD:5 0.4444444444444444
zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
zp ZP_WORD:3 [ line_cursor#9 line_cursor#19 line_cursor#1 print_cls::sc#2 print_cls::sc#1 lin16u_gen::lintab#2 lin16u_gen::lintab#1 divr16u::divisor#6 ]
reg byte x [ print_byte::b#3 print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
reg byte a [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
zp ZP_WORD:5 [ char_cursor#32 char_cursor#45 char_cursor#47 char_cursor#51 char_cursor#2 char_cursor#11 char_cursor#1 lin16u_gen::i#2 lin16u_gen::i#1 divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#1 divr16u::rem#2 divr16u::rem#3 rem16u#13 ]
zp ZP_WORD:7 [ print_str::str#2 print_str::str#0 divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#1 print_word::w#0 lin16u_gen::$5 ]
zp ZP_DWORD:9 [ lin16u_gen::val#2 lin16u_gen::val#1 ]
zp ZP_WORD:13 [ divr16u::quotient#3 divr16u::return#1 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#3 lin16u_gen::stepf#0 divr16u::return#0 div16u::return#0 div16u::return#2 ]
reg byte x [ divr16u::i#2 divr16u::i#1 ]
reg byte a [ print_byte::$0 ]
reg byte a [ print_byte::$2 ]
zp ZP_WORD:15 [ lin16u_gen::stepi#0 ]
zp ZP_DWORD:17 [ lin16u_gen::step#0 ]
reg byte a [ divr16u::$1 ]
reg byte a [ divr16u::$2 ]

View File

@ -4,8 +4,9 @@
.label SCREEN = $400
.label char_cursor = $a
.label line_cursor = 5
.label rem16u = 3
.label rem16s = 3
.label rem8u = $13
.label rem16u = $10
jsr main
main: {
jsr print_cls
@ -17,7 +18,7 @@ main: {
}
test_16s: {
.label dividend = 7
.label divisor = $14
.label divisor = $15
.label res = $e
.label i = 2
lda #<0
@ -188,13 +189,13 @@ print_str: {
jmp b1
}
div16s: {
.label _2 = $a
.label _2 = 3
.label _7 = $c
.label resultu = $e
.label return = $e
.label dividend = 7
.label divisor = $c
.label dividendu = $a
.label dividendu = 3
.label divisoru = $c
lda dividend+1
bpl b16
@ -227,15 +228,19 @@ div16s: {
jsr div16u
cpy #0
bne b5
lda divr16u.rem
sta rem16s
lda divr16u.rem+1
sta rem16s+1
breturn:
rts
b5:
sec
lda rem16s
lda divr16u.rem
eor #$ff
adc #0
sta rem16s
lda rem16s+1
lda divr16u.rem+1
eor #$ff
adc #0
sta rem16s+1
@ -258,11 +263,18 @@ div16s: {
jmp b2
}
div16u: {
.label rem = 3
.label dividend = $a
.label quotient = $e
.label return = $e
.label dividend = 3
.label divisor = $c
jsr divr16u
rts
}
divr16u: {
.label dividend = 3
.label divisor = $c
.label return = $e
.label rem = $10
.label quotient = $e
ldx #0
txa
sta quotient
@ -312,8 +324,8 @@ div16u: {
}
test_8s: {
.label dividend = 9
.label divisor = $16
.label res = $10
.label divisor = $17
.label res = $12
.label i = 2
lda #0
tax
@ -385,7 +397,7 @@ print_sbyte: {
rts
}
div8s: {
.label neg = $10
.label neg = $12
cmp #0
bpl b16
eor #$ff
@ -406,18 +418,18 @@ div8s: {
eor #1
sta neg
b4:
sty div8u.dividend
stx div8u.divisor
tya
jsr div8u
lda div8u.return
txa
tay
lda neg
bne b5
tya
ldx divr8u.rem
breturn:
rts
b5:
txa
lda divr8u.rem
eor #$ff
clc
adc #1
@ -434,39 +446,42 @@ div8s: {
jmp b2
}
div8u: {
.label dividend = $12
.label quotient = $13
.label return = $13
.label divisor = $11
sta divr8u.dividend
stx divr8u.divisor
jsr divr8u
rts
}
divr8u: {
.label dividend = $14
.label divisor = $18
.label rem = $13
ldy #0
ldx #0
txa
sta quotient
tay
sta rem
b1:
tya
asl
tay
asl rem
lda #$80
and dividend
cmp #0
beq b2
iny
inc rem
b2:
asl dividend
asl quotient
cpy divisor
txa
asl
tax
lda rem
cmp divisor
bcc b3
inc quotient
tya
inx
sec
sbc divisor
tay
sta rem
b3:
inx
cpx #8
iny
cpy #8
bne b1
tya
tax
rts
}
test_16u: {
@ -523,9 +538,9 @@ test_16u: {
lda #>str2
sta print_str.str+1
jsr print_str
lda rem16u
lda divr16u.rem
sta print_word.w
lda rem16u+1
lda divr16u.rem+1
sta print_word.w+1
jsr print_word
jsr print_ln
@ -544,8 +559,7 @@ test_16u: {
}
test_8u: {
.label dividend = 9
.label divisor = $11
.label res = $10
.label divisor = $12
.label i = 2
lda #<SCREEN
sta line_cursor
@ -555,8 +569,8 @@ test_8u: {
sta char_cursor
lda #>SCREEN
sta char_cursor+1
ldx #0
txa
lda #0
sta rem8u
sta i
b1:
ldy i
@ -565,10 +579,8 @@ test_8u: {
lda divisors,y
sta divisor
lda dividend
sta div8u.dividend
ldx divisor
jsr div8u
lda div8u.return
sta res
jsr print_byte
lda #<str
sta print_str.str
@ -583,15 +595,15 @@ test_8u: {
lda #>str1
sta print_str.str+1
jsr print_str
lda res
sta print_byte.b
stx print_byte.b
jsr print_byte
lda #<str2
sta print_str.str
lda #>str2
sta print_str.str+1
jsr print_str
stx print_byte.b
lda divr8u.rem
sta print_byte.b
jsr print_byte
jsr print_ln
inc i

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
(label) @19
(label) @21
(label) @begin
(label) @end
(byte*) SCREEN
@ -20,7 +20,7 @@
(byte*~) char_cursor#185 char_cursor zp ZP_WORD:10 22.0
(byte*) char_cursor#80 char_cursor zp ZP_WORD:10 6.0
(signed word()) div16s((signed word) div16s::dividend , (signed word) div16s::divisor)
(signed word~) div16s::$2 $2 zp ZP_WORD:10 2.0
(signed word~) div16s::$2 $2 zp ZP_WORD:3 2.0
(signed word~) div16s::$7 $7 zp ZP_WORD:12 1.0
(label) div16s::@15
(label) div16s::@16
@ -35,9 +35,9 @@
(signed word) div16s::dividend
(signed word) div16s::dividend#0 dividend zp ZP_WORD:7 5.0
(word) div16s::dividendu
(word) div16s::dividendu#3 dividendu zp ZP_WORD:10 0.8571428571428571
(word~) div16s::dividendu#7 dividendu zp ZP_WORD:10 4.0
(word~) div16s::dividendu#8 dividendu zp ZP_WORD:10 4.0
(word) div16s::dividendu#3 dividendu zp ZP_WORD:3 0.8571428571428571
(word~) div16s::dividendu#7 dividendu zp ZP_WORD:3 4.0
(word~) div16s::dividendu#8 dividendu zp ZP_WORD:3 4.0
(signed word) div16s::divisor
(signed word) div16s::divisor#0 divisor zp ZP_WORD:12 2.142857142857143
(word) div16s::divisoru
@ -56,41 +56,18 @@
(signed word) div16s::return#3 return zp ZP_WORD:14 22.0
(signed word~) div16s::return#6 return zp ZP_WORD:14 2.0
(word()) div16u((word) div16u::dividend , (word) div16u::divisor)
(byte~) div16u::$1 reg byte a 202.0
(byte~) div16u::$2 reg byte a 202.0
(label) div16u::@1
(label) div16u::@2
(label) div16u::@3
(label) div16u::@4
(label) div16u::@5
(label) div16u::@6
(label) div16u::@return
(word) div16u::dividend
(word) div16u::dividend#0 dividend zp ZP_WORD:10 25.25
(word) div16u::dividend#1 dividend zp ZP_WORD:10 2.0
(word) div16u::dividend#2 dividend zp ZP_WORD:10 11.0
(word) div16u::dividend#3 dividend zp ZP_WORD:10 43.57142857142858
(word) div16u::dividend#5 dividend zp ZP_WORD:10 15.0
(word) div16u::dividend#0 dividend zp ZP_WORD:3 2.0
(word) div16u::dividend#1 dividend zp ZP_WORD:3 11.0
(word) div16u::dividend#2 dividend zp ZP_WORD:3 15.0
(word) div16u::divisor
(word) div16u::divisor#0 divisor zp ZP_WORD:12 4.0
(word) div16u::divisor#1 divisor zp ZP_WORD:12 22.0
(word) div16u::divisor#6 divisor zp ZP_WORD:12 13.4375
(byte) div16u::i
(byte) div16u::i#1 reg byte x 151.5
(byte) div16u::i#2 reg byte x 15.538461538461538
(word) div16u::quotient
(word) div16u::quotient#1 quotient zp ZP_WORD:14 151.5
(word) div16u::quotient#2 quotient zp ZP_WORD:14 101.0
(word) div16u::quotient#3 quotient zp ZP_WORD:14 25.25
(word) div16u::rem
(word) div16u::rem#1 rem zp ZP_WORD:3 75.75
(word) div16u::rem#2 rem zp ZP_WORD:3 202.0
(word) div16u::rem#3 rem zp ZP_WORD:3 202.0
(word) div16u::rem#4 rem zp ZP_WORD:3 202.0
(word) div16u::rem#5 rem zp ZP_WORD:3 101.0
(word) div16u::rem#8 rem zp ZP_WORD:3 101.66666666666667
(word) div16u::divisor#2 divisor zp ZP_WORD:12 7.5
(word) div16u::return
(word) div16u::return#0 return zp ZP_WORD:14 45.142857142857146
(word) div16u::return#0 return zp ZP_WORD:14 3.75
(word) div16u::return#2 return zp ZP_WORD:14 4.0
(word) div16u::return#3 return zp ZP_WORD:14 22.0
(signed byte()) div8s((signed byte) div8s::dividend , (signed byte) div8s::divisor)
@ -119,9 +96,9 @@
(byte~) div8s::divisoru#4 reg byte x 4.0
(byte~) div8s::divisoru#5 reg byte x 4.0
(byte) div8s::neg
(byte) div8s::neg#2 neg zp ZP_BYTE:16 2.0
(byte) div8s::neg#3 neg zp ZP_BYTE:16 1.0
(byte) div8s::neg#4 neg zp ZP_BYTE:16 1.0
(byte) div8s::neg#2 neg zp ZP_BYTE:18 2.0
(byte) div8s::neg#3 neg zp ZP_BYTE:18 1.0
(byte) div8s::neg#4 neg zp ZP_BYTE:18 1.0
(byte) div8s::resultu
(byte) div8s::resultu#0 reg byte y 0.6666666666666666
(signed byte) div8s::return
@ -130,42 +107,83 @@
(signed byte) div8s::return#3 reg byte a 22.0
(signed byte~) div8s::return#6 reg byte a 2.0
(byte()) div8u((byte) div8u::dividend , (byte) div8u::divisor)
(byte~) div8u::$1 reg byte a 202.0
(label) div8u::@1
(label) div8u::@2
(label) div8u::@3
(label) div8u::@4
(label) div8u::@5
(label) div8u::@6
(label) div8u::@return
(byte) div8u::dividend
(byte) div8u::dividend#0 dividend zp ZP_BYTE:18 25.25
(byte) div8u::dividend#1 dividend zp ZP_BYTE:18 2.0
(byte) div8u::dividend#2 dividend zp ZP_BYTE:18 11.0
(byte) div8u::dividend#3 dividend zp ZP_BYTE:18 50.83333333333333
(byte) div8u::dividend#5 dividend zp ZP_BYTE:18 15.0
(byte) div8u::dividend#0 reg byte a 2.0
(byte) div8u::dividend#1 reg byte a 11.0
(byte) div8u::dividend#2 reg byte a 15.0
(byte) div8u::divisor
(byte) div8u::divisor#0 divisor zp ZP_BYTE:17 4.0
(byte) div8u::divisor#1 divisor zp ZP_BYTE:17 22.0
(byte) div8u::divisor#6 divisor zp ZP_BYTE:17 14.333333333333332
(byte) div8u::i
(byte) div8u::i#1 reg byte x 151.5
(byte) div8u::i#2 reg byte x 16.833333333333332
(byte) div8u::quotient
(byte) div8u::quotient#1 quotient zp ZP_BYTE:19 151.5
(byte) div8u::quotient#2 quotient zp ZP_BYTE:19 101.0
(byte) div8u::quotient#3 quotient zp ZP_BYTE:19 28.857142857142858
(byte) div8u::rem
(byte) div8u::rem#1 reg byte y 101.0
(byte) div8u::rem#2 reg byte y 202.0
(byte) div8u::rem#3 reg byte y 202.0
(byte) div8u::rem#4 reg byte y 202.0
(byte) div8u::rem#5 reg byte y 101.0
(byte) div8u::rem#8 reg byte y 101.66666666666667
(byte) div8u::divisor#0 reg byte x 4.0
(byte) div8u::divisor#1 reg byte x 22.0
(byte) div8u::divisor#2 reg byte x 7.5
(byte) div8u::return
(byte) div8u::return#0 return zp ZP_BYTE:19 45.142857142857146
(byte) div8u::return#2 reg byte a 4.0
(byte) div8u::return#3 reg byte a 22.0
(byte) div8u::return#0 reg byte x 3.75
(byte) div8u::return#2 reg byte x 4.0
(byte) div8u::return#3 reg byte x 22.0
(word()) divr16u((word) divr16u::dividend , (word) divr16u::divisor , (word) divr16u::rem)
(byte~) divr16u::$1 reg byte a 202.0
(byte~) divr16u::$2 reg byte a 202.0
(label) divr16u::@1
(label) divr16u::@2
(label) divr16u::@3
(label) divr16u::@4
(label) divr16u::@5
(label) divr16u::@return
(word) divr16u::dividend
(word) divr16u::dividend#0 dividend zp ZP_WORD:3 1.3333333333333333
(word) divr16u::dividend#1 dividend zp ZP_WORD:3 25.25
(word) divr16u::dividend#2 dividend zp ZP_WORD:3 43.57142857142858
(word) divr16u::divisor
(word) divr16u::divisor#0 divisor zp ZP_WORD:12 12.0
(byte) divr16u::i
(byte) divr16u::i#1 reg byte x 151.5
(byte) divr16u::i#2 reg byte x 15.538461538461538
(word) divr16u::quotient
(word) divr16u::quotient#1 quotient zp ZP_WORD:14 151.5
(word) divr16u::quotient#2 quotient zp ZP_WORD:14 101.0
(word) divr16u::quotient#3 quotient zp ZP_WORD:14 25.25
(word) divr16u::rem
(word) divr16u::rem#1 rem zp ZP_WORD:16 75.75
(word) divr16u::rem#10 rem zp ZP_WORD:16 3.8023255813953494
(word) divr16u::rem#2 rem zp ZP_WORD:16 202.0
(word) divr16u::rem#3 rem zp ZP_WORD:16 202.0
(word) divr16u::rem#4 rem zp ZP_WORD:16 202.0
(word) divr16u::rem#5 rem zp ZP_WORD:16 101.0
(word) divr16u::return
(word) divr16u::return#0 return zp ZP_WORD:14 4.0
(word) divr16u::return#1 return zp ZP_WORD:14 61.0
(byte()) divr8u((byte) divr8u::dividend , (byte) divr8u::divisor , (byte) divr8u::rem)
(byte~) divr8u::$1 reg byte a 202.0
(label) divr8u::@1
(label) divr8u::@2
(label) divr8u::@3
(label) divr8u::@4
(label) divr8u::@5
(label) divr8u::@return
(byte) divr8u::dividend
(byte) divr8u::dividend#0 dividend zp ZP_BYTE:20 1.3333333333333333
(byte) divr8u::dividend#1 dividend zp ZP_BYTE:20 25.25
(byte) divr8u::dividend#2 dividend zp ZP_BYTE:20 50.83333333333333
(byte) divr8u::divisor
(byte) divr8u::divisor#0 divisor zp ZP_BYTE:24 12.75
(byte) divr8u::i
(byte) divr8u::i#1 reg byte y 151.5
(byte) divr8u::i#2 reg byte y 16.833333333333332
(byte) divr8u::quotient
(byte) divr8u::quotient#1 reg byte x 151.5
(byte) divr8u::quotient#2 reg byte x 101.0
(byte) divr8u::quotient#3 reg byte x 28.857142857142858
(byte) divr8u::rem
(byte) divr8u::rem#1 rem zp ZP_BYTE:19 101.0
(byte) divr8u::rem#10 rem zp ZP_BYTE:19 3.8023255813953494
(byte) divr8u::rem#2 rem zp ZP_BYTE:19 202.0
(byte) divr8u::rem#3 rem zp ZP_BYTE:19 202.0
(byte) divr8u::rem#4 rem zp ZP_BYTE:19 202.0
(byte) divr8u::rem#5 rem zp ZP_BYTE:19 101.0
(byte) divr8u::return
(byte) divr8u::return#0 reg byte x 4.0
(byte) divr8u::return#1 reg byte x 61.0
(byte*) line_cursor
(byte*) line_cursor#1 line_cursor zp ZP_WORD:5 3.9099999999999993
(byte*) line_cursor#20 line_cursor zp ZP_WORD:5 204.0
@ -258,16 +276,16 @@
(signed word) rem16s#3 rem16s zp ZP_WORD:3 1.0833333333333333
(signed word~) rem16s#32 rem16s zp ZP_WORD:3 4.0
(word) rem16u
(word) rem16u#1 rem16u zp ZP_WORD:3 0.8275862068965517
(word) rem16u#30 rem16u zp ZP_WORD:3 110.0
(word) rem16u#31 rem16u zp ZP_WORD:16 130.0
(word) rem16u#35 rem16u zp ZP_WORD:16 4.4
(signed byte) rem8s
(signed byte) rem8s#1 reg byte x 2.0
(signed byte) rem8s#18 reg byte x 110.0
(signed byte) rem8s#3 reg byte x 1.0833333333333333
(signed byte~) rem8s#33 reg byte x 4.0
(byte) rem8u
(byte) rem8u#1 reg byte x 0.8275862068965517
(byte) rem8u#31 reg byte x 110.0
(byte) rem8u#31 rem8u zp ZP_BYTE:19 130.0
(byte) rem8u#36 rem8u zp ZP_BYTE:19 4.4
(void()) test_16s()
(label) test_16s::@1
(label) test_16s::@10
@ -285,7 +303,7 @@
(signed word[]) test_16s::dividends
(const signed word[]) test_16s::dividends#0 dividends = { (word/signed word/dword/signed dword) 32767, (word/signed word/dword/signed dword) 32767, -(word/signed word/dword/signed dword) 32767, -(word/signed word/dword/signed dword) 32767, (word/signed word/dword/signed dword) 32767, -(word/signed word/dword/signed dword) 32767 }
(signed word) test_16s::divisor
(signed word) test_16s::divisor#0 divisor zp ZP_WORD:20 3.0
(signed word) test_16s::divisor#0 divisor zp ZP_WORD:21 3.0
(signed word[]) test_16s::divisors
(const signed word[]) test_16s::divisors#0 divisors = { (byte/signed byte/word/signed word/dword/signed dword) 5, -(byte/signed byte/word/signed word/dword/signed dword) 7, (byte/signed byte/word/signed word/dword/signed dword) 11, -(byte/signed byte/word/signed word/dword/signed dword) 13, -(byte/signed byte/word/signed word/dword/signed dword) 17, (byte/signed byte/word/signed word/dword/signed dword) 19 }
(byte) test_16s::i
@ -341,14 +359,14 @@
(signed byte[]) test_8s::dividends
(const signed byte[]) test_8s::dividends#0 dividends = { (byte/signed byte/word/signed word/dword/signed dword) 127, -(byte/signed byte/word/signed word/dword/signed dword) 127, -(byte/signed byte/word/signed word/dword/signed dword) 127, (byte/signed byte/word/signed word/dword/signed dword) 127, (byte/signed byte/word/signed word/dword/signed dword) 127, (byte/signed byte/word/signed word/dword/signed dword) 127 }
(signed byte) test_8s::divisor
(signed byte) test_8s::divisor#0 divisor zp ZP_BYTE:22 3.0
(signed byte) test_8s::divisor#0 divisor zp ZP_BYTE:23 3.0
(signed byte[]) test_8s::divisors
(const signed byte[]) test_8s::divisors#0 divisors = { (byte/signed byte/word/signed word/dword/signed dword) 5, (byte/signed byte/word/signed word/dword/signed dword) 7, -(byte/signed byte/word/signed word/dword/signed dword) 11, -(byte/signed byte/word/signed word/dword/signed dword) 13, (byte/signed byte/word/signed word/dword/signed dword) 17, (byte/signed byte/word/signed word/dword/signed dword) 19 }
(byte) test_8s::i
(byte) test_8s::i#1 i zp ZP_BYTE:2 16.5
(byte) test_8s::i#10 i zp ZP_BYTE:2 1.76
(signed byte) test_8s::res
(signed byte) test_8s::res#0 res zp ZP_BYTE:16 2.2
(signed byte) test_8s::res#0 res zp ZP_BYTE:18 2.2
(const string) test_8s::str str = (string) " / @"
(const string) test_8s::str1 str1 = (string) " = @"
(const string) test_8s::str2 str2 = (string) " @"
@ -370,52 +388,57 @@
(byte[]) test_8u::dividends
(const byte[]) test_8u::dividends#0 dividends = { (byte/word/signed word/dword/signed dword) 255, (byte/word/signed word/dword/signed dword) 255, (byte/word/signed word/dword/signed dword) 255, (byte/word/signed word/dword/signed dword) 255, (byte/word/signed word/dword/signed dword) 255, (byte/word/signed word/dword/signed dword) 255 }
(byte) test_8u::divisor
(byte) test_8u::divisor#0 divisor zp ZP_BYTE:17 3.3000000000000003
(byte) test_8u::divisor#0 divisor zp ZP_BYTE:18 3.3000000000000003
(byte[]) test_8u::divisors
(const byte[]) test_8u::divisors#0 divisors = { (byte/signed byte/word/signed word/dword/signed dword) 5, (byte/signed byte/word/signed word/dword/signed dword) 7, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 13, (byte/signed byte/word/signed word/dword/signed dword) 17, (byte/signed byte/word/signed word/dword/signed dword) 19 }
(byte) test_8u::i
(byte) test_8u::i#1 i zp ZP_BYTE:2 11.0
(byte) test_8u::i#10 i zp ZP_BYTE:2 1.8333333333333333
(byte) test_8u::res
(byte) test_8u::res#0 res zp ZP_BYTE:16 2.4444444444444446
(byte) test_8u::res#0 reg byte x 2.4444444444444446
(const string) test_8u::str str = (string) " / @"
(const string) test_8u::str1 str1 = (string) " = @"
(const string) test_8u::str2 str2 = (string) " @"
zp ZP_BYTE:2 [ test_16s::i#10 test_16s::i#1 test_8s::i#10 test_8s::i#1 test_16u::i#10 test_16u::i#1 test_8u::i#10 test_8u::i#1 ]
zp ZP_WORD:3 [ rem16s#17 rem16s#3 rem16s#32 rem16s#1 rem16u#30 rem16u#1 div16u::rem#4 div16u::rem#8 div16u::rem#5 div16u::rem#1 div16u::rem#2 div16u::rem#3 print_cls::sc#2 print_cls::sc#1 ]
zp ZP_WORD:3 [ rem16s#17 rem16s#3 rem16s#32 rem16s#1 div16s::dividendu#3 div16s::dividendu#7 div16s::dividendu#8 div16u::dividend#2 div16u::dividend#0 div16u::dividend#1 divr16u::dividend#2 divr16u::dividend#0 divr16u::dividend#1 div16s::$2 print_cls::sc#2 print_cls::sc#1 ]
zp ZP_WORD:5 [ line_cursor#20 line_cursor#39 line_cursor#1 line_cursor#41 ]
zp ZP_WORD:7 [ print_sword::w#6 print_sword::w#5 print_sword::w#1 print_sword::w#2 print_sword::w#3 print_sword::w#4 print_sword::w#0 print_word::w#5 print_word::w#7 print_word::w#1 print_word::w#2 print_word::w#3 print_word::w#4 test_16s::dividend#0 div16s::dividend#0 test_16u::dividend#0 print_str::str#13 print_str::str#15 print_str::str#0 ]
zp ZP_BYTE:9 [ print_byte::b#7 print_byte::b#9 print_byte::b#1 print_byte::b#2 print_byte::b#3 print_byte::b#4 print_byte::b#5 print_byte::b#6 print_sbyte::b#6 print_sbyte::b#5 print_sbyte::b#1 print_sbyte::b#2 print_sbyte::b#3 print_sbyte::b#4 print_sbyte::b#0 test_8s::dividend#0 test_8u::dividend#0 ]
reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ]
zp ZP_WORD:10 [ char_cursor#80 char_cursor#133 char_cursor#130 char_cursor#132 char_cursor#128 char_cursor#129 char_cursor#155 char_cursor#126 char_cursor#17 char_cursor#162 char_cursor#135 char_cursor#131 char_cursor#1 char_cursor#179 char_cursor#185 div16s::dividendu#3 div16s::dividendu#7 div16s::dividendu#8 div16u::dividend#3 div16u::dividend#5 div16u::dividend#1 div16u::dividend#2 div16u::dividend#0 div16s::$2 ]
zp ZP_WORD:12 [ div16s::divisoru#3 div16s::divisoru#4 div16s::divisoru#5 div16u::divisor#6 div16u::divisor#0 div16u::divisor#1 div16s::divisor#0 div16s::$7 test_16u::divisor#0 ]
zp ZP_WORD:10 [ char_cursor#80 char_cursor#133 char_cursor#130 char_cursor#132 char_cursor#128 char_cursor#129 char_cursor#155 char_cursor#126 char_cursor#17 char_cursor#162 char_cursor#135 char_cursor#131 char_cursor#1 char_cursor#179 char_cursor#185 ]
zp ZP_WORD:12 [ div16s::divisoru#3 div16s::divisoru#4 div16s::divisoru#5 div16u::divisor#2 div16u::divisor#0 div16u::divisor#1 div16s::divisor#0 div16s::$7 divr16u::divisor#0 test_16u::divisor#0 ]
reg byte y [ div16s::neg#4 div16s::neg#3 div16s::neg#2 ]
zp ZP_WORD:14 [ div16s::return#2 div16s::return#6 div16s::return#0 div16s::resultu#0 div16s::return#3 test_16s::res#0 div16u::return#2 div16u::quotient#3 div16u::return#0 div16u::quotient#1 div16u::quotient#2 div16u::return#3 test_16u::res#0 ]
reg byte x [ div16u::i#2 div16u::i#1 ]
zp ZP_WORD:14 [ div16s::return#2 div16s::return#6 div16s::return#0 div16s::resultu#0 div16s::return#3 test_16s::res#0 div16u::return#2 div16u::return#0 divr16u::return#0 divr16u::quotient#3 divr16u::return#1 divr16u::quotient#1 divr16u::quotient#2 div16u::return#3 test_16u::res#0 ]
zp ZP_WORD:16 [ divr16u::rem#4 rem16u#31 divr16u::rem#10 rem16u#35 divr16u::rem#5 divr16u::rem#1 divr16u::rem#2 divr16u::rem#3 ]
reg byte x [ divr16u::i#2 divr16u::i#1 ]
reg byte x [ rem8s#18 rem8s#3 rem8s#33 rem8s#1 ]
reg byte y [ div8s::dividendu#3 div8s::dividendu#7 div8s::dividendu#8 ]
reg byte x [ div8s::divisoru#3 div8s::divisoru#4 div8s::divisoru#5 ]
zp ZP_BYTE:16 [ div8s::neg#4 div8s::neg#3 div8s::neg#2 test_8s::res#0 test_8u::res#0 ]
zp ZP_BYTE:18 [ div8s::neg#4 div8s::neg#3 div8s::neg#2 test_8s::res#0 test_8u::divisor#0 ]
reg byte a [ div8s::return#2 div8s::return#6 div8s::return#0 ]
zp ZP_BYTE:17 [ div8u::divisor#6 div8u::divisor#0 div8u::divisor#1 test_8u::divisor#0 ]
reg byte y [ div8u::rem#4 div8u::rem#8 div8u::rem#5 div8u::rem#1 div8u::rem#2 div8u::rem#3 ]
zp ZP_BYTE:18 [ div8u::dividend#3 div8u::dividend#5 div8u::dividend#1 div8u::dividend#2 div8u::dividend#0 ]
zp ZP_BYTE:19 [ div8u::quotient#3 div8u::return#0 div8u::quotient#1 div8u::quotient#2 ]
reg byte x [ div8u::i#2 div8u::i#1 ]
reg byte x [ rem8u#31 rem8u#1 ]
zp ZP_WORD:20 [ test_16s::divisor#0 ]
reg byte a [ div8u::dividend#2 div8u::dividend#0 div8u::dividend#1 ]
reg byte x [ div8u::divisor#2 div8u::divisor#0 div8u::divisor#1 ]
zp ZP_BYTE:19 [ divr8u::rem#4 rem8u#31 divr8u::rem#10 rem8u#36 divr8u::rem#5 divr8u::rem#1 divr8u::rem#2 divr8u::rem#3 ]
zp ZP_BYTE:20 [ divr8u::dividend#2 divr8u::dividend#0 divr8u::dividend#1 ]
reg byte x [ divr8u::quotient#3 divr8u::return#1 divr8u::quotient#1 divr8u::quotient#2 ]
reg byte y [ divr8u::i#2 divr8u::i#1 ]
zp ZP_WORD:21 [ test_16s::divisor#0 ]
reg byte a [ print_byte::$0 ]
reg byte a [ print_byte::$2 ]
reg byte a [ div16u::$1 ]
reg byte a [ div16u::$2 ]
zp ZP_BYTE:22 [ test_8s::divisor#0 ]
reg byte a [ divr16u::$1 ]
reg byte a [ divr16u::$2 ]
zp ZP_BYTE:23 [ test_8s::divisor#0 ]
reg byte a [ div8s::dividend#0 ]
reg byte x [ div8s::divisor#0 ]
reg byte a [ div8s::return#3 ]
reg byte a [ div8s::$2 ]
reg byte x [ div8s::$7 ]
reg byte a [ div8u::return#2 ]
reg byte x [ div8u::return#2 ]
reg byte y [ div8s::resultu#0 ]
reg byte a [ div8u::$1 ]
reg byte a [ div8u::return#3 ]
zp ZP_BYTE:24 [ divr8u::divisor#0 ]
reg byte x [ divr8u::return#0 ]
reg byte x [ div8u::return#0 ]
reg byte a [ divr8u::$1 ]
reg byte x [ div8u::return#3 ]
reg byte x [ test_8u::res#0 ]