Comments (5)
This seems to be a known issue, which would require major work on the parser code.
I found a workaround by PHF in the sourceforge repo, which I copied over into this github repo (in the release/2.20.12 branch).
As Peter says: "...in retrospect it seems obvious that these opcodes simply don't fit into the "regular pattern" of 8-bit CPUs we deal with in DASM".
Reference to commit on sourceforge: https://sourceforge.net/p/dasm-dillon/code/355/
Basically, the workaround is to use macros 'aimd', 'aimx', 'oimd', 'oimx', etc. Example:
.processor HD6303
.mac hack
dc.b {1} ; opcode
dc.b {2} ; immediate value
dc.b {3} ; zero-page address
.endm
.mac aimd
hack $71,{1},{2}
.endm
.mac aimx
hack $61,{1},{2}
.endm
.mac oimd
hack $72,{1},{2}
.endm
.mac oimx
hack $62,{1},{2}
.endm
.mac eimd
hack $75,{1},{2}
.endm
.mac eimx
hack $65,{1},{2}
.endm
.mac timd
hack $7b,{1},{2}
.endm
.mac timx
hack $6b,{1},{2}
.endm
.org $0
; the broken DASM versions
aim $10 ; assembles to 71 10
aim $10,x ; assembles to 61 10
oim $10 ; assembles to 72 10
oim $10,x ; assembles to 62 10
eim $10 ; assembles to 75 10
eim $10,x ; assembles to 65 10
tim $10 ; assembles to 7B 10
tim $10,x ; assembles to 6B 10
; the fixed macro versions
aimd $10,$20 ; should be "aim #$10,$20"
aimx $10,$20 ; should be "aim #$10,$20,x"
oimd $10,$20 ; should be "oim #$10,$20"
oimx $10,$20 ; should be "oim #$10,$20,x"
eimd $10,$20 ; should be "eim #$10,$20"
eimx $10,$20 ; should be "eim #$10,$20,x"
timd $10,$20 ; should be "tim #$10,$20"
timx $10,$20 ; should be "tim #$10,$20,x"
.end
from dasm.
Here are some specs of AIM instruction from the HD6803 handbook...
So, yes they are both 3-byte instructions, and there is an error.
Next, someone to fix this....?
from dasm.
This seems to be a known issue, which would require major work on the parser code.
As Peter says: "...in retrospect it seems obvious that these opcodes simply don't fit into the "regular pattern" of 8-bit CPUs we deal with in DASM".
IMO makes perfect sense to close this then.
from dasm.
I did a bit of looking at the code, and it seems to me that you would just need to add one or more "AF_*" flags, to handle the new addressing modes presented by these instructions. I did not look deep into the parser, but instead the definitions of the opcodes for the processor involved. Is it really such a hard thing to do this properly?
from dasm.
Maybe I have jumped to conclusions to soon; reopening the bug now....
from dasm.
Related Issues (20)
- Allow expressions access to generated code
- dasm not open on my windows HOT 1
- Error (?) with dynamic labels HOT 2
- Feature request: ability to specify exit code with ERR directive HOT 3
- Macros detects parameters in the false portion of #if/#else/#endif and IF/ELSE/ENDIF directives
- Hide LIST ON HOT 1
- Undefined values cause no errors
- Assembled output padded with 00 bytes HOT 2
- Support for 'mul' instructions on for 68HC705 HOT 5
- SEGV in error handling of command line parameters
- atari 2600 "macro.h": SLEEP macro causes unwanted bankswitching with some cartridge types (e.g. 3F) HOT 1
- 6502 addressing modes (indirect),Y and absolute,Y should support space between comma and Y
- Support for #elif directive
- [REQUEST] Add ".PROCESSOR 65C02" Mode and Opcodes HOT 2
- Dynamic labels are not working in an expression HOT 3
- Installation via Scoop HOT 1
- Apple ARM Support HOT 3
- vcs.h redistribution HOT 3
- Do you support custom opcodes? HOT 4
- Citation and Giving Credit
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 dasm.