Can somebody tell me what the difference between immediate and direct functions? I don't really understand what the difference would be in this porgram for example:
ljmp 200h
mov R1,#20h
If I understand it correctly, this will let the cpu move 20 hexadecimal to register R1.
But if I use direct it would be like this:
ljmp 200
mov 1,20h
Now what's the difference?
Assembler help
Moderator:Moderators
- marshallh
- Moderator
- Posts:2986
- Joined:Sat Sep 10, 2005 2:17 pm
- 360 GamerTag:marshallh
- Location:here and there
- Contact:
"Microprocessors provide a number of ways to specify the location of data to be used in calculations.
For example, one of the data values to be used in an add instruction may be encoded as part of that instruction's opcode, the raw machine language produced by the assembler as it parses your assembly language program. This is known as immediate addressing.
Alternatively, perhaps the opcode will instead contain a memory address which holds the data (direct addressing). More commonly, the instruction will specify that an auxiliary register holds the memory address which in turn holds the data (indirect addressing). The processor knows which addressing mode is being used by examining special bit fields in the instruction opcode." - some website
For example, one of the data values to be used in an add instruction may be encoded as part of that instruction's opcode, the raw machine language produced by the assembler as it parses your assembly language program. This is known as immediate addressing.
Alternatively, perhaps the opcode will instead contain a memory address which holds the data (direct addressing). More commonly, the instruction will specify that an auxiliary register holds the memory address which in turn holds the data (indirect addressing). The processor knows which addressing mode is being used by examining special bit fields in the instruction opcode." - some website