# New Ticket Created by  Klaas-Jan Stol 
# Please include the string:  [perl #47846]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=47846 >


>From the beginning IMCC has had the ".emit"/".eom" pair of directives.
The idea is that they can be used to emit pure pasm instructions,
without the need for any .sub.
An example is this:

.sub main
 print "hi!"
.end

.emit
  print "there"
  set I0, 42
  print I0
.eom

However, this feature is never used. If you ack for ".emit" or ".eom",
the only files that contain these words are the PIR compilers
(compilers/imcc, compilers/pirc) and the test files for these
compilers.

Moreover, it seems it's a rather useless as well. If you compile the
above example to PASM (using parrot -o - test.pir), the result will
be:

main:
 print "hi!"
 set_returns
 returncc         # <<== leaving here

 print "there"
 set I0, 42
 print I0

So, in other words, these instructions are never executed. The only
case in which it would be useful would if this instruction block would
get a label, but in that case it would be better to use a pir .sub.

Summarizing, IMHO this "feature" can be removed.

Comments welcome,

kjs

Reply via email to