Code covered by the BSD License  

Highlights from
Extended Brookshear Machine emulator and assembler

image thumbnail
from Extended Brookshear Machine emulator and assembler by David Young
Emulator and assembler for a simple computer, a teaching aid for computer science courses.

instr2string(type, b1, b2)
function str = instr2string(type, b1, b2)
%INSTR2STRING returns string representation of instruction
%   STR = INSTR2STRING(TYPE, B1, B2) returns a string representation of the
%   instruction made of bytes B1, B2. If TYPE is 'assembler' the text is
%   valid assembly language for the instruction; otherwise an informal
%   description is given.

%   Copyright 2008 University of Sussex and David Young

if isequal(type, 'assembler')
    str = instr2string_ass(b1, b2);
else
    str = instr2string_desc(b1, b2);
end
end

Contact us at files@mathworks.com