Results 1 to 2 of 2

Thread: algebraic solver

  1. #1

    algebraic solver

    i'm making a small pascal to pic compiler and i've got much of it working but now i'm stuck on the solver. i've tried so much at trying to make on that just work for simple equations but it just won't work! i need to turn a line like this:

    bitmask := 2 * (position + RCX_bit);

    into:

    move position to w
    add RCX_bit to w
    multiply w with 2
    move w to bitmask

    just a list of the operations done in the right order..

    maybe this wasn't the best example to give but please ask questions if i wasn't clear enough

    Many Regards
    Jeppe
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  2. #2
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    algebraic solver

    You're trying to convert the one line of Pascal code into PIC ASM using the BEDMAS mathmatical ordering scheme with your parser, correct?

    Hmm... before getting into this I'd first recommend you read the very informative article Let's Build a Compiler by Jack Crenshaw. [size=9px](Listed in the site's Library!)[/size] The source and examples are in PASCAL both supported by Turbo Pascal, Free Pascal and Delphi[size=9px](with very little modification)[/size].
    Jason McMillen
    Pascal Game Development
    Co-Founder





Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •