MegaProcessor

Check-in [4b1a7e15eb]
Login

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

Overview
Comment:Replaced a couple of print-statements to skeleton return statements. Eventually, each function must return 1, 2, or 3 bytes corresponding to the assembly-language instruction.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:4b1a7e15eb8629ad062963e7239c54b2a5c58428
User & Date: jos 2015-07-17 12:10:20
Context
2015-07-17
21:03
yet another small tool. check-in: 9b1ea624ff user: jos tags: trunk
12:10
Replaced a couple of print-statements to skeleton return statements. Eventually, each function must return 1, 2, or 3 bytes corresponding to the assembly-language instruction. check-in: 4b1a7e15eb user: jos tags: trunk
2015-07-16
23:33
More trial stuff, but it seems to be going in the right direction. check-in: 841b5c7a4b user: jos tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to opcodes.lua.

1
2
3


4
5
6
7


8
9
10
11

12
13
14
15


16
17
18
19
20
21
22
23


24
25
26
27
28
29
30
..
40
41
42
43
44
45
46
47


48
49
50
51


52
53
54
55


56
57
58
59
60
61
62
..
96
97
98
99
100
101
102
103


104
105
106
107


108
109
110
111
112
113
114
...
284
285
286
287
288
289
290
291


292
293
294
295
296
297
298
299
300
301
302

function do_ABS(f1, f2, f3)
  print( f1, f2, f3 );


end

function do_ADD(f1, f2, f3)
  print( f1, f2, f3 );


end

function do_ADDI(f1, f2, f3)
  print( f1, f2, f3 );

end

function do_ADDQ(f1, f2, f3)
  print( f1, f2, f3 );


end

function do_ADDX(f1, f2, f3)
  print( f1, f2, f3 );
end

function do_AND(f1, f2, f3)
  print( f1, f2, f3 );


end

function do_ASL(f1, f2, f3)
  print( f1, f2, f3 );
end

function do_ASL_WT(f1, f2, f3)
................................................................................
end

function do_BCC(f1, f2, f3)
    return 0xe4, 0x00 ;
end

function do_BCHG(f1, f2, f3)
  print( f1, f2, f3 );


end

function do_BCLR(f1, f2, f3)
  print( f1, f2, f3 );


end

function do_BTST(f1, f2, f3)
  print( f1, f2, f3 );


end

function do_BCS(f1, f2, f3)
    return 0xe5, 0x00;
end

function do_BEQ(f1, f2, f3)
................................................................................
end

function do_BPL(f1, f2, f3)
    return 0xea, 0x00  ;
end

function do_BSET(f1, f2, f3)
  print( f1, f2, f3 );


end

function do_BTST(f1, f2, f3)
  print( f1, f2, f3 );


end

function do_BUC(f1, f2, f3)
    return 0xe0, 0x00  ;
end

function do_BUS(f1, f2, f3)
................................................................................
end

function do_SXT(f1, f2, f3)
  print( f1, f2, f3 );
end

function do_TEST(f1, f2, f3)
  print( f1, f2, f3 );


end

function do_TRAP(f1, f2, f3)
  print( f1, f2, f3 );
  return 0xcd  ;
end

function do_XOR(f1, f2, f3)
  print( f1, f2, f3 );
end



|
>
>



|
>
>



|
>



|
>
>



|



|
>
>







 







|
>
>



|
>
>



|
>
>







 







|
>
>



|
>
>







 







|
>
>



<







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
..
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
...
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
...
303
304
305
306
307
308
309
310
311
312
313
314
315

316
317
318
319
320
321
322

function do_ABS(f1, f2, f3)
    local retVal = 0x70;
    -- process f2 to select 0x75, 0x7a or 0x7f
    return retVal ; 
end

function do_ADD(f1, f2, f3)
    local retVal = 0x40;
    -- process f2 to select 0x40..0x4f
    return retVal ; 
end

function do_ADDI(f1, f2, f3)
    -- process f2 to determine value of 2nd returnvalue;
    return 0xf6, 0x00 ;
end

function do_ADDQ(f1, f2, f3)
    local retVal = 0x50;
    -- process f2 to select 0x50..0x5f
    return retVal ; 
end

function do_ADDX(f1, f2, f3)
    return 0xfc;
end

function do_AND(f1, f2, f3)
    local retVal = 0x10;
    -- process f2 to select 0x10..0x1f
    return retVal ; 
end

function do_ASL(f1, f2, f3)
  print( f1, f2, f3 );
end

function do_ASL_WT(f1, f2, f3)
................................................................................
end

function do_BCC(f1, f2, f3)
    return 0xe4, 0x00 ;
end

function do_BCHG(f1, f2, f3)
    local b1 = 0xdc; -- evaluate f3 (R0..R3) to select dc..df
    local b2 = 0x40; -- evaluate f2 to select 40..4f 60..63
    return b1, b2;
end

function do_BCLR(f1, f2, f3)
    local b1 = 0xdc; -- evaluate f3 (R0..R3) to select dc..df
    local b2 = 0x80; -- evaluate f2 to select 80..8f a0..a3
    return b1, b2;
end

function do_BTST(f1, f2, f3)
    local b1 = 0xdc; -- evaluate f3 (R0..R3) to select dc..df
    local b2 = 0x00; -- evaluate f2 to select 00..4f 60..63
    return b1, b2;
end

function do_BCS(f1, f2, f3)
    return 0xe5, 0x00;
end

function do_BEQ(f1, f2, f3)
................................................................................
end

function do_BPL(f1, f2, f3)
    return 0xea, 0x00  ;
end

function do_BSET(f1, f2, f3)
    local b1 = 0xdc; -- evaluate f3 (R0..R3) to select dc..df
    local b2 = 0xc0; -- evaluate f2 to select c0..cf e0..e3
    return b1, b2;
end

function do_BTST(f1, f2, f3)
    local b1 = 0xdc; -- evaluate f3 (R0..R3) to select dc..df
    local b2 = 0x00; -- evaluate f2 to select 00..0f 20..23
    return b1, b2;
end

function do_BUC(f1, f2, f3)
    return 0xe0, 0x00  ;
end

function do_BUS(f1, f2, f3)
................................................................................
end

function do_SXT(f1, f2, f3)
  print( f1, f2, f3 );
end

function do_TEST(f1, f2, f3)
    local retVal = 0x10; -- same as AND
    -- process f2 to select 0x10, 0x15, 0x1a, 0x1f
    return retVal ; 
end

function do_TRAP(f1, f2, f3)

  return 0xcd  ;
end

function do_XOR(f1, f2, f3)
  print( f1, f2, f3 );
end