Details | Last modification | View Log
| Rev | Author | Line No. | Line | 
|---|---|---|---|
| 125 | lvd | 1 | scratch area + TODO keeper for sjasmplus developers:  | 
        
| 2 | ====================================================  | 
        ||
| 3 | |||
| 4 | |||
| 5 | ====================  | 
        ||
| 6 | Ped:  | 
        ||
| 7 | |||
| 8 | LUA quirks:  | 
        ||
| 9 | -- v includelua:  | 
        ||
| 10 | function inc_ld(reg, val)  | 
        ||
| 11 |         _pc('LD '..reg..','..val) | 
        ||
| 12 | end  | 
        ||
| 13 | -- v kode:  | 
        ||
| 14 | LUA  | 
        ||
| 15 | inc_ld(A, pass) -- bug, should be 'A'  | 
        ||
| 16 | ENDLUA  | 
        ||
| 17 | = no output, no error, just dies. ... Seems like any LUA syntax error does that, just dies.  | 
        ||
| 18 | |||
| 19 | CSPECTMAP - needs better support for DISP and instances of STRUCT  | 
        ||
| 20 | |||
| 21 | --syntax: "I" to uppercase all labels + usage (needs labels refactoring)  | 
        ||
| 22 | |||
| 23 | --syntax: B+L options implementation  | 
        ||
| 24 | add DOCS example test: "hl: ld a,(hl),,de,hl" when all is implemented  | 
        ||
| 25 | |||
| 26 | static analysis: PVS-Studio https://www.viva64.com/en/m/0036/  | 
        ||
| 27 | |||
| 28 | FIXME in sources mark further points worth refactoring  | 
        ||
| 29 | |||
| 30 | FIXME: get rid of ParseDirective_REPT somehow, its existence can't be right  | 
        ||
| 31 | (breaks ` .34 repeatX` directive probably? .. and END@beginningOfLine? .. actually not?)  | 
        ||
| 32 | |||
| 33 | SplitLuaErrorMessage - add some tests after Liniya fix, maybe review the code more.  | 
        ||
| 34 | |||
| 35 | "--lst" bez hodnoty nech spravi default nazov sam  | 
        ||
| 36 | ==> needs tests (badly, was bugged a lot during development)  | 
        ||
| 37 | |||
| 38 | ReadBufLine parsing refactored. Now look for other parts of code trying to do similar things and refactor too..  | 
        ||
| 39 | |||
| 40 | I almost certainly broke some STRCPY/STRCAT max-size limits (i.e. malicious source may buffer overflow)...  | 
        ||
| 41 | |||
| 42 | Macro world issues:  | 
        ||
| 43 | - macros for operators? (in ideal case `zeuskeyaddr` possible to recreate in macro?)  | 
        ||
| 44 | - more operators, capable of some string manipulation and maybe some type/expression checks (islabel)  | 
        ||
| 45 | - ability to issue real instruction (ignoring possible macro of same name)  | 
        ||
| 46 | |||
| 47 | Input file without extension does produce wrong default output filename  | 
        ||
| 48 | |||
| 49 | SAVEHOB/SAVETRD/SAVETAP/... global review of filename handling, adding warnings/errors  | 
        ||
| 50 | where filename modification happens or filename is invalid.  | 
        ||
| 51 | |||
| 52 | ** Macro/define substitution rules and implementation (proposal):  | 
        ||
| 53 | - macro arguments substitute with priority, from the longest ones  | 
        ||
| 54 | - macro arguments substitute even in define related directives  | 
        ||
| 55 | - define arguments substitute next, from the longest ones (inc. defarray)  | 
        ||
| 56 | - name of define/macroarg starting with underscore prohibits substitution into middle  | 
        ||
| 57 | (can substitute only at beginning)  | 
        ||
| 58 | ? extend that rule to underscore at end sealing also the tail?  | 
        ||
| 59 | - lock some keywords for define/etc... at least put them under warning  | 
        ||
| 60 | - inhibitor of substitutions/macros happening (like `@djnz` always assembled as djnz inst.  | 
        ||
| 61 | ** Current refactored implementation:  | 
        ||
| 62 | - doesn't play priorities as proposed above  | 
        ||
| 63 | - evaluation of defarray index is still flaky and doesn't work correctly inside macro/etc  | 
        ||
| 64 | - needs lot more testing and cleanup  | 
        ||
| 65 | + should be already a bit more intuitive than 1.08+ (although it may break legacy source)  | 
        ||
| 66 | |||
| 67 | ZX128 snapshot default state and mapping - still doesn't survive simple `ret` into BASIC  | 
        ||
| 68 | |||
| 69 | DISP inside DISP bugs => documented. Correct solution = nesting DISPs?!  | 
        ||
| 70 | |||
| 71 | $$label operator to get label page. (and fix pages for defl/equ/expression/... labels)  | 
        ||
| 72 | //// syntax summary:  | 
        ||
| 73 | labels (\.|@|)[A-Za-z_][A-Za-z0-9_.?!#@]*  | 
        ||
| 74 | , argument-separator : instruction-separator ; // comment  | 
        ||
| 75 |     # $ hexnums, % binary, "' strings, () parentheses or memcell, [] memcell, {} device mem | 
        ||
| 76 | operators-unary: ! ~ + - low high not  | 
        ||
| 77 | operators-binary: * / % mod + - << >> >>> shl shr <? >? < > <= >= = == != & and ^ xor | or && ||  | 
        ||
| 78 |     us keyboard: ~!@#$%^&*()_+`-=[]{};':"<>?,./\| | 
        ||
| 79 | $$label - hexa are single $ only, so this looks fine (unary operator)  | 
        ||
| 80 | ?label - 5<?label => ambiguous  | 
        ||
| 81 | \label - looks weird, no syntax clash  | 
        ||
| 82 | Needs more syntax:  | 
        ||
| 83 | - reformat label into different slot... <slot>$$expression ? (binary operator)  | 
        ||
| 84 | - differentiate 16+b address space from 16b slot-mapped address space.  | 
        ||
| 85 | &label/expression? Similar to C/C++? &0x1231241 ? (5123 + &1234)  | 
        ||
| 86 | |||
| 87 | MMU:  | 
        ||
| 88 | - custom pages order for wrap-next-mapping option (like "<3, 5, 1, 2>" ?)  | 
        ||
| 89 | - err/warn/warp option for slot range?  | 
        ||
| 90 | |||
| 91 | sjasmplus 2.x/fork:  | 
        ||
| 92 | |||
| 93 | address space of labels -> 2|3:30|29 bits, the top bits being default slot number,  | 
        ||
| 94 | remaining bits being physical address into global chip address space  | 
        ||
| 95 | -> then producing machine code using the particular label would "format" physical  | 
        ||
| 96 | label value for particular "slot" (view of value).  | 
        ||
| 97 | |||
| 98 | To stay backward compatible/similar, one would have to support also 0000-FFFF range as if  | 
        ||
| 99 | going through the mapped pages.. but that does collide with early pages 0..n ...  | 
        ||
| 100 | How about abusing "@" or "." or something to distinguish between? (& resembles C/C++!)  | 
        ||
| 101 | |||
| 102 | Kate syntax: broken with LUA block containing "end" keyword (maybe even consider including Lua highlight rules from KDE defaults, if it's possible)  | 
        ||
| 103 | |||
| 104 | ====================  | 
        ||
| 105 | Docs:  | 
        ||
| 106 | |||
| 107 | "pseudo-ops as SAVEBIN, SAVEHOB, SAVETRD, SAVETAP, PAGE, SLOT, LABELSLIST and use special functions in Lua scripts."  | 
        ||
| 108 | ^^ link each?  | 
        ||
| 109 | |||
| 110 | DEVICE needs better description? Issue #55  |