Professional Documents
Culture Documents
Computer Architectutre Manual 6 2019-Cpe-27 Muhammad Usama Saghar
Computer Architectutre Manual 6 2019-Cpe-27 Muhammad Usama Saghar
Manual Details
Submission Details
Direct Addressing:
Direct addressing. is So-named because the value to be stored in memory is obtained by
directly
retrieving it from another memory location. For example:
mov A,30h (mov ax, num)
This instruction will read the data out of Internal RAM address 30 (hexadecimal) and store it in
the
Accumulator.
Direct addressing is generally fast since, although the value to be loaded is not included in the
instruction, it is quickly accessible since It is; stored in the Internal RAM. It is also much more
flexible than Immediate Addressing the value to be loaded is whatever is found at the given
address - which
may be variable.
Now we write the program such that the numbers 5, 10, and 15 are stored as memory variables
instead
of constants and we access them from there.
009 ret
012 num3 dw 15
013 num4 dw 0
In above program, source Is changed from constant 5 to num1. It is signaling that the
operand Is placed in memory address num1. The value 5 will be loaded In ax even though we
did not
specified It in our code, rather the value will be picked from memory. The instruction should be
read as "read the 21 location num1 in the ax label num1 is a symbol for
us but an address for the processor while the conversion is done by the assembler. The label
num1 is
defined as a word the assembler, requested to place 5 In that memory location.
Exercise.
Write the above program code for addition of numbers using memory variables in emu8086
and give the information about "Com Symbol" & "Com list" files for each Instruction.