Comments (2)
The new :macro
facility resolves this nicely, as I'd hoped when I originally suggested it. The following program:
:macro foo { 0xAA }
:macro bar { 0xBB }
: main
foo
bar
Will compile as the bytes 0xAA 0xBB
.
from octo.
I replied to your email, but just for the purposes of keeping things documented I'll summarize here:
Constants declared with :const
are treated exactly like labels when used outside of instructions. The difference between the patterns here is that the constant references are compiled into calls to subroutines. This functionality is already used for building jump tables and by the disassembler for various reasons. It would be possible to alter the semantics of :const
to get the desired behavior, but I think a better resolution would be to create a new construct with this type of purpose in mind.
One proposal is the addition of a :macro
operative which would allow you to assign a name to a pattern of bytes which would be inlined wherever the name of the macro was used. A particularly nice aspect of this system is it could serve to simplify some parts of the existing assembler and make it easier to experiment with custom extended instruction sets. I'll give the precise syntax and semantics some thought and update this issue when I come to a final decision.
from octo.
Related Issues (20)
- A new feature for the XO-Chip sound system HOT 11
- Support mouse in addition to touch controls HOT 2
- Document another audio playback behavior into XO-ChipSpecification
- Broken link at end of Sorting.md
- Octo UI buttons are invisible on a white background
- Slight bug with the decompiler in the Octo IDE regarding the pitch opcode
- Plane 3 Bug (Only enables the first bit plane) HOT 2
- Gamepad visible in browser HOT 4
- XO-Chip manual section has a broken link to the XO-Chip spec in repo view
- Possible Instruction Prefix Support for XO-CHIP HOT 4
- Add support for viewport scaling to exported HTML HOT 1
- Yet Another Proposal: Stereo Audio with Multi-Voice Support (Sweet and Simple Design)
- Solving the difficulty of writing program's code beyond 4k with banking HOT 1
- No Audio Output Issue on HTML Output HOT 2
- collision enumeration quirk HOT 3
- scroll-up can scroll in pixels which aren't blank HOT 4
- Octo reads .sc8/.xo8 files as plaintext, should read them as binaries HOT 1
- Constants in data interpreted as call HOT 2
- Expected order of operations for vf HOT 2
- Maximum ROM Size for VIP too small 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 octo.