MegaProcessor

Check-in [956565c236]
Login

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

Overview
Comment:Bug-fix: have the test in isReg actually call the error() function.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 956565c236f35e0453544e739daa02c14b06b465
User & Date: jos 2015-08-03 21:48:06.503
Context
2015-08-03
21:58
Moved executables to new subdirectory 'bin'. check-in: 4c181d3d35 user: jos tags: trunk
21:48
Bug-fix: have the test in isReg actually call the error() function. check-in: 956565c236 user: jos tags: trunk
21:00
Refactored some things, using functions in new module lib.lua check-in: 5ce49e15aa user: jos tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to eval_op.lua.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--
-- require('thisfile');
--

-- Match operand to be r0..r3 (or R0..R3), and return the number;
function isReg(op)
    local nr = op:match( '%s*[rR]([0-3])' );
    if( nr >= '0' and nr <= '3' ) then
        return tonumber(nr) ;
    else
        error("Operand must be R0..R3", 0 )
    end
end

-- Match 2 operands to be r0..r3 (or R0..R3), and return

|





|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--
-- Usage: require('thisfile');
--

-- Match operand to be r0..r3 (or R0..R3), and return the number;
function isReg(op)
    local nr = op:match( '%s*[rR]([0-3])' );
    if( nr ) then
        return tonumber(nr) ;
    else
        error("Operand must be R0..R3", 0 )
    end
end

-- Match 2 operands to be r0..r3 (or R0..R3), and return