README: describe more syntax

This commit is contained in:
Zack Buhman 2023-08-24 12:16:40 -07:00
parent 6647d6ddda
commit a8572a7fb8
2 changed files with 79 additions and 18 deletions

View File

@ -124,9 +124,9 @@ emit "add mode 1" via the ``DMA1`` and ``DMAH1`` mnemonics.
DMA "add mode" and bytes DMA "add mode" and bytes
------------------------ ------------------------
All of the documentation you have read is invalid; here is the correct All of the documentation you have read is invalid; this is the correct
relationship between DMA "add mode" mnemonics, and the number of relationship between DMA "add mode" mnemonics. The right columns represent the
incremented bytes: the increment added an offset of RA0/WA0 after each bus transfer:
.. list-table:: .. list-table::
:header-rows: 1 :header-rows: 1
@ -159,3 +159,63 @@ incremented bytes:
* - DMA64 * - DMA64
- 4 bytes - 4 bytes
- 128 bytes - 128 bytes
Note that the DMA transfer length is always decremented by 1 after 4 bytes are
transferred, regardless of the size of the bus transfer.
The SCU manual (ST-97-R5-072694) contains this contradictory text:
Only add numbers 0 and 1 are valid for the A-Bus and the write unit is
32bit. [...] Write unit is 16bit; 32bit data is divided in half and written
at intervals of 16X (0-64).
"Multiply the 'add number' by the [number of bytes per transfer] **depending on
the value of WA0/RA0**" is completely incorrect. The text in the original
Japanese document is also incorrect.
Syntax features that are supported, but with misleading consequences
====================================================================
``NOP`` mnemonics inside OP instructions
----------------------------------------
In both scu-dsp-asm and ``dspasm.exe``, ALU, X-bus, Y-bus, and D1-bus mnemonics
may appear in any order in a single OP instruction and/or line of source code.
From a grammar perspective, it is impossible to disambiguate which bus a ``NOP``
is referring to. For example, this is valid code:
.. code::
NOP NOP NOP NOP MOV MUL,P
Even though it visually might appear that the X-bus operation might be
simultaneously ``NOP`` and ``MOV MUL,P``, due to syntactical ambiguity the
assembler is not able to generate an error for this case.
There is no restriction on the number of ``NOP`` values that can appear on a
single line.
Feel free to use this syntax feature if desired stylistically, but be aware
scu-dsp-asm is not able to verify intent, and does not/can not generate errors
related to a "conflict" between a ``NOP`` mnemonic and any other bus operation.
Immediates with ``:``-suffixes or ``#``-prefixes
------------------------------------------------
In both scu-dsp-asm and ``dspasm.exe``, neither of these characters mean
anything in the grammar. If encountered, they are ignored.
For example, all of the following is valid source code:
.. code::
MVI #1,MC0
MVI 1:,MC0
MVI #foobar,MC0
MVI #foobar:,MC0
MVI #1+1:,MC0
MVI #(1+1):,MC0
Feel free to use these characters if desired stylistically, but be aware that
scu-dsp-asm does not generate errors regardless of how they are used.

View File

@ -2,6 +2,7 @@ V=2
M=scu-dsp-asm.$V M=scu-dsp-asm.$V
make TARGET=x86_64-pc-linux-gnu- MAIN=$M.Linux.x86_64 clean all make TARGET=x86_64-pc-linux-gnu- MAIN=$M.Linux.x86_64 clean all
make TARGET=aarch64-unknown-linux-gnu- MAIN=$M.Linux.aarch64 clean all
make TARGET=x86_64-w64-mingw32- MAIN=$M.Windows.x86_64.exe clean all make TARGET=x86_64-w64-mingw32- MAIN=$M.Windows.x86_64.exe clean all
make TARGET=i686-w64-mingw32- MAIN=$M.Windows.i686.exe clean all make TARGET=i686-w64-mingw32- MAIN=$M.Windows.i686.exe clean all
#make MAIN=$M.MacOS-Ventura.x86_64 clean all #make MAIN=$M.MacOS-Ventura.x86_64 clean all