예제 #1
0
 public void Visit(PropAssignment m)
 {
     /*;set_object_property
      *  ; top = object #id
      *  ; under that = prop# ( 0 - 15)
      *  ; under that = value (0 or 1)
      */
     sw.WriteLine("\t; writing set obj prop");
     sw.WriteLine("\tpuls b ; pull value (rhs)");
     sw.WriteLine("\tclra ; ");
     sw.WriteLine("\ttfr d,x ; ");
     sw.WriteLine("\tpuls b ; pull obj # (lhs)");
     sw.WriteLine("\ttfr d,y ; save obj # param");
     try
     {
         sw.WriteLine("\tldb #" + propIndexes[m.propName] + " ;" + m.propName);
     }
     catch (Exception e)
     {
         throw new Exception(m.propName + " is not a valid attr for " + m.objName, e);
     }
     sw.WriteLine("\tpshs x ; push value param");
     sw.WriteLine("\tpshs d ; push prop # param");
     sw.WriteLine("\tpshs y ; push obj # param");
     sw.WriteLine("\tjsr set_object_prop");
     sw.WriteLine("\tleas 6,s");
 }
예제 #2
0
        public void Visit(PropAssignment m)
        {
            sw.WriteLine("\t;set property");

            /*
             * sets property c of object b to val in register 'a'
             * the property should be 0 - 15 inclusive
             */
            sw.WriteLine("\tpop af  ; pop value");
            //sw.WriteLine("\tld b," + game.GetObjectId(m.objName));
            sw.WriteLine("\tpop bc  ; object id");
            sw.WriteLine("\tld c," + propIndexes[m.propName] + " ; " + m.propName);
            sw.WriteLine("\tcall set_obj_prop");
        }
예제 #3
0
        public void Visit(PropAssignment m)
        {
            /*;set_obj_property
             *  ; top = value (0 or 1)
             *  ; under that = object #id
             */

            try
            {
                sw.WriteLine(Tabs() + "param3 = param_stack_pop() ; //save value");
                sw.WriteLine(Tabs() + "param1 = param_stack_pop() ; //save obj id");
                sw.WriteLine(Tabs() + "param2 = " + propIndexes[m.propName] + " ; //" + m.propName);
                sw.WriteLine(Tabs() + "set_object_prop(param1,param2,param3);");
            }
            catch (Exception e)
            {
                throw new Exception(m.propName + " is not a valid attr for " + m.objName, e);
            }
        }
예제 #4
0
        public void Visit(PropAssignment pa)
        {
            sw.WriteLine("\t; building property assignment call");

            //id,attr,and val are on stack

            sw.WriteLine("\tpla ; pull rhs off stack");
            sw.WriteLine("\ttay ; val goes in Y");
            try
            {
                sw.WriteLine("\tldx #" + propIndexes[pa.propName] + " ; " + pa.propName);
            }
            catch
            {
                throw new Exception(pa.propName + " is not a valid property");
            }
            sw.WriteLine("\tpla ; pull object id");
//            sw.WriteLine("\tlda #" + game.GetObjectId(pa.objName) + " ; " + pa.objName);
            sw.WriteLine("\tjsr set_obj_prop");
            //          Console.WriteLine("call set_obj_prop");
        }
예제 #5
0
        public void Visit(PropAssignment m)
        {
            /*;set_obj_property
             *  ; top = value (0 or 1)
             *  ; under that = object #id
             */

            try
            {
                sw.WriteLine("\tpop cx ; save value");
                sw.WriteLine("\tpop bx ; save obj id");
                sw.WriteLine("\tmov  ax," + propIndexes[m.propName] + " ;" + m.propName);
                sw.WriteLine("\tpush cx ; push value");
                sw.WriteLine("\tpush  ax ; push prop number");
                sw.WriteLine("\tpush bx ; push object id");
                sw.WriteLine("\tcall set_obj_prop");
                sw.WriteLine("\tadd sp,6 ; pop params");
            }
            catch (Exception e)
            {
                throw new Exception(m.propName + " is not a valid attr for " + m.objName, e);
            }
        }