Question History! |
|
From |
: |
lrasmussen |
|
To |
: |
saintly |
User Comment |
: |
I am programming more for Linux, so that link will be of great help. Thanks so much for handling all of my questions! |
Rating |
: |
 |
Message Status |
: |
Public |
|
[08-05-2000] lrasmussen : I am wondering about assembly programming. I have read a book about it, but am still looking for more. One main question I have is, is there any way to read/write to RAM? If so, how or where can I find more. Thanks a bunch!
|
 |
[08-06-2000] saintly : There are several different platforms, each with their own style of assembler programming. Intel x86 assembler, Macintosh 68k and Mac PowerPC assembler, not to mention mainframe assembler.
On the Intel platform, there are different techniques for accessing memory depending on the chip you are using. Typically (or at least typical for when I was programming Assembler, times may have changed), you use the MOV instruction to copy data between memory locations and registers. You cannot copy data directly between memory locations. The general format for the MOV instruction is
MOV ,
So to copy data from the memory location specified by 'COUNT' into the AX register, it is just
MOV AX, COUNT
To read a character from the keyboard on an x86 machine, you would use BIOS interrupt service 0x16
MOV AH, 0 INT 16H
Would return the scancode of the character read in the AH register, and the ASCII character code in the AL register.
Then you can MOV it somewhere else if you like:
MOV KBCHAR, AL
Accessing memory also works differently if you want to work in protected mode (under Windows) or are working through a memory manager. Depending on the compiler, you may also have libraries and modules available to make accessing RAM and the disk easier. http://www.linux.com/howto/Assembly-HOWTO.html#toc1 Assembler programming with a focus on LINUX
http://www.faqs.org/faqs/by-newsgroup/comp/comp.lang.asm.x86.html All the FAQs from the comp.lang.asm.x86 hierarchy. Be sure to look at /general/part1, part2 and part3.
Please let me know if you need more specific information about an environment and platform.
|
 |
[08-06-2000] saintly : Oh Ick. I used angle-brackets in my definition of the MOV command and they got trashed. Here is the syntax for the MOV command:
MOV < destinateion >,< source >
|
 |
|