Changeset 87 for trunk/Target


Ignore:
Timestamp:
Aug 29, 2017, 5:38:45 PM (7 years ago)
Author:
chronos
Message:
  • Added: New CSharp target.
  • Fixed: Use configured memory size in targets.
Location:
trunk/Target
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Target/UTargetC.pas

    r86 r87  
    6868  AddLine('{');
    6969  Inc(Indent);
    70   AddLine('char Memory[30000];');
     70  AddLine('char Memory[' + IntToStr(MemorySize) + '];');
    7171  AddLine('int Pos;');
    7272  AddLine('char ReadChar;');
  • trunk/Target/UTargetDelphi.pas

    r86 r87  
    6060  AddLine('');
    6161  AddLine('var');
    62   AddLine('  Memory: array[0..30000] of Byte;');
     62  AddLine('  Memory: array[0..' + IntToStr(MemorySize) + '] of Byte;');
    6363  AddLine('  Pos: Integer;');
    6464  AddLine('  ReadChar: Char;');
  • trunk/Target/UTargetFPC.pas

    r86 r87  
    6262  AddLine('program ' + ProgramName + ';');
    6363  AddLine('var');
    64   AddLine('  Memory: array[0..30000] of Byte;');
     64  AddLine('  Memory: array[0..' + IntToStr(MemorySize) + '] of Byte;');
    6565  AddLine('  Pos: Integer;');
    6666  AddLine('  ReadChar: Char;');
  • trunk/Target/UTargetJava.pas

    r86 r87  
    7171  AddLine('char ReadChar;');
    7272  AddLine;
    73   AddLine('Memory = new char[30000];');
     73  AddLine('Memory = new char[' + IntToStr(MemorySize) + '];');
    7474  AddLine('Pos = 0;');
    7575  FProgramIndex := 0;
  • trunk/Target/UTargetPHP.pas

    r86 r87  
    6363  AddLine('<?php // ' + ProgramName);
    6464  AddLine('');
    65   AddLine('$Memory = str_repeat("\0", 30000);');
     65  AddLine('$Memory = str_repeat("\0", ' + IntToStr(MemorySize) + ');');
    6666  AddLine('$Position = 0;');
    6767  FProgramIndex := 0;
  • trunk/Target/UTargetPython.pas

    r86 r87  
    101101  AddLine('');
    102102  AddLine('import sys');
    103   AddLine('memory = [0] * 30000');
     103  AddLine('memory = [0] * ' + IntToStr(MemorySize));
    104104  AddLine('position = 0');
    105105  FProgramIndex := 0;
Note: See TracChangeset for help on using the changeset viewer.