Ejemplo n.º 1
0
void	check_arg(char *cmd, char *args, t_label *list)
{
  if (my_strcmp(cmd, "live") == 0)
    check_live(args, cmd, list);
  else if (my_strcmp(cmd, "fork") == 0)
    check_live(args, cmd, list);
  else if (my_strcmp(cmd, "lfork") == 0)
    check_live(args, cmd, list);
  else if (my_strcmp(cmd, "zjump") == 0)
    check_live(args, cmd, list);
  else if (my_strcmp(cmd, "ld") == 0)
    check_ld(args, cmd, list);
  else if (my_strcmp(cmd, "st") == 0)
    check_st(args, cmd);
  else if (my_strcmp(cmd, "add") == 0)
    check_add(args, cmd);
  else if (my_strcmp(cmd, "sub") == 0)
    check_add(args, cmd);
  else if (my_strcmp(cmd, "and") == 0)
    check_and(args, cmd, list);
  else if (my_strcmp(cmd, "or") == 0)
    check_and(args, cmd, list);
  else if (my_strcmp(cmd, "xor") == 0)
    check_and(args, cmd, list);
  else if (my_strcmp(cmd, "ldi") == 0)
    check_ldi(args, cmd, list);
  check_argnext(cmd, args, list);
}
Ejemplo n.º 2
0
int	send_arg_check(int code, char **params)
{
  if (code == 1 || code == 9 || code == 12 || code == 15)
    return (check_live(params));
  else if (code == 6 || code == 7 || code == 8)
    return (check_xor(params));
  else if (code == 4 || code == 5)
    return (check_add(params));
  else if (code == 10 || code == 14)
    return (check_ldi(params));
  else if (code == 11)
    return (check_sti(params));
  else if (code == 2 || code == 13)
    return (check_ld(params));
  else if (code == 16)
    return (check_aff(params));
  else if (code == 3)
    return (check_st(params));
  return (0);
}