|Calculating offset for SKIP instruction [message #1159540]
||Mon, 28 October 2013 16:01
| Gary Worsham
Registered: September 2013
My DSL (adding functionality to a DSP assembly language) is going quite well. This is amazing to me as 4 weeks ago I had very little idea what a DSL even was. It turns out that Xtext and Xtend are exactly what I was looking for. I just wish I'd known about them sooner! |
Here's my current issue.
I need to be able to count the lines that occur between a line such as:
SKIP (RUN_FLAG, init)
Needs to parse to:
SKIP (RUN_FLAG, 3)
My first thought was to start pushing instructions into a FIFO queue as soon as I hit the "Skip" instruction, then count how many are consumed until I find the matching label. After that I could complete the Skip instruction and process the instructions that went into the queue. But this is sounding a little complicated, assuming that there is an easier way.
I am pretty sure that Skip instructions only need to go forward, but I'll double check.
Powered by FUDForum
. Page generated in 0.17719 seconds