Assume:
Reg 12
Reg 15
Loc 2006-2010 (before)
Loc 3007-3011 The instruction is: Op Code B, 00 00 20 00 00 00 30 00 Zl Z4 Z7 Z8 Z5
Y8 Y7 Y4 Y6 Y8
D,
6
Loc 2006-2010 (after) Y1 Y4 Y7 Y8 Y5
Condition codc: unchanged.
AND (Register to Register)
When two operands are combined by an AND, they
are matched bit for bit. If corresponding bits are both
1, the result is 1. If either is 0, the result is O. For
example, if the logical AND of register 5 and 6 is to
be taken,
Assume: Reg 6
Reg 5 (before)
The instruction is: Op Code RJ
NR 5 00000000000000000000000001011011 00000000000000000000000001110110 6 Reg 5 00000000 00000000 00000000 01010010 Condition code = 1; not all-zero result. OR When two operands are combined by an OR, they are
matched bit-for-bit. If either of the corresponding bits
is 1, the result is 1. If both are 0, the result is O. For
example, if the logical OR of register 5 and 6 is to be
taken,
Assume:
Reg 6 00000000 00000000 00000000 10110111 Reg 5 (before) 00000000 00000000 00000000 1110 11 0 1
The instruction is: Op Code OR 5 6
Heg 5 (after) 00000000 00000000 00000000 11111111
Condition code = 1; not all-zero result.
Exclusive OR When two operands are combined by an EXCLUSIVE OR, they are matched bit-for-bit. If the corresponding bits
match (both ° or both 1), the result is O. If they differ,
the result is 1. For example, if the EXCLUSIVE OR of
register 5 and 6 is to be taken,
Assume:
Reg 6 00000000 00000000 00000000 10110111 Reg 5 (before) 00000000 00000000 00000000 111011 0 1
The instruction is: Op Code R, XR 5 6 Beg 5 (after) 00000000 00000000 00000000 01011010 Condition code = 1; not all-zero result.
Test Under Mask
Test bit positions 0, 2, 3, and 6 of a given byte in
storage to determine if all of these bit positions contain
ones. A TEST UNDER MASK with a mask of 10110010 ==
178
lO is used. The byte to be tested is stored at loca­
tion 1250 and contains 01101101. Assume: Beg 10 00 00 12 00 The instruction is: Op Code '" D, TM 178 10 50 t-.1ask from TM
Byte testcd
Selected result
Condition code
bits are 1. Insert Character 10110010 01101101 0- 10 -- 0- 1; some selected hits are 0, some selected
The character at location 4200 is to be inserted into
the low-order eight bits of register 7.
Assume:
Reg 7 (before)
Heg4 Reg 5
Loc 4200 The instruction is: Op Code R, Ie 7 00000000 10110110 11000101 01101101 00 00 02 00 00 00 30 00 00001011 x, 4 5 1000 J
Reg 7 (after) 00000000 101101101100010100001011 Condition code: unchanged.
Load Address
The effective address obtained by adding 1000 to the
low-order 24 bits of general registers 3 and 2, is to be
placed in general register 4.
Assume:
Reg 4 (before)
Reg 3
Reg 2
The instruction is: Op Code LA 4 Reg 4 (after)
3
Condition code: unchanged.
73 16 00 12 00 03 00 10 00 00 02 00 2 00 03 12 10 1000 Appendix A 125
TranslatEt Assume a stream of 20 characters comes into location 2100 in ASCII code (extended to eight bits). Translate
to EBCDIC.
Assume:
Reg 12
Reg 15 00 00 20 00 00 00 10 00 Loc 2100-2119 (before) JOliN JONES 257 W. 95
The instruction is: 0 , o. 100 ;) 115 o
Loc 2100-2119 (after) JOHN' JONES 257 where the over bar means the same graphic in EBCDIC.
Condition code: unchanged.
Translate Table 1000 r---- 1015 1----t--4--t---+---t--+--+-+--+--,-' --"""t---+--+'-+----+----t 1016 f---l---+-+----+-.--I-,-,- --, ---, -,-,,' , -"'-, ""'--"-,--, 1032 - _. -_. --+--t---"-+-"-'j-'-- +-- ,- -,- ""'" - , 1048 ,--'- 1064 BI ( + 1080 &
$ * )
- t"""--+- -'j-'-+-"- t----+---t-----jf----c-I--=' ,',' """-
Assume:
Reg 1 (before) Reg 2 (before) Reg 12 Reg 15
Loc 3000-3029 The instruction is: Op Code 00 00 00 00 00 00 00 00 00 00 30 00 00 00 20 00 UNPK PHOUT (9), WORD ( 5 )
0, 0, ---"I:o- 12 --r-1--o ---;),--,-1"""-1 Reg 1 (after) 00 00 30 11 Reg 2 (after) 00 00 00 20 Condition code = 1; scan not completed.
In general, TRANSLATE AND TEST is executed by use
of EXECUTE, which supplies the length specification
from a register. In this way a complete statement scan
can be performed with a single TRANSLATE AND TEST instruction repeated over and over by means of
EXECUTE. This is done by computing the length of the
remaining part of the statement to be scanned in a
general register, and referencing that register in the
Rl field of EXECUTE, whose address references a TRANS­ LATE AND TEST instruction in which L=O, Bl=1, Dl=1
and the B2 and D2 reference the table to be used 'in
the scan.
Translate and Test Table 2015 1096 / -; % 2000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ,--- ---- -,-- -,- - -- -- ,-- - r'- f"--- -,--,--" '- 1112
@ ... = 2016 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 I---t----+-+---+---I-"-- -,---" -"-, '-,--, ---/----I----t- -- 1128
abc de 9 hi f---t----t---j---+---I---j---- --" ",,--,1,-- 1144 I---t--_--t_-t- __ --+-_m_-t-n--t_
o
_
t-
P
, q ,',' 1 ",' 1160 u v w x y z I----t---j--t---t---t--/-----' -- ---t-'-+' "-f --- "-,- --,--"" ""
1176
1192 1208 1224
ABC D
G H I I---t----j--I---t---t--t---t----t"-"- ,-,--, ,"- ,,"-- K LMNOP QR ,-- ---- -_. __ . ,""",,-- ----
T U V W X y Z '""""'" 2 3 4 5 6 7 8 9 ,',-,-""- .... _-- ,-,- ,-,--""-"" -,- "" -- '""- -- 1256
Note: If all possible combinations of eight bits (i.e., 256 combinations)
cannot appear in the statement being translated, then a table of less than 256 bytes can be used. Translate and Test
Assume that an Autocoder statement, located on 3000- 3029, is to be scanned for various punctuation marks.
A translate and test table is constructed with zeros in
all positions except where punctuation marks are
assigned.
126 2032 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 --- 2048 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -- -- 2064 0 0 0 0 0 0 0 0 0 0 0 10 15 20 25 0 -- --- 2080 90 0 0 0 0 0 0 0 0 0 0 30 35 40 45 0 -- -- 2096 80 85 0 0 0 0 0 0 0 0 0 50 55 0 0 0 -- 2112 0 0 0 0 0 0 0 0 0 0 0 60 65 70 75 0 f--- - -_.- --_.
2128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -"-_.-- 1-- --- I----- --,- -- I---- 1---- -- 2144 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .. _- ---- 2160 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1--- I-- -" r---- --r---- -- ------
2176 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -- - ,-"-" 2192 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -- --,- 2208 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -,-- -- I-- --, --- r---- - - -"'" '" 2224 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2240 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 :-:- 2256
Note: If all possible combinations of eight bits (i.e., 256 combinations)
cannot appear in the statement being scanned, then a table less than
256 bytes can be used.
Previous Page Next Page