Sponsored Content
Top Forums Programming Run assembly program on debian? Post 302980894 by bakunin on Sunday 4th of September 2016 04:10:08 PM
Old 09-04-2016
Quote:
Originally Posted by kaja
What i need to install to run assembly program on debian 64?
I am not quite sure what exactly you mean: A "program" (any language, including assembler) is at first a text document containing the source code. This text document is then translated (Assembler programs by an assembler, other languages by a compiler, both of these are further processed by a linker afterwards), producing an executable. This executable file can then be executed (as the name suggests) without any other means. It is a "standalone" program.

So: for an assembled program to run you need: the executable file produced by the assembler, nothing else.

If you want to start writing programs in Assembler (note: "Assembler" is the language, "assembler" is a translation program translating program source code written in that language) you need:

- an editor that produces plain text files. My editor of choice is vi, but that is a personal choice. Whatever works for you.

- the assembler program. This is usually called as and you might have to install one or more packages in addition to the default installation of Debian.

- a linker. Same as above.

- a make utility. If i remember correctly this is installed per default, but i could be wrong. If not: same as above, install the necessary package(s). You do not need the make utility but you life will be much more comfortable using one. I suggest you start using it from the beginning.

Quote:
Originally Posted by kaja
What i write to excite the code?
Codes are a hopeless cause, they are not easily excited. ;-))

Serious: i suppose you meant "execute", but i am still not sure what you want to know. Was your question answered above?

I hope this helps.

bakunin
 

10 More Discussions You Might Find Interesting

1. Programming

how to run debugging on c program

Can someone help me debug a c program I am running? It gives me segmentation fault. I want to turn on debugging. Can some one give the command to turn it on? Below is the error I get: Segmentation Fault (core dumped) (3 Replies)
Discussion started by: ibeg
3 Replies

2. UNIX for Dummies Questions & Answers

Getting a program to run

Please help, I have tried to run this program countless times and still nothing. Please tell me what I'm doing wrong. $ cat>test count=1 while do echo "5" read number echo $5 let count=count+ 1 done exit 0 ^C$ ksh test $ ^C $ ksh test $ $ nothing happend (6 Replies)
Discussion started by: ctiamaria
6 Replies

3. UNIX for Dummies Questions & Answers

How do i run a program while in Unix?....

Im new and wanted to know if im in the unix terminal and lets say i want to run microsoft word for example. i go in and go into the HD and then keep going and i type ls and see that microsoft word.app is there. how do i run it from that? (4 Replies)
Discussion started by: Corrail
4 Replies

4. Shell Programming and Scripting

how can i run java program from any where

Hello all sorry didnt know where to post it i compiled simple program that using "System.getProperty("user.dir");" now i compiled the program under directory foo and and its running great when i do "java myapp" i included this directory in the $PATH env variable so i could see it fro any where... (1 Reply)
Discussion started by: umen
1 Replies

5. UNIX for Dummies Questions & Answers

cannot run program

Hi, I have a program in /opt/local/bin, my path in my .profile is export PATH=/opt/local/bin:/opt/local/sbin:$PATH however when i type the program name it cannot find it, however i know the program is in /opt/local/bin? Thanks (2 Replies)
Discussion started by: c19h28O2
2 Replies

6. UNIX for Dummies Questions & Answers

Log in, run program

Hey, im editing the passwd file so that when the user ben logs in it runs my assign program. I changed the last column from to Then when i log in i get... There is no problem with the program because it runs fine when i open it normally. Any help much appreciated. (8 Replies)
Discussion started by: RAFC_99
8 Replies

7. UNIX for Dummies Questions & Answers

Help to run this socket program in C

i have created two files named server and client then when i run the server program it says the server is waiting(./server 5555) then when i run the client program it says "client error:connection refused" can u plz help me to run it?:( (7 Replies)
Discussion started by: kedah160
7 Replies

8. Shell Programming and Scripting

Run a program as another user

I have a bash script that launches another problem. I need to run that program under a certain user account. The script itself is run using 'sudo <scriptname>'. #!/bin/bash myprogram=... exec "$myprogram" How would this be done? (1 Reply)
Discussion started by: Carson Dyle
1 Replies

9. Programming

Need assembly code for C program

Dear Buddies, I need assembly code for a compiled c program in unix. Kindly help me.... Thanking you in advance. (1 Reply)
Discussion started by: karthik537
1 Replies

10. Shell Programming and Scripting

Can't get my program to run -- GC calculator?

have been trying for a few weeks not to get this program running. I am newer to programming and it has definitely been a challenge. I think my problem arises with my if statement. I can get it to append the name to the new file, but it simply appends the whole sequence to the file rather than... (3 Replies)
Discussion started by: haley6719
3 Replies
as(1)																	     as(1)

NAME
as - assembler SYNOPSIS
SPARC as [-b] [-i] [ -K {pic,PIC}] [-L] [-m] [-n] [-o outfile] [-P] [-Dname] [-Dname=def] [-Ipath] [-Uname...] [-q] [-Qy | n] [-s] [ -S [a | b | c | l | A | B | C | L] ] [-T] [-V] [-xarch=v7 | -xarch=v8 | -xarch=v8a | -xarch=v8plus | -xarch=v8plusa | -xarch=v8plusb | -xarch=v9 | -xarch=v9a | -xarch=v9b ] [-xF] [-Y dirname] filename... as [-b] [-i] [ -K PIC] [-L] [-m] [-n] [-o outfile] [-P] [-Dname] [-Dname=def] [-Ipath] [-Uname...] [-Qy | n] [-s] [ -S [a | b | c | l | A | B | C | L] ] [-T] [-V] [ -xarch=generic64 | -xarch=amd64] [-Y dirname] [-xmodel= [ SMALL | KERNEL ]] filename... The as command creates object files from assembly language source files. Common Options The following flags are common to both SPARC and . They may be specified in any order: -b Generates extra symbol table information. -i Ignore line number information from preprocessor. -K pic | PIC Generates position-independent code. -L Saves all symbols, including temporary labels that are normally discarded to save space, in the ELF symbol table. -m Runs the m4(1) macro processor on the input to the assembler. -n Suppresses all the warnings while assembling. -o outfile Puts the output of the assembly in outfile. By default, the output file name is formed by removing the .s suffix, if there is one, from the input file name and appending a .o suffix. -P Runs cpp(1), the C preprocessor, on the files being assembled. The preprocessor is run separately on each input file, not on their con- catenation. The preprocessor output is passed to the assembler. -Dname -Dname=def When the -P option is in effect, these options are passed to the cpp(1) preprocessor without interpretation by the as command; other- wise, they are ignored. -Ipath When the -P option is in effect, this option is passed to the cpp(1) preprocessor without interpretation by the as command; otherwise, it is ignored. -Uname When the -P option is in effect, this option is passed to the cpp(1) preprocessor without interpretation by the as command; otherwise, it is ignored. -Qy | n If y is specified, this option produces the "assembler version" information in the comment section of the output object file. If n is specified, the information is suppressed. -s Places all stabs in the .stabs section. By default, stabs are placed in stabs.excl sections, which are stripped out by the static linker, ld(1), during final execution. When the -s option is used, stabs remain in the final executable because .stab sections are not stripped by the static linker. -S[a|b|c|l|A|B|C|L] Produces a disassembly of the emitted code to the standard output. Adding each of the following characters to the -S option produces: a disassembling with address b disassembling with ".bof" c disassembling with comments l disassembling with line numbers Capital letters turn the switch off for the corresponding option. -T This is a migration option for 4.x assembly files to be assembled on 5.x systems. With this option, the symbol names in 4.x assembly files will be interpreted as 5.x symbol names. -V Writes the version number of the assembler being run on the standard error output. -xF Allows function reordering by the Performance Analyzer. If you compile with the -xF option, and then run the Performance Analyzer, you can generate a map file that shows an optimized order for the functions. The subsequent link to build the executable file can be directed to use that map file by using the linker -M mapfile option. It places each function from the executable file into a separate section. -Y dirname Specify directory m4 and/or cm4def. Options for SPARC only -q Performs a quick assembly. When the -q option is used, many error checks are not performed. Note: This option disables many error checks. Use of this option to assemble handwritten assembly language is not recommended. -xarch=v7 This option instructs the assembler to accept instructions defined in the SPARC version 7 (V7) architecture. The resulting object code is in ELF format. -xarch=v8 This option instructs the assembler to accept instructions defined in the SPARC-V8 architecture, less the quad-precision floating-point instructions. The resulting object code is in ELF format. -xarch=v8a This option instructs the assembler to accept instructions defined in the SPARC-V8 architecture, less the quad-precision floating-point instructions and less the fsmuld instruction. The resulting object code is in ELF format. This is the default choice of the -xarch=options. -xarch=v8plus This option instructs the assembler to accept instructions defined in the SPARC-V9 architecture, less the quad-precision floating-point instructions. The resulting object code is in ELF format. It will not execute on a Solaris V8 system (a machine with a V8 processor). It will execute on a Solaris V8+ system. This combination is a SPARC 64-bit processor and a 32-bit OS. -xarch=v8plusa This option instructs the assembler to accept instructions defined in the SPARC-V9 architecture, less the quad-precision floating-point instructions, plus the instructions in the Visual Instruction Set (VIS). The resulting object code is in V8+ ELF format. It will not execute on a Solaris V8 system (a machine with a V8 processor). It will execute on a Solaris V8+ system -xarch=v8plusb This option enables the assembler to accept instructions defined in the SPARC-V9 architecture, plus the instructions in the Visual Instruction Set (VIS), with UltraSPARC-III extensions. The resulting object code is in V8+ ELF32 format. It executes only on an Ultra- SPARC-III processor. -xarch=v9 This option limits the instruction set to the SPARC-V9 architecture. The resulting .o object files are in 64-bit ELF format and can only be linked with other object files in the same format. The resulting executable can only be run on a 64-bit SPARC processor running 64-bit Solaris with the 64-bit kernel. -xarch=v9a This option limits the instruction set to the SPARC-V9 architecture, adding the Visual Instruction Set (VIS) and extensions specific to UltraSPARC processors. The resulting .o object files are in 64-bit ELF format and can only be linked with other object files in the same format. The resulting executable can only be run on a 64-bit SPARC processor running 64-bit Solaris with the 64-bit kernel. -xarch=v9b This option enables the assembler to accept instructions defined in the SPARC-V9 architecture, plus the Visual Instruction Set (VIS), with UltraSPARC-III extensions. The resulting .o object files are in ELF64 format and can only be linked with other V9 object files in the same format. The resulting executable can only be run on a 64-bit UltraSPARC-III pro cessor running a 64-bit Solaris operating environment with the 64-bit kernel. Options for Only --xarch=generic64 Limits the instruction set to AMD64. The resulting object code is in 64-bit ELF format. --xarch=amd64 Limits the instruction set to AMD64. The resulting object code is in 64-bit ELF format. -xmodel=[SMALL | KERNEL] For AMD64 only, generate R_X86_64_32S relocatable type for static data access under KERNEL. Otherwise, generate R_X86_64_32 under SMALL. SMALL is the default. The following operand is supported: filename Assembly language source file TMPDIR The as command normally creates temporary files in the directory /tmp. Another directory may be specified by setting the environment variable TMPDIR to the chosen directory. (If TMPDIR is not a valid directory, then as will use /tmp). By default, as creates its temporary files in /tmp. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWsprot | +-----------------------------+-----------------------------+ cc(1B), cpp(1),ld(1), m4(1), nm(1), strip(1), tmpnam(3C), a.out(4), attributes(5) dbx and analyzer manual pages available with Sun Studio documentation. If the -m option, which invokes the m4(1) macro processor, is used, keywords for m4 cannot be used as symbols (variables, functions, labels) in the input file, since m4 cannot determine which keywords are assembler symbols and which keywords are real m4 macros. Whenever possible, access the assembler through a compilation system interface program such as cc(1B). All undefined symbols are treated as global. 16 Sep 2005 as(1)
All times are GMT -4. The time now is 01:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy