xref: /original-bsd/sys/tahoe/align/Amovzb.c (revision b65ab6e5)
1*b65ab6e5Sbostic /*-
2*b65ab6e5Sbostic  * Copyright (c) 1986 The Regents of the University of California.
3*b65ab6e5Sbostic  * All rights reserved.
4*b65ab6e5Sbostic  *
5*b65ab6e5Sbostic  * This code is derived from software contributed to Berkeley by
6*b65ab6e5Sbostic  * Computer Consoles Inc.
7*b65ab6e5Sbostic  *
8*b65ab6e5Sbostic  * %sccs.include.redist.c%
9*b65ab6e5Sbostic  *
10*b65ab6e5Sbostic  *	@(#)Amovzb.c	7.1 (Berkeley) 12/06/90
11*b65ab6e5Sbostic  */
12675c637bSsam 
13f5878f6dSbostic #include "align.h"
movzb(infop)14675c637bSsam movzb(infop) 	process_info *infop;
15675c637bSsam /*
16675c637bSsam /*	Move byte to word or longword, zero-extended
17675c637bSsam /*
18675c637bSsam /****************************************/
19675c637bSsam {
20675c637bSsam 	register long result;
21675c637bSsam 	register struct oprnd *oppnt;
22675c637bSsam 
23675c637bSsam 	oppnt = operand(infop,0);
24675c637bSsam 	result = oppnt->data;
25675c637bSsam 	negative_0;
26675c637bSsam 	if (result == 0 )  zero_1 ; else zero_0;
27675c637bSsam 	overflow_0;  carry_1;
28675c637bSsam 	if ((oppnt->mode & 0xff) == Dir)
29675c637bSsam 		write_back (infop, result , operand(infop,1) );
30675c637bSsam 	else write_back (infop, result & 0xff, operand(infop,1) );
31675c637bSsam }
32