Re: Projects With Explanations



(I tried to post a followup several weeks ago, but my article never
appeared, so I'm re-posting from my backup copy:)
> From: Searcher7@xxxxxxxxxxxxx
> I was wondering if anyone is aware of any websites or books that
> cover the stated goals and display the completed code for various
> programs, and also includes in detail the explanations for what each
> and every character and line does.(I'm most interested in Assembly
> and C++).

That's an awful lot of pre-computed and stored verbage for any medium
sized program, bloating it by an order of magnitude. Wouldn't you
prefer something dynamic, where you give the emulator *any* program
source, and you tell it which lines of code you don't understand, and
it generates for you for those particular lines the verbose explanation
but doesn't bother generating all that verbage for the lines you
already understand just fine without its help? For example, you specify
this line of code:
y = x + 1;
and it tells you:
Evaluate x: x is a variable, whose most recent assigned value was 5.
Evaluate 1: 1 is a literal constant, whose value is itself, i.e. 1.
Apply + to values 5 and 1, result is 6.
Assign that value, i.e. 6, to the variable y.
addh r2,(r3)++
Current value in register r3 is 0A793C88, which is used as halfword address.
Location 0A793C88 halfword contains 7FF5, which is data used.
Register r2 contains 00358A22.
Halfword 7FF5 is expanded to full word 00007FF5 and added to 00358A22,
yielding result 00360A17.
00360A17 is stored into register r2.
Register r3 is incremented by halfword i.e. 2, yielding 0A793C8A.
(Sorry, I don't know x86 asm, so I made up a pseudo-PDP-11 example.)
.