public void Visit(GreaterThanEquals m) { /* Console.WriteLine("pop stack into a"); * Console.WriteLine("pop stack into b"); * Console.WriteLine("push a 1 if carry flag or z flag set"); */ sw.WriteLine("\t;building a >= operation"); PopAndCompare(); //carry flag is not set or the //zero flag is set //zc //00 - less than //11 - equal //01 - gte //need to determine that carry flag is 0 sw.WriteLine("\tphp ; flags -> a"); sw.WriteLine("\tpla"); sw.WriteLine("\tand #1 ; isolate c for >="); // sw.WriteLine("\tcmp #0 ; test"); // sw.WriteLine("\tphp ; flags -> a"); // sw.WriteLine("\tpla"); // sw.WriteLine("\tand #1 ; mask it"); sw.WriteLine("\tpha ; push result of gte (carry == 1)"); }
public void Visit(GreaterThanEquals m) { //push a 1 if c == 0 sw.WriteLine(Tabs() + "//a >= b"); sw.WriteLine(Tabs() + "param2 = param_stack_pop();"); sw.WriteLine(Tabs() + "param1 = param_stack_pop();"); sw.WriteLine(Tabs() + "param_stack.push(param1 >= param2);"); }
public void Visit(GreaterThanEquals m) { //push a 1 if c == 0 sw.WriteLine("\tnop ;a >= b"); sw.WriteLine("\tpop bx"); sw.WriteLine("\tpop ax"); sw.WriteLine("\tcmp ax,bx"); sw.WriteLine("\tcmc ; flip bits"); sw.WriteLine("\tpushf"); sw.WriteLine("\tpop ax"); sw.WriteLine("\tand ax,1 ; isolate c"); sw.WriteLine("\tpush ax"); }
public void Visit(GreaterThanEquals m) { //push a 1 if c == 0 sw.WriteLine("\t;a >= b"); sw.WriteLine("\tpuls a"); sw.WriteLine("\tsta temp"); sw.WriteLine("\tpuls a"); sw.WriteLine("\tcmpa temp"); sw.WriteLine("\ttfr cc,a"); sw.WriteLine("\tcoma ; flip bits"); sw.WriteLine("\tanda #1 ; isolate c"); sw.WriteLine("\tpshs a"); }
public void Visit(GreaterThanEquals m) { //push a 0 if carry = 1 sw.WriteLine("\t; a >= b"); sw.WriteLine("\tpop bc"); sw.WriteLine("\tpop af"); sw.WriteLine("\tcp b"); sw.WriteLine("\tdb 28h ; jr z,8 - skip to load 1"); sw.WriteLine("\tdb 8h ; "); sw.WriteLine("\tdb 30h ; jr cc,6 ; skip to load 1"); sw.WriteLine("\tdb 6; "); sw.WriteLine("\tld a,0"); sw.WriteLine("\tdb 18h ; jr ; jump to push af"); sw.WriteLine("\tdb 4"); sw.WriteLine("\tld a,1"); sw.WriteLine("\tpush af"); }