MegaProcessor

Check-in [7b9445a7e9]
Login

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

Overview
Comment:Implemented all 8 '.WT' shift/rotate instructions.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:7b9445a7e9c62ab633af452621b38f84370fd2c9
User & Date: jos 2015-09-25 13:00:49
Context
2015-10-06
16:55
Fixed small typo for postbyte range 0xb0..0xb3. check-in: 6bcf6e60d4 user: jos tags: trunk
2015-09-25
13:00
Implemented all 8 '.WT' shift/rotate instructions. check-in: 7b9445a7e9 user: jos tags: trunk
2015-09-24
17:08
Implemented translation of the BCHG,BCLR,BSET,BTST instructions. Todo, have '#' mode accept symbols besides of decimals. check-in: 5479a8adb6 user: jos tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to opcodes.lua.

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
...
285
286
287
288
289
290
291


292
293
294
295
296
297
298
299


300
301
302
303
304
305
306
307
...
381
382
383
384
385
386
387
388

389
390
391
392
393
394
395
396
397


398
399
400
401
402
403
404
405


406
407
408
409
410
411
412
413


414
415
416
417
418
419
420
421
function do_ASL(f1, f2, f3)
    local b1,b2 = 0xdc, 0x40;
    -- process f3 to select 0x40..0x4f, 0x50..0x5f, 0x60..0x63
    return b1, b2 ;
end

function do_ASL_WT(f1, f2, f3)
    local b1,b2 = 0x68, 0x00;

    return b1, b2 ;
end

function do_ASR(f1, f2, f3)
    local b1,b2 = 0x40, 0x00;
    return b1, b2 ;
end

function do_ASR_WT(f1, f2, f3)
    local b1,b2 = 0x40, 0x00;

    return b1, b2 ;
end

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

................................................................................
end

function do_LSL(f1, f2, f3)
    return 0xff, 0xfe ;
end

function do_LSL_WT(f1, f2, f3)


    return 0xff,0xfd ;
end

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

function do_LSR_WT(f1, f2, f3)


    return 0xff,0xfb ;
end

function do_MOVE(f1, f2, f3)
    if( f2:lower() == "sp" ) then
        if( isReg(f3) == 0 ) 
        then return 0xf1;
        else Error("SP only can be written from R0");
................................................................................

function do_ROL(f1, f2, f3)
    local b1,b2 = 0xdc, 0x80;
    return b1, b2 ;
end

function do_ROL_WT(f1, f2, f3)
    local b1,b2 = 0xa8, 0x00;

    return b1, b2 ;
end

function do_ROR(f1, f2, f3)
    local b1,b2 = 0xb0, 0x00;
    return b1, b2 ;
end

function do_ROR_WT(f1, f2, f3)


    return 0xff, 0x00 ;
end

function do_ROXL(f1, f2, f3)
    return 0xff, 0x01 ;
end

function do_ROXL_WT(f1, f2, f3)


    return 0xff, 0x03 ;
end

function do_ROXR(f1, f2, f3)
    return 0xff, 0x04 ;
end

function do_ROXR_WT(f1, f2, f3)


    return 0xff, 0x05 ;
end

function do_SQRT(f1, f2, f3)
    return 0xf7  ;
end

function do_ST_B(f1, f2, f3)







|
>









|
>







 







>
>
|







>
>
|







 







|
>




|




>
>
|







>
>
|







>
>
|







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
...
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
...
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
function do_ASL(f1, f2, f3)
    local b1,b2 = 0xdc, 0x40;
    -- process f3 to select 0x40..0x4f, 0x50..0x5f, 0x60..0x63
    return b1, b2 ;
end

function do_ASL_WT(f1, f2, f3)
    local b1 = 0xd8 + isReg(f2);
    local b2 = 0x68 + isReg(f3);
    return b1, b2 ;
end

function do_ASR(f1, f2, f3)
    local b1,b2 = 0x40, 0x00;
    return b1, b2 ;
end

function do_ASR_WT(f1, f2, f3)
    local b1 = 0xd8 + isReg(f2);
    local b2 = 0x78 + isReg(f3);
    return b1, b2 ;
end

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

................................................................................
end

function do_LSL(f1, f2, f3)
    return 0xff, 0xfe ;
end

function do_LSL_WT(f1, f2, f3)
    local b1 = 0xd8 + isReg(f2);
    local b2 = 0x28 + isReg(f3);
    return b1, b2 ;
end

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

function do_LSR_WT(f1, f2, f3)
    local b1 = 0xd8 + isReg(f2);
    local b2 = 0x38 + isReg(f3);
    return b1, b2 ;
end

function do_MOVE(f1, f2, f3)
    if( f2:lower() == "sp" ) then
        if( isReg(f3) == 0 ) 
        then return 0xf1;
        else Error("SP only can be written from R0");
................................................................................

function do_ROL(f1, f2, f3)
    local b1,b2 = 0xdc, 0x80;
    return b1, b2 ;
end

function do_ROL_WT(f1, f2, f3)
    local b1 = 0xd8 + isReg(f2);
    local b2 = 0xa8 + isReg(f3);
    return b1, b2 ;
end

function do_ROR(f1, f2, f3)
    local b1,b2 = 0xd8, 0x00;
    return b1, b2 ;
end

function do_ROR_WT(f1, f2, f3)
    local b1 = 0xd8 + isReg(f2);
    local b2 = 0xb8 + isReg(f3);
    return b1, b2 ;
end

function do_ROXL(f1, f2, f3)
    return 0xff, 0x01 ;
end

function do_ROXL_WT(f1, f2, f3)
    local b1 = 0xd8 + isReg(f2);
    local b2 = 0xe8 + isReg(f3);
    return b1, b2 ;
end

function do_ROXR(f1, f2, f3)
    return 0xff, 0x04 ;
end

function do_ROXR_WT(f1, f2, f3)
    local b1 = 0xd8 + isReg(f2);
    local b2 = 0xf8 + isReg(f3);
    return b1, b2 ;
end

function do_SQRT(f1, f2, f3)
    return 0xf7  ;
end

function do_ST_B(f1, f2, f3)