yes... In default sjasmplus syntax `sub a,e` is `sub a : sub e` .... (but `sbc a,e` is `sbc a,e`!). That's multi-argument feature of sjasmplus (vs Zilog official syntax, which is ... unfortunate... in some cases).
I did add option `--syntax=a` to modify the "multi-argument" separator from "," to ",," ... then the `sub a,e` becomes single `sub e`.
But it's still possible to write multi-arg form with double-comma: `ld a,(hl) ,, (bc),a` ... still difficult to review such code and not recommended, but at least it makes it less surprising when converting asm from other syntax to sjasmplus.
I recommend to use "--syntax=abf" for new sjasmplus projects ... that means:
"a" for double-comma for multi-arg
"b" to report parentheses around expression when no memory access is allowed (`ld b,(mylabel+4)` is error, must be `ld b,mylabel+4` if it is not bug)
"f" is to report any fake instruction with warning (you can then suppress the warning with ";ok" or ";fake", if you really want the fake instruction)
That's mostly helpful for people who are returning to Z80 assembly after many years and they may not remember subtle details like that the official Zilog syntax is `sub e`, but `sbc a,e` and that `ld b,(adr)` or `sub hl,de` does not exist at all... but I'm using the same options even for my own sources, and I'm not complete Z80 beginner...
Anyway, pick it or leave it, it's your choice, but the `sub a,e` case was notorious issue among cz/sk Speccy coders, forgetting which of the two (sub vs sbc) requires two arguments. So after some thinking I decided to not modify default sjasmplus, but add extra option to add the double-comma way.
edit: if you are migrating old project from other assembler to sjasmplus, comparing the binary for different bytes is the simple way to verify if the conversion is correct... Then you can search in the listing file the area which is different and check what line is producing the different machine code. I did use this when I was helping to migrate one big MSX project from tniasm to sjasmplus.




Ответить с цитированием