The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Changes for version 2.05_05 - 2009-08-26

  • Fix Parser.pm version
  • Remove dead code
  • Improve documentation
  • Tests failed in Unix due to lack of \r processing
  • Compatible with perl 5.006, downgraded requirement from 5.008.
  • Error in macro expansion : was eating statement terminator

Changes for version 2.05_04 - 2009-08-23

  • New Stream class - faster than HOP::Stream, because head element is always available to be read without computation (is_promise() in HOP::Stream) and no test is needed to distinguish a stream node from a array-ref element (is_node() in HOP::Stream). The stream has an head element, and a list of the next elements, which may contain iterators.
  • List object uses the input to the assembler to read the lines again during the listing phase, instead of globing all tokens in memory
  • Remove usage of HOP::Stream
  • Move the macro processing into the parser - removes one level of stream processing
  • Added the unofficial Z80 opcodes to the test cases
  • Benchmark assembly times: 0.337 sjasmplus 2.734 z80masm-2.01 2.738 z80masm-2.05 2.898 z80masm-current 3.555 z80masm-2.05_03 11.342 z80masm-1.03

Changes for version 2.05_03 - 2009-08-11

  • Performance :
    • hand-coded contructor and accessor for Line.pm and Token.pm instead of Class::Struct, because too much time was being spent on Token->new()
  • Remove Class.pm : plugin replacement to Class::Class to solve RT #42710
  • Remove Node.pm : cannot use inheritance with Class::Struct; define different modules (Program.pm, Segment.pm, Opcode.pm, Expr.pm) with the same interface (child contains list of children of this node).
  • All test scripts now pass
  • Move test scripts data files to t\data
  • Move all bechmarking scripts to tools\benchmark
  • New List.pm class to handle output of the assembly file listing at the code generation stage.
  • New ParserGenerator.pm class to generate a try-based non-backtracking parser. Builds a complete state table for the input grammar, where each state is a map of current-token => next-state, or current-token => accept-rule, or current-token => call-sub-rule. The input grammar accepts rule => token token ... [sub-rule] ... action The sub-rule call accepts optional ('?'), 0 or more ('*') or 1 or more ('+'). The output is the new Parser.pm module with about 7K states and 20K lines of Perl code --> PERFORMANCE PENALTY.
  • Remove ParserTable.pm : whole Parser.pm is now generated by tools\build_Parser.pl
  • Expr.pm parser now checks for the correct syntax. The previous parser just extracted balanced parentheses.
  • Lexer.pm :
    • accept db, dw, dt, dm as alias to defb, defw, deft, defm
    • remove quotes from STRING token value
  • Line.pm : added back is_equal() and is_different()
  • Macro.pm :
    • return the list of newline tokens parsed inside of a macro definition back to the stream, so that the assembly listing contains also these lines.
    • replace statement_end() by /[:\n]/ -> performance
  • Program.pm, Segment.pm : new org() and add() methods to be called by code generator.
    • The lexer is still the performance botleneck, together with the heavy usage of HOP::Stream.
  • %Time ExclSec CumulS #Calls sec/call Csec/c Name 43.7 0.500 3.052 71417 0.0000 0.0000 HOP::Stream::tail 33.6 0.385 0.665 98780 0.0000 0.0000 HOP::Stream::head 24.6 0.282 0.466 170197 0.0000 0.0000 HOP::Stream::is_node 22.4 0.257 1.214 17902 0.0000 0.0001 CPU::Z80::Assembler::Lexer::__ANON__ 21.3 0.244 0.257 67163 0.0000 0.0000 HOP::Stream::is_promise 20.7 0.237 2.173 34954 0.0000 0.0001 CPU::Z80::Assembler::Macro::__ANON__ 20.4 0.234 0.250 9 0.0260 0.0278 CPU::Z80::Assembler::Macro::BEGIN 19.6 0.225 0.225 242140 0.0000 0.0000 UNIVERSAL::isa 18.6 0.213 3.250 71417 0.0000 0.0000 HOP::Stream::drop

Changes for version 2.05_02 - 2009-04-25

  • Line.pm, Token.pm :
    • go back to Class::Struct instead of Class::Class (bad performance of the later)
    • do not use "eval(Data::Dump::dump())" for clone - bad performance
    • add overload for 'bool' and '0+' - '""' was being used, and is too slow because it uses Data::Dump::dump() internally
    • remomve is_equal() and is_different() methods (Line.pm)

Changes for version 2.05_01 - 2009-04-23

  • Add Line, Token classes. No need to create LINE tokens - each token carries the line number. Change to single-pass design. Use Class::Class hierarchy for parsed objects. Several test scripts fail. Documentation needs update. Dead code needs to be removed.

Documentation

a macro assembler for the Z80 micro-processor

Modules

a Z80 assembler
Represents one assembly expression to be computed at link time
Scanner for the Z80 assembler
One line of text retrieved from the input
Assembly listing output class
Macro pre-processor for the Z80 assembler
Represents one assembly expression to be computed at link time
Parser for the Z80 assembler
Preprocessor for the Z80 assembler
Represents one assembly program
Represents one segment of assembly opcodes
Object to encapsulate an iterator to be able to unget
One token retrieved from the input