tr.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. # include "t.h"
  10. /* tr.c: number register allocation */
  11. char *nregs[] = {
  12. /* this array must have at least 3*qcol entries
  13. or illegal register names will result */
  14. "40", "41", "42", "43", "44", "45", "46", "47", "48", "49",
  15. "50", "51", "52", "53", "54", "55", "56", "57", "58", "59",
  16. "60", "61", "62", "63", "64", "65", "66", "67", "68", "69",
  17. "70", "71", "72", "73", "74", "75", "76", "77", "78", "79",
  18. "80", "81", "82", "83", "84", "85", "86", "87", "88", "89",
  19. "90", "91", "92", "93", "94", "95", "96", "97", "4q", "4r",
  20. "4s", "4t", "4u", "4v", "4w", "4x", "4y", "4z", "4;", "4.",
  21. "4a", "4b", "4c", "4d", "4e", "4f", "4g", "4h", "4i", "4j",
  22. "4k", "4l", "4m", "4n", "4o", "4p", "5a", "5b", "5c", "5d",
  23. "5e", "5f", "5g", "5h", "5i", "5j", "5k", "5l", "5m", "5n",
  24. "5o", "5p", "5q", "5r", "5s", "5t", "5u", "5v", "5w", "5x",
  25. 0
  26. };
  27. char *
  28. reg(int col, int place)
  29. {
  30. if (nelem(nregs) - 1 < 3 * qcol)
  31. error("Too many columns for registers");
  32. return (nregs[qcol*place+col]);
  33. }