MegaProcessor

Check-in [1a38e93721]
Login

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

Overview
Comment:Make the stack+offset instructions accept '+' as well as ','
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:1a38e937218408550b1a7ce40f9a0b63a268eec4
User & Date: jos 2015-10-22 12:28:32
Context
2015-10-22
16:56
Added warning when Immediate-format operand for LD.B instruction evaluates to word-size with MSB != 0. check-in: 8b4d99ed90 user: jos tags: trunk
12:28
Make the stack+offset instructions accept '+' as well as ',' check-in: 1a38e93721 user: jos tags: trunk
09:17
Completed instructions LD.B LD.W ST.B and ST.W check-in: 260a245f88 user: jos tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to opcodes.lua.

241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
...
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
...
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
...
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
            return 0xd4 + ourNr, table.unpack(dst) ;
        else 
            local dst = Eval_as_word(f3);
            return 0xb4 + ourNr, table.unpack(dst) ;
        end;
    else
        if( stack ) then 
            local dst = f3:match(',(%S+)%)');
            local b2 = table.unpack( Eval_as_byte(dst) );
            return 0xa4 + ourNr, b2; 
        end--if(stack);
        local ourNr2 = tonumber( f3:match("[23]") );
        if( ourNr2 == nil ) then
            Error(": Operand must be R2 or R3", 0 );
        end
................................................................................
            return 0xd0 + ourNr, table.unpack(dst) ;
        else
            local dst = Eval_as_word(f3);
            return 0xb0 + ourNr, table.unpack(dst) ;
        end;
    else
        if( stack ) then 
            local dst = f3:match(',(%S+)%)');
            local b2 = table.unpack( Eval_as_byte(dst) );
            return 0xa0 + ourNr, b2; 
        end--stack;
        local ourNr2 = tonumber( f3:match("[23]") );
        if( ourNr2 == nil ) then
            Error("Operand must be R2 or R3");
        end
................................................................................
    local ourNr = isReg(f3);

    if( not ind_dst ) then
        local dst = Eval_as_word(f2);
        return 0xbc + ourNr, table.unpack(dst) ;  -- ST.B 0xWWWW,Rx ;
    else
        if( stack ) then 
            local dst = f2:match(',(%S+)%)');
            local b2 = table.unpack( Eval_as_byte(dst) );
            return 0xac + ourNr, b2; 
        end;  -- ST.B (SP,0xVV),Rx ;

        local ourNr2 = tonumber( f2:match("[23]") );
        if( ourNr2 == nil ) then
            Error("Operand must be R2 or R3");
................................................................................

    local ourNr = isReg(f3);

    if( not ind_dst ) then
        return 0xb8 + ourNr, table.unpack( Eval_as_word(f2) );
    else
        if( stack ) then 
            local dst = f2:match(',(%S+)%)');
            local b2 = table.unpack( Eval_as_byte(dst) );
            return 0xa8 + ourNr, b2; 
        end;  -- ST.B (SP,0xVV),Rx ;
        local ourNr2 = tonumber( f2:match("[23]") );
        if( ourNr2 == nil ) then
            Error("Operand must be R2 or R3");
        end







|







 







|







 







|







 







|







241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
...
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
...
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
...
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
            return 0xd4 + ourNr, table.unpack(dst) ;
        else 
            local dst = Eval_as_word(f3);
            return 0xb4 + ourNr, table.unpack(dst) ;
        end;
    else
        if( stack ) then 
            local dst = f3:match('[%+,](%S+)%)');
            local b2 = table.unpack( Eval_as_byte(dst) );
            return 0xa4 + ourNr, b2; 
        end--if(stack);
        local ourNr2 = tonumber( f3:match("[23]") );
        if( ourNr2 == nil ) then
            Error(": Operand must be R2 or R3", 0 );
        end
................................................................................
            return 0xd0 + ourNr, table.unpack(dst) ;
        else
            local dst = Eval_as_word(f3);
            return 0xb0 + ourNr, table.unpack(dst) ;
        end;
    else
        if( stack ) then 
            local dst = f3:match('[%+,](%S+)%)');
            local b2 = table.unpack( Eval_as_byte(dst) );
            return 0xa0 + ourNr, b2; 
        end--stack;
        local ourNr2 = tonumber( f3:match("[23]") );
        if( ourNr2 == nil ) then
            Error("Operand must be R2 or R3");
        end
................................................................................
    local ourNr = isReg(f3);

    if( not ind_dst ) then
        local dst = Eval_as_word(f2);
        return 0xbc + ourNr, table.unpack(dst) ;  -- ST.B 0xWWWW,Rx ;
    else
        if( stack ) then 
            local dst = f2:match('[%+,](%S+)%)');
            local b2 = table.unpack( Eval_as_byte(dst) );
            return 0xac + ourNr, b2; 
        end;  -- ST.B (SP,0xVV),Rx ;

        local ourNr2 = tonumber( f2:match("[23]") );
        if( ourNr2 == nil ) then
            Error("Operand must be R2 or R3");
................................................................................

    local ourNr = isReg(f3);

    if( not ind_dst ) then
        return 0xb8 + ourNr, table.unpack( Eval_as_word(f2) );
    else
        if( stack ) then 
            local dst = f2:match('[%+,](%S+)%)');
            local b2 = table.unpack( Eval_as_byte(dst) );
            return 0xa8 + ourNr, b2; 
        end;  -- ST.B (SP,0xVV),Rx ;
        local ourNr2 = tonumber( f2:match("[23]") );
        if( ourNr2 == nil ) then
            Error("Operand must be R2 or R3");
        end