~crc_/napia-rohi

5a9c17739e86660ff4060525f979724a151a6620 — crc 7 months ago f996e13
add a "`r`eserve bytes" directive
1 files changed, 6 insertions(+), 0 deletions(-)

M rohi.c.unu
M rohi.c.unu => rohi.c.unu +6 -0
@@ 107,6 107,7 @@ The directives are:
    | j | target      | assemble a jump to a target           |
    | - | label       | inline halfword pointer to label      |
    | # | value       | inline halfword number                |
    | r | number      | reserve bytes                         |

A source for a standard Napia will normally start with an
`o 192` to set the code point just past the I/O memory. You can


@@ 345,6 346,7 @@ void find_labels(char *s) {
    case 'j': here += 4; break;
    case '?': here += 4; break;
    case 's': here += strlen(s+2) + 2; break;
    case 'r': here = here + atoi(s+2); break;
  }
}
~~~


@@ 388,6 390,7 @@ void standalone_numbers(char *s) {
    case 'j': here += 4; break;
    case '?': here += 4; break;
    case 's': here += strlen(s+2) + 2; break;
    case 'r': here = here + atoi(s+2); break;
  }
}
~~~


@@ 524,6 527,7 @@ void instructions(char *s) {
    case 'j': here += 4; break;
    case '?': here += 4; break;
    case 's': here += strlen(s+2) + 2; break;
    case 'r': here = here + atoi(s+2); break;
  }
}
~~~


@@ 557,6 561,7 @@ void strings(char *s) {
              s += 2;
              while (*s) { store_byte(*s++, here); here += 1; }
              break;
    case 'r': here = here + atoi(s+2); break;
  }
}
~~~


@@ 604,6 609,7 @@ void other_directives(char *s) {
              store_byte(36, here); here += 1;
              break;
    case 's': here += strlen(s+2) + 2; break;
    case 'r': here = here + atoi(s+2); break;
  }
}
~~~