Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


[Tutorial Request] Assembly Programming filter_list
Author
Message
RE: [Tutorial Request] Assembly Programming #11
Frooxius can you explain different types of MOV modes?
[Image: fow57.jpg]

Reply

RE: [Tutorial Request] Assembly Programming #12
Can you clarify your question? Especially what do you mean by "move"

MOV instruction basically moves data... well copies, from one location to another. Various types and variations of MOV instructions determine how, where from and where to are the data moved.

For example, you can move data from one register (a small storage used by the CPU) to another, or from a register to a memory location or even some IO port, in which case the MOV instruction can also generate additional signals that indicate that a new value was outputted on given IO port.

You most commonly encounter to ways of selecting a memory cell when moving data from/to memory. There's direct addressing and indirect addressing.

Direct addressing simply specifies the address right away, so let's say, you want to move some value from/to memory cell with address 234. It directly determines which cell to use.

Indirect addressing is quite powerful though, it basically uses some other memory location (or usually a register) to determine the address. Let's say you store the address in register called R0 (you can substitute anything you want, it's after all, just a name). So the MOV instruction will first look into t he register R0, read the value stored there and use that as an address of the memory cell it will store/load data to/from.

This is particularly useful in loops where you can increment R0 and process a whole memory region or even calculate the address based on some other values.

Some processors also have multiple memories, for example separated program and data memory and also external data memory, so they can have three versions of MOV instructions for each type of memory.

I recommend looking this up in the documentation of specific processor, because essentially it's all just moving data around and documentation tells you what combination of locations you can use or any side effects.

For example the processor might not supporting moving data from one memory location to another with a single MOV, so you have to first move it from a memory location to a register and then from this register to the target memory location.

Also there might be special MOV instructions, for example x86 has MOV instructions that copy data from register AX to EAX, which is basically extension of a 16-bit value to a 32-bit value and the type of the instruction determines how is this expansion done.

Best way to learn more is to just look at the instruction list and look what individual instructions do, you don't really need to remember them much, just have a hunch that they exist and if you happen to need them, you can always look them up in the instruction list and with enough experience with given platform, you actually end up remembering them all.

Don't fixate on specific instructions though, rather build a generic knowledge and understanding of how it works, so you can adapt yourself to different architectures with ease (unless it's one of my experimental ones Tongue ).
I love creativity and creating, I love science and rational thought, I am an open atheist and avid self-learner.

Reply

RE: [Tutorial Request] Assembly Programming #13
i wanted to know about Direct and InDirect addressing mode..well i got what i wanted..

i was thinking that if you can make a group of Assemblers like the one Revolution..
[Image: fow57.jpg]

Reply

RE: [Tutorial Request] Assembly Programming #14
Just a personal addition, I don't like calling it mode much, as mode indicates that it's some global setting that affects the way CPU performs tasks. For example, you would use an instruction to set the CPU to direct addressing mode and then all instructions would address directly, then you would switch it to indirect and the same instructions would use indirect addressing, so it might be a bit misleading.

I would rather say that it's a method/form of addressing that specific instruction variation uses.
I love creativity and creating, I love science and rational thought, I am an open atheist and avid self-learner.

Reply

RE: [Tutorial Request] Assembly Programming #15
what about the group?? i talked about in my previous post
[Image: fow57.jpg]

Reply

RE: [Tutorial Request] Assembly Programming #16
I don't know, I'm not interested in it really at this moment. I don't know what would be its purpose.
I love creativity and creating, I love science and rational thought, I am an open atheist and avid self-learner.

Reply

RE: [Tutorial Request] Assembly Programming #17
(09-19-2012, 03:35 PM)Frooxius Wrote: I don't know, I'm not interested in it really at this moment. I don't know what would be its purpose.

purpose of group can be...creating tutorials for asm and making programs for members purely in asm....
....................................................

ok now able to code input,reading files and some basic programs... what should I do now?
[Image: fow57.jpg]

Reply

RE: [Tutorial Request] Assembly Programming #18
I can do all of that without a group.

Also I don't see much point in writing things purely in ASM, at least not regular programs. That's generally a waste of time (unless you're coding for some MCU or other platform with minimal resources where you optimize on instruction) as you could use combination of assembly and high level language if needed.
I love creativity and creating, I love science and rational thought, I am an open atheist and avid self-learner.

Reply

RE: [Tutorial Request] Assembly Programming #19
what is the difference between MOV AX,SI and MOV AX,[SI]
[Image: fow57.jpg]

Reply

RE: [Tutorial Request] Assembly Programming #20
That's direct vs indirect addressing.

MOV AX, SI moves contents of SI to register AX
MOV AX, [SI] moves contents of memory address stored in SI to register AX

Generally [reg] means indirect addressing, so whenever it's wrapped in [reg], it means "content of address stored in reg", while by writing register name itself means "contents of register reg".

Depending on the architecture and mode used, you can use only some registers for indirect addressing, also the notation can differ (some Intel MCU's use @ for example to denote indirect addressing) and in some cases you have to also specify the size of contents if it's not clear from the instruction itself.
I love creativity and creating, I love science and rational thought, I am an open atheist and avid self-learner.

Reply







Users browsing this thread: 2 Guest(s)