| | @@ -22,6 +22,12 @@ |
| 22 | 22 | script, bytes, fixups and listing, and by `test/AsmDump` on the files |
| 23 | 23 | `test/genasm.py` makes: a long run of every instruction the assembler |
| 24 | 24 | knows, and a file for each of its errors. |
| 25 | +`Gen` is tested by `test/GenDump`, a script of calls, valid by |
| 26 | +construction (an expression pushes its operands and then operates; a |
| 27 | +statement leaves the stack as it found it), that compiles 80 procedures |
| 28 | +with every kind of expression, statement, call, check, frame and defer, |
| 29 | +and the entry point, static and dynamic: the bytes, fixups, line notes |
| 30 | +and listing must be the same. |
| 25 | 31 | |
| 26 | 32 | `check.sh` builds a dumper for each side, `test/ScanDump.pas` over the |
| 27 | 33 | seed's units and `test/ScanDump.raz` over these, and has both read the |
| | @@ -80,6 +86,18 @@ |
| 80 | 86 | `setStripped` and `X64.setListing`. The file is written by |
| 81 | 87 | `Files.write` and made executable by `Sys.chmod`, in place of one |
| 82 | 88 | `open` with mode 755 (which the umask would trim). |
| 89 | +- **`Gen`.** The seed's `Mark` in the middle of a push or a check |
| 90 | + can't give an error back: `newEntry` (the stack's 256 places) and |
| 91 | + `check` (4,096 checks a procedure) show it and go on without doing |
| 92 | + what they couldn't, and the parser's `resetStack` makes the stack |
| 93 | + right again; `endProc` returns its error ("frame too big") and |
| 94 | + `codeProc` the assembler's. A `var` out of the seed became a result |
| 95 | + (`topConst`, `operands`, `deferBegin`); the labels, which are chains |
| 96 | + that a call extends, stay `var`. `inPlace` has a setter. The seed's |
| 97 | + `Call` record is `CallInfo` (the procedure is `call`) and `TLink` is |
| 98 | + `Link`. A `match` on an enumeration takes one name to an arm, and a |
| 99 | + set holds at most 64 names, so `Scan.Sym` (over 64) has none: the |
| 100 | + seed's sets of its names are chains of `=`. |
| 83 | 101 | - **No bit cast.** A real's bits and back go through a pointer. |
| 84 | 102 | - **Speed.** On the 348,025 lines of `test/genbench.py`, 7.6 MB, the |
| 85 | 103 | seed's scanner takes 75 ms and this one 74. It took 121 at first. |