Comments (7)
Hey thanks for the feedback! The encoding strategy you've proposed is really nice compared with my brute force LDV16
pseudo approach 😄. The only problem I could possibly see is that all numbers are unsigned, so it wouldn't be possible to use ADI d, -1
.
That said, a lot of what you've said could definitely improve the language. Would you be interested in opening a pull request with you're proposed changes?
from 16bitjs.
What do you mean by "all numbers are unsigned"? for a 16-bit addition, the result with signed or unsigned addends is the same. For instance, 0xFFFE + 0xFFFF = 0xFFFD. 0xFFFD can be seen as 65533 or -3, it's just a subjective viewpoint. When using ADD mode through bit 0 in OO, you just need to sign-extend the immediate value before adding it to register.
from 16bitjs.
"opening a pull request with you're proposed changes": do you suggest for me to clone your project, do the changes and then open pull request here?
from 16bitjs.
for a 16-bit addition, the result with signed or unsigned addends is the same. For instance, 0xFFFE + 0xFFFF = 0xFFFD. 0xFFFD can be seen as 65533 or -3, it's just a subjective viewpoint
Ah good point. As for pull request, yes that's normally the easiest way.
from 16bitjs.
hum, there are that assembler and that bf compiler... if I don't want to touch that bf compiler, I'd better to keep LDV16 but as a pseudo using the new instruction and define LDV as a pseudo as well. I could also keep INC and DEC the same way. But I would need to rename the real instruction LDV with another name - unless there is a way to have an optional third argument, that is LDV D, imm <=> LDV D, imm, 0
. Is that possible?
from 16bitjs.
3rd argument can definitely work. While I agree the names are not the best, I'd rather take the path of least resistance when it comes to changes.
from 16bitjs.
Merged proposal to master
from 16bitjs.
Related Issues (20)
- LDV16 B, value probably doesn't work HOT 1
- LICENCE isn't filled in HOT 2
- Replace JMP with a CMP instruction, and rename JMR to JMP HOT 11
- Extend LDR with offset mode HOT 4
- Security issue: code execution when assembling files HOT 2
- Merge SYS, HLT and RET since they no arguments HOT 4
- Trouble to use "node src/assembler" HOT 2
- MOV - using the upper 8 bits to store a sign-extended immediate as an addend HOT 2
- Add optional offset to LDR HOT 1
- Rename LDM to STA HOT 1
- Rename LDP to STR with an optional 8 bit offset HOT 6
- LDA/LDM/LDR/LDP become LDA/STA/LDR/STR HOT 7
- Refactor JLT to JCP (Jump ComPare) HOT 1
- An example (but incomplete) of ISA using almost the same rules of 16bitjs
- Improve debugger HOT 6
- Convert to signed 16 but integer format HOT 1
- SWAP - this pseudo can be done through 3 XORs HOT 10
- STACK - some RISC CPUs don't have a PUSH and POP instructions
- Missing ESLint configuration HOT 2
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 16bitjs.