Example #1
0
 def asm_code(self):
     code = """
         #DATA
     """
     code += Ray.asm_struct() + Sphere.asm_struct() + HitPoint.asm_struct() + """
         Ray ray1
         Sphere sph1
         Hitpoint hp1
         float min_dist = 99999.000
         uint32 ret
         #CODE
         macro mov eax, ray1
         macro mov ebx, sph1
         macro mov ecx, min_dist
         macro mov edx, hp1
         call ray_sphere_intersection 
         mov dword [ret], eax
         #END
     """
     return code
Example #2
0
 def asm_code2(self):
     code = """
         #DATA
     """
     code += Ray.asm_struct() + Sphere.asm_struct() + """
         Ray ray1
         Sphere sph1
         float min_dist = 99999.000
         uint32 ret
         float t
         #CODE
         macro mov eax, ray1
         macro mov ebx, sph1
         macro mov ecx, min_dist
         call ray_sphere_intersection 
         mov dword [ret], eax
         macro eq32 t = xmm0 {xmm0}
         #END
     """
     return code
Example #3
0
 def asm_code2(self):
     code = """
         #DATA
     """
     code += Ray.asm_struct() + Sphere.asm_struct() + """
         Ray ray1
         Sphere sph1
         float min_dist = 99999.000
         uint32 ret
         float t
         #CODE
         macro mov eax, ray1
         macro mov ebx, sph1
         macro mov ecx, min_dist
         call ray_sphere_intersection 
         mov dword [ret], eax
         macro eq32 t = xmm0 {xmm0}
         #END
     """
     return code
Example #4
0
 def asm_code(self):
     code = """
         #DATA
     """
     code += Ray.asm_struct() + Sphere.asm_struct() + HitPoint.asm_struct(
     ) + """
         Ray ray1
         Sphere sph1
         Hitpoint hp1
         float min_dist = 99999.000
         uint32 ret
         #CODE
         macro mov eax, ray1
         macro mov ebx, sph1
         macro mov ecx, min_dist
         macro mov edx, hp1
         call ray_sphere_intersection 
         mov dword [ret], eax
         #END
     """
     return code