Comments (4)
Thank you for report, but seems a bit inaccurate.
add a,32
does produce C6 20
in default mode, so no, it does not produce two add instructions.
What you have maybe seen is sub a,32
which in official Zilog syntax should be sub 32
(add a,32
is Zilog syntax).
Anyway, you are hitting the "multi-argument" default, I added --syntax
option to fine tune some of the default behaviour, because I didn't like it either. You can apply them directly from the source code by OPT
directive, like this:
# file opened: <stdin>
1 0000 start: ; default mode will produce this:
2 0000 97 D6 20 sub a,32
3 0003 06 00 ld b,(start)
4 0005 62 6B ld hl,de
5 0007 OPT --syntax=abf ; multi-arg delimiter ",,", warn about extra parentheses and fake instr.
6 0007 D6 20 sub a,32
<stdin>(7): error: Illegal instruction (can't access memory): (start)
7 0009 06 00 ld b,(start)
<stdin>(8): warning[fake]: Fake instruction: ld hl,de
8 000B 62 6B ld hl,de
9 000D
# file closed: <stdin>
I always suggest to use --syntax=abf
for new projects, but I can't change the default without making several old users angry (already tried it :) ).
I hope this is sufficient for you and helps, let me know (close the issue if this is what you were looking for and works as needed).
Check http://z00m128.github.io/sjasmplus/documentation.html#s_cli for --syntax options list.
from sjasmplus.
Ah, sorry, yes it was sub and not add. I tried your options and it didn't seem to produce any error for sub, even explicit in the source
CHARDATA PUSH DE
OPT --syntax=abf ;
SUB A,32
LD H,0
LD L,A
Executing task: c:\specnext\sjasmplus.exe C:\SpecNext\sources\Utility.asm --raw=c:\specnext\sources\scripts\Utility --zxnext=cspect --syntax=abf
SjASMPlus Z80 Cross-Assembler v1.20.3 (https://github.com/z00m128/sjasmplus)
Pass 1 complete (0 errors)
Pass 2 complete (0 errors)
Utility.asm(107): warning[fake]: Fake instruction: SUB HL,DE
Utility.asm(327): warning[fake]: Fake instruction: LD IX,HL
Pass 3 complete
Errors: 0, warnings: 2, compiled: 375 lines, work time: 0.016 seconds
from sjasmplus.
It will not produce error, but it will produce only sub 32
accepting the explicit A silently.
To get multi-arg sub with the "--syntax=a" option you would have to write sub a,,32
(double comma), so you can't use the multi-arg by accident so easily. The only exception are push/pop/dec/inc
which will accept single comma multi-arg even in syntax=a mode (as there's no ambiguity about these).
Whether you write the implicit A is optional, sjasmplus has pretty relaxed syntax to accept all common variants where possible and guess what you wanted to achieve.
Again see my example listing, the sub a,32
in default setting does produce machine code 97 D6 20
which is two sub instructions, after the OPT
line it does produce only D6 20
which is the sub 32
.
from sjasmplus.
Thanks for the clarification ... and the excellent assembler.
from sjasmplus.
Related Issues (20)
- allow defining custom Devices
- Building on Alpine Linux fails due to clash with constant in musl limits.h HOT 1
- SAVETAP: codeblock of 166 bytes length starting at 0xFF59 saved to .tap HOT 2
- Typo on warning
- [1.20.1][ubuntu 22.04][mingw-w64] Can't compile windows exe without modifying Makefile // Recommendation in Makefile is also not full
- Allow multiple labels as arguments of IFUSED HOT 3
- Multiple ORG directives silently ignored? HOT 2
- Interest in adding a new Z80 device ? VZ200/Laser210 HOT 3
- Incorrect compilation of DC with one symbol in single quotes HOT 5
- Not everything works after return from snapshot to Basic HOT 2
- Arrow keys and ESC don't work after invoking sjasmplus HOT 5
- Tests may fail due to locale settings
- duplicate lables HOT 1
- get include length size HOT 2
- bplist: MAME support HOT 1
- union HOT 1
- lua block parsing inside macro is not aware of being inside lua block, applying sjasmplus parsing rules (colons!) HOT 1
- Missing FAKE INSTRUCTIONS like "ex bc, hl" and other combinations that exploit "ex (sp), rr" HOT 4
- INCBIN command assumes current OS path based on the .asm file where it resides. Does this have to be the case? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sjasmplus.