Closed rgiot closed 3 years ago
There is an incomplete math function called GETNOP doing this
Usage is GETNOP('out (c),a') with quotes inside parenthesis
DURATION will be an alias for GETNOP when in CPC mode and an alias for GETTICK (in the future) to get Z80 ticks instead of CPC nop duration
WIP!
with last commit, all opcodes are supported avoid using variables in duration code because parsing is very simple for data or label, use 0 or $ or (ix+0) it should be fine
The following sample file illustrates a simple example that works properly with my toy assembler: https://github.com/cpcsdk/rust.cpclib/blob/master/cpclib-asm/tests/duration.asm and deserves to be available with rasm.
To add this function will allow people that write stable code to not search the execution time of an opcode.
Example:
Note that most complex cases would better fit with the
TIMER
-like directives.Maybe a function that takes a single line listing would be better: