Commit graph

17 commits

Author SHA1 Message Date
Jeff Epler
e9ef90fa63 ptasm: -o to send hex-format output to designated file 2014-08-20 11:00:47 -05:00
Jeff Epler
d6eb374b12 more WIP
it's closer to compiling sslbp; my mock makeinc (not yet committed)
doesn't give right results for _byte, _flag, etc
2014-08-16 22:15:13 -05:00
Jeff Epler
d3f308ee5d ptasm: #define, #include, .macro/.endm
(the latter not tested)
2014-08-16 15:58:02 -05:00
Jeff Epler
175179455b unused rule 2014-08-12 06:49:22 -05:00
Jeff Epler
ba38159c1d saner handling of comments 2014-08-12 06:48:35 -05:00
Jeff Epler
70b0cb9643 implement dw/word, msfirst, lsfirst 2014-08-12 06:40:43 -05:00
Jeff Epler
47d9553f83 perfomance improvements
pyparsing is very slow when there are dozens of alternatives, as there
were when the whole instruction set appeared as alternatives of the main
production.

Instead, use our knowledge of the structure of assembler files so that there
are only a few top-level rules: only one for all types of instruction,
and only one for all types of pseudo-ops

Also, lay the basis for a proper pseudo-op implementation.  Implement
pseudo-ops .org and .equ; parse but don't act on .end.

Change the format of the test program accordingly.

This improves the speed by a factor of about 4 on the 'ssremote' input.
This real program goes from 4s runtime to 1s.
2014-08-11 21:28:39 -05:00
Jeff Epler
9cd1acd815 leading space *required* when there's no label 2014-08-10 21:36:12 -05:00
Jeff Epler
cf7111aeda parse the .end directive (but ignore it) 2014-08-10 21:36:12 -05:00
Jeff Epler
93f8640f23 huff, matchfirst is grumpy again. I thought I tested this 2014-08-10 21:36:12 -05:00
Jeff Epler
5300ab3e2b Always match first instruction from table
.. this requires explicitly matching the space after an instruction
because otherwise the pattern order
 JMP *
 JMPNZ *
would cause 'JMPNZ LABEL' to actually parse as 'JMP NZ LABEL', and
issue an error due to the trailing 'LABEL'.  (This doesn't actually
make sense to me, except that it's what pyparsing seemed to do)
2014-08-08 06:59:46 -05:00
Jeff Epler
b86c6255c6 fix comment stripping
the sequence
 stab YH ; comment
didn't parse because of trailing space
2014-08-08 06:47:49 -05:00
Jeff Epler
6556992f80 spell ORG like tasm 2014-08-07 22:24:48 -05:00
Jeff Epler
c5e1b78751 use a simple search path for tables
.. they can be in the current directory, with the pta module,
or with the ptasm script
2014-08-07 21:39:29 -05:00
Jeff Epler
fa3b5d76a8 tasm compatibility for label parsing
the token in the first column is a label

the colon after a token is optional
2014-08-07 21:38:03 -05:00
Jeff Epler
38b5ad4dcd script should be executable 2014-08-07 19:34:12 -05:00
Jeff Epler
0b7557de0f Initial commit 2014-08-07 18:57:30 -05:00