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.

oddaddr(pc, a)
function b = oddaddr(pc, a)
%ODDADDR checks whether an address is at an odd offset from the pc
%   B = ODDADDR(PC, A) returns true if address A is at an odd address
%   relative to PC. Assumes addresses do not exceed 256.

%   Copyright 2008 University of Sussex and David Young

b = bitand(256+a-pc, 1);
end

Contact us at files@mathworks.com