Replies: 1 comment
-
Hmm, is there anything special about that single instruction that's not currently supported? Your example could be rewritten using the concatenation operator #ruledef
{
jump {addr} => 0x01 @ addr[15:8] @ 0x0003 @ 0x01 @ addr[7:0] @ 0x0001
} If you want to use constants, you have to declare them in the global scope: SOME_CONSTANT = 0x0003
#ruledef
{
jump {addr} => 0x01 @ addr[15:8] @ SOME_CONSTANT @ 0x01 @ addr[7:0] @ 0x0001
} The |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been looking for an assembler for my one-instruction CPU. It only executes the move function. Consequently, instructions are only a source address and destination address. It doesn't seem like this project really supports that type of instruction directly, but the #d directive can be used instead to create instructions. However, I find I can't use them in asm blocks. I guess I was trying to write a few #d in a row as a sort of macro compiler. Also, it looks like I can't use constants within an asm block. Am I doing something wrong?
#ruledef { jump {addr} => asm { #d08 0x01, addr[15:8] #d16 0x03 #d08 0x01, addr[7:0] #d16 0x01 } }
Beta Was this translation helpful? Give feedback.
All reactions