/sys/tahoealign -> /sys/tahoe/align
[unix-history] / usr / src / sys / tahoe / align / Awrite_byte.c
CommitLineData
6499767c 1/* Awrite_byte.c 1.2 90/12/04 */
84114849 2
6499767c 3#include "align.h"
84114849
SL
4
5write_byte (infop,byte, where)
6process_info *infop;
7long byte;
8struct oprnd *where;
9/*
10/* Put the 'byte' at the given address in
11/* tahoe's memory.
12/*
13/* 1. Only the least significant byte is written.
14/*
15/**************************************************/
16{
17 register struct operand_des *look_at;
18
19 look_at = &Table[opCODE].operand[last_operand];
20 if (! (look_at->add_modes & NOVF))
21 if (byte > 0x7f || byte < -0x80) overflow_1;
22 if (!(where->mode & W)) exception(infop, ILL_ADDRMOD);
23 switch (where->mode & ADDFIELD) /* Mask out R/W bits */
24 {
25 case Add:
26 put_byte(infop, byte, where->address);
27 break;
28 case Dir:
29 Replace (infop, where->reg_number, byte);
30 break;
31 case SPmode:
32 where->mode = where->mode & ~SPmode | Add;
33 write_longword (infop, byte, where);
34 break;
35 default:
36 printf("Unknown destination in write_byte (alignment code)\n");
37 };
38}