home | articles | links | fun | about
Up to: Quick math and science observations

notes:

we are running in real mode - true addresses (not virtual)

what is a memory segment? ok... 64K group of memory

addressing 0x12340 + 0x0017 = 0x12357 or 1234:0017

12340

0017

12357

1234:acts as last "digit"

fitting more information into the last digit, so spills over.

100:003

1003

but 100:049 = 1049. get it? spills over to the next digits.

addr:offset

addr + offset

far pointer: includes segment offset (so can point to memory outside current reach)

for LEA (load effective address)... does a single register contain the base, displacement and offset? and LEA does the calculation?

Top of stack at offset SP in stack segment. RECALL that stack grows DOWNWARD

STRINGS:

current element at DS:SI, destination at ES:DI. Incremented automatically (if direction flag is clear. if direction flag set, then decremented).

REP instruction -- repeat number of times in count register

ES and DS are at 16 byte increments... actually address is DS * 16 + SI segment and offset

CLD - clears something? makes sure direction is increasing

JUMPING

certain restrictions on how far you can jump. if want to jump unlimited amount in a test, check for failed condition (and jump ahead). otherwise, execute next instruction, which is to jump really far.
        JNLE NoJLE
        JMP  target

NoJLE:

This will test JNLE... if false, then exits. If true, then executes JMP target, and jumps ahead (any amount).