MegaProcessor

Check-in [e41893a465]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Minor corrections..
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e41893a46510c82ba1c2660f649ac577e40eccf2
User & Date: jos 2015-07-01 22:03:13
Context
2015-07-06
21:30
Test evaluation of postbytes for 0xd8..0xdb instructions. check-in: 991e20501d user: jos tags: trunk
2015-07-01
22:03
Minor corrections.. check-in: e41893a465 user: jos tags: trunk
2015-06-28
15:22
Added separate doc on bitwise shifts/rotates and bit-set/test/change instructions. check-in: a29fe1795d user: jos tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to bit_ops.txt.

1
2
3
4
5
6
7
8
9
10
11
12
13
..
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Bit operations of the MegaProcessor.

The opcodes 0xD8..0xDF encode the various bit shift-, rotate-, test- and change operations.
Each of these 8 opcodes take a postbyte to encode the exact operation.

The first byte of a bit-opeation only determines the destination, as shown in the table below.

<table>
0xD8 : R0 for LSL, LSR, ASL, ROL, ROR, ROXL, and ROXR instructions
0xD9 : R1    "       "       "     "      "      "      "
0xDA : R2    "       "       "     "      "      "      "
0xDB : R3    "       "       "     "      "      "      "

................................................................................

To select between the tables for decoding of second byte below
    table = ( (b1 >> 3) & 0x01 )  -- 0 means 0xd8..0xdb, 1 means 0xdc..0xdf

Decoding of second byte [b2] for instructions 0xD8..0xDB
<table>
2nd byte    : fixed part : variable part
0x00..0x0f  :   LSL Rx,     #0 .. #15
0x10..0x1f  :   LSL Rx,    #-16 .. #-1
0x20..0x23  :   LSL Rx,    R0 .. R3
0x24..0x27  :   -- Redundant
0x28..0x2b  :   LSL.WT Rx, R0 .. R3
0x2c..0x2f  :   -- Redundant
0x30..0x33  :   LSR Rx,    R0 .. R3
0x34..0x37  :   -- Redundant
0x38..0x3b  :   LSR.WT,Rx
0x3c..0x3f  :   -- Redundant
0x40..0x4f  :   ASL Rx       #0 .. #15
0x50..0x5f  :   ASL Rx      #-16 .. #-1
0x60..0x63  :   ASL Rx     R0 .. R3
0x64..0x67  :   -- Redundant
0x68..0x6b  :   ASL.WT     R0 .. R3
0x6c..0x6f  :   -- Redundant
0x70..0x73  :	ASR Rx     R0 .. R3
0x74..0x77  :   -- Redundant
0x78..0x7b  :   ASR.WT     R0 .. R3
0x7c..0x7f  :   -- Redundant
0x80..0x8f  :   ROL Rx       #0 .. #15
0x90..0x9f  :   ROL Rx      #-16 .. #-1
0xa0..0xa3  :   ROL Rx,    R0 .. R3
0xa4..0xa7  :   -- Redundant
0xa8..0xab  :   ROL.WT Rx, R0 .. R3
0xac..0xaf  :   -- Redundant
0xb0..0xbb  :   ROR Rx,    R0 .. R3
0xb4..0xb7  :   -- Redundant
0xb8..0xbb  :   ROR.WT,Rx
0xbc..0xbf  :   -- Redundant
0xc0..0xcf  :   ROXL Rx       #0 .. #15
0xd0..0xdf  :   ROXL Rx      #-16 .. #-1
0xe0..0xe3  :   ROXL Rx     R0 .. R3
0xe4..0xe7  :   -- Redundant
0xe8..0xeb  :   ROXL.WT     R0 .. R3
0xec..0xef  :   -- Redundant
0xf0..0xf3  :	ROXR Rx     R0 .. R3
0xf4..0xf7  :   -- Redundant
0xf8..0xfb  :   ROXR.WT     R0 .. R3
0xfc..0xff  :   -- Redundant
</table>

Decoding of second byte [b2] for instructions 0xDC..0xDF
<table>
2nd byte    : fixed part : variable part
0x00..0x0f  :   BTST Rx,   #0 .. #15





|







 







|







|

|
|
|

|

|

|

|
|






|

|
|
|

|

|

|







1
2
3
4
5
6
7
8
9
10
11
12
13
..
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Bit operations of the MegaProcessor.

The opcodes 0xD8..0xDF encode the various bit shift-, rotate-, test- and change operations.
Each of these 8 opcodes take a postbyte to encode the exact operation.

The first byte [b1] of a bit-opeation only determines the destination, as shown in the table below.

<table>
0xD8 : R0 for LSL, LSR, ASL, ROL, ROR, ROXL, and ROXR instructions
0xD9 : R1    "       "       "     "      "      "      "
0xDA : R2    "       "       "     "      "      "      "
0xDB : R3    "       "       "     "      "      "      "

................................................................................

To select between the tables for decoding of second byte below
    table = ( (b1 >> 3) & 0x01 )  -- 0 means 0xd8..0xdb, 1 means 0xdc..0xdf

Decoding of second byte [b2] for instructions 0xD8..0xDB
<table>
2nd byte    : fixed part : variable part
0x00..0x0f  :   LSL Rx,    #0 .. #15
0x10..0x1f  :   LSL Rx,    #-16 .. #-1
0x20..0x23  :   LSL Rx,    R0 .. R3
0x24..0x27  :   -- Redundant
0x28..0x2b  :   LSL.WT Rx, R0 .. R3
0x2c..0x2f  :   -- Redundant
0x30..0x33  :   LSR Rx,    R0 .. R3
0x34..0x37  :   -- Redundant
0x38..0x3b  :   LSR.WT Rx, R0 .. R3
0x3c..0x3f  :   -- Redundant
0x40..0x4f  :   ASL Rx,    #0 .. #15
0x50..0x5f  :   ASL Rx,    #-16 .. #-1
0x60..0x63  :   ASL Rx,    R0 .. R3
0x64..0x67  :   -- Redundant
0x68..0x6b  :   ASL.WT,    R0 .. R3
0x6c..0x6f  :   -- Redundant
0x70..0x73  :	ASR Rx,    R0 .. R3
0x74..0x77  :   -- Redundant
0x78..0x7b  :   ASR.WT Rx, R0 .. R3
0x7c..0x7f  :   -- Redundant
0x80..0x8f  :   ROL Rx,    #0 .. #15
0x90..0x9f  :   ROL Rx,    #-16 .. #-1
0xa0..0xa3  :   ROL Rx,    R0 .. R3
0xa4..0xa7  :   -- Redundant
0xa8..0xab  :   ROL.WT Rx, R0 .. R3
0xac..0xaf  :   -- Redundant
0xb0..0xbb  :   ROR Rx,    R0 .. R3
0xb4..0xb7  :   -- Redundant
0xb8..0xbb  :   ROR.WT Rx, R0 .. R3
0xbc..0xbf  :   -- Redundant
0xc0..0xcf  :   ROXL Rx,   #0 .. #15
0xd0..0xdf  :   ROXL Rx,   #-16 .. #-1
0xe0..0xe3  :   ROXL Rx,   R0 .. R3
0xe4..0xe7  :   -- Redundant
0xe8..0xeb  :   ROXL.WT Rx, R0 .. R3
0xec..0xef  :   -- Redundant
0xf0..0xf3  :	ROXR Rx,    R0 .. R3
0xf4..0xf7  :   -- Redundant
0xf8..0xfb  :   ROXR.WT Rx, R0 .. R3
0xfc..0xff  :   -- Redundant
</table>

Decoding of second byte [b2] for instructions 0xDC..0xDF
<table>
2nd byte    : fixed part : variable part
0x00..0x0f  :   BTST Rx,   #0 .. #15