The ProgrammersTalk Community
Forum Register Search Today's Posts Mark Forums Read
Register

Go Back   The ProgrammersTalk Community > General Programming > Assembly


Welcome to the The ProgrammersTalk Community forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Tags:

Closed Thread
 
LinkBack Thread Tools    Display Modes   
  #1 (permalink)  
Old 06-10-2007, 05:57 PM
nilofar
Posts: n/a
[SOLVED] How i can write this program with assembly language?program: we have a...

...matrix(2*2). its element are(1,2,3,4)? We have a matrix(2*2).Its elements are (1,2,3,4).Its name is A.
Increase elements with inc and put them in matrix B.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
  #2 (permalink)  
Old 06-10-2007, 05:58 PM
kippie2525
Posts: n/a
What assembly language are you supposed to use? MIPS ? or what? You need to be more specific about the assembly language. There are a lot of different flavors.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
  #3 (permalink)  
Old 07-07-2007, 07:02 PM
rpgfan3233 rpgfan3233 is offline
PT Staff
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 4
Join Date: Jul 2007
Posts: 118
iTrader: (0)
rpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura about
Not only are the architectures different, but there are various assemblers using somewhat different syntaxes. Also note that there are various compilers using various libraries on different operating systems which may have slightly different names (e.g. on Linux, the function printf is just printf. on Windows however, it is _printf).

For example, here is a program using the GNU assembler (gas) for the Intel 386 (i386) processor or higher (Linux only since exiting a program in Windows is different):
Code:
    .section    .data
hello:
    .string     "Hello world!\n"
    .equ    hello_len, . - hello

    .text
    .globl  _start
_start:
    movl    $4, %eax            # 4 is the write() system call
    movl    $1, %ebx            # stdout is the file descriptor
    leal    hello, %ecx         # the address represented by "hello" is loaded into ecx
    movl    $hello_len, %edx    # length of the data to write
    int     $0x80               # the interrupt to use in Linux to execute the write() system call

    xorl    %eax, %eax          # eax = 0
    incl    %eax                # eax = eax+1 = 1 (1 is the exit() call)
    xorl    %ebx, %ebx          # ebx = 0 (the return code of the program)
    int     $0x80               # again, call interrupt 80h (0x80) to execute the exit() system call
It's been a while since I've written any Linux ASM, but that program should not need much changing to make it work, if any at all.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Closed Thread


Thread Tools
Display Modes

   Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 06:09 AM. Powered by vBulletin
Copyright © 2000 - 2007, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO © 2007 ProgrammersTalk Sedo - Buy and Sell Domain Names and Websites project info: programmerstalk.net Statistics for project programmerstalk.net etracker® web controlling instead of log file analysis


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50