Sponsored Content
Top Forums Programming Ok i have a small assembly question Post 302637171 by shamrock on Tuesday 8th of May 2012 12:20:35 PM
Old 05-08-2012
The $ sign is the end of string marker and tells the DOS print routine when to stop...that is the reason why you hear bells and whistles or see funky characters on your screen as the DOS print routine is trying its best to make sense of the extended ascii character set which it cant handle...to prevent this from happening change the code so that the user supplied input is concatenated with a $ sign...this way the user doesnt have to type it and clears out all the other issues.
This User Gave Thanks to shamrock For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

small question

Hi there, I found the following script on the net, i like to use it as a standard template for new scripts. But i do not understand the meaning of the last line, can anybody explain what going on on the last line vflag=off filename= while getopts vf: opt do case "$opt" in v)... (9 Replies)
Discussion started by: janr
9 Replies

2. Shell Programming and Scripting

small question of echo | grep command

Hi, i've got the following: a=`echo $b | grep '^.*/'` i'm storing in the variable the value of the variable b only if it has a / somewhere. It works, but i don't want to print the value. How do i give the value of b to the grep command without the echo? thanks! (5 Replies)
Discussion started by: kfad
5 Replies

3. Shell Programming and Scripting

small question regarding substr()

Hello.. I am doing some awk-ing and among all I use substr inside it.. I have: ....substr($0,60,37) meaning as U all know take from 37 char. from point 60.. can I put it like this substr($0,60,end of line) meaning take it from point 60 and take all characketrs in that line until line... (2 Replies)
Discussion started by: amon
2 Replies

4. Shell Programming and Scripting

A small minix question

First af all hi. i want to create a batch script which inform when users log in last time on system or if they are online when they logged in. I want ot use a file .users which has the usernames of users. i want to print for example peter is ONLINE: Logged in on Wed Feb 11 07:47 alex... (2 Replies)
Discussion started by: sasa
2 Replies

5. UNIX for Dummies Questions & Answers

Small question regarding SSH

I am looking for some model like this: My Computer ------------- Intermediate Server (IS) ------------- Own Server I must be able to ssh into the Intermediate Internet Server which is generally an online version of SSH service through which I will connect to Own Server. I was the IS to... (2 Replies)
Discussion started by: Legend986
2 Replies

6. Programming

A small question about file descriptor

Can any body tell me when I put close(2), why the code does not show any out put? #include <stdio.h> #include <fcntl.h> #include <errno.h> int main(){ int fd1,fd2,fd3,fd4; close(2); fd1=open("test1.txt",O_WRONLY |O_CREAT | O_TRUNC,0744); fprintf(stderr,"fd1 = %d\n",fd1); ... (5 Replies)
Discussion started by: mlhazan
5 Replies

7. Programming

A small question about fork()

Hello experts, I am using fork() in my code but I am confused which output comes first child or parent? I did the following code .My book shows parent first but my linux shows child first.Can anyone tell me why? #include <stdio.h> int main(){ int pid; printf("I am original process with pid... (5 Replies)
Discussion started by: mlhazan
5 Replies

8. Shell Programming and Scripting

Small fast question

just to confirm du from sh show sizes as multiples of 512 byte right? (4 Replies)
Discussion started by: Nick1097
4 Replies

9. Programming

vga assembly question

Im trying to make a vga program for linux Im wondering if anyone knows of a simple document on the subject or if someone could show me some basics. What system calls should I use what parameters should I give them. How do I draw a line of pixels green after in vga mode. I prefer nasm but I can use... (2 Replies)
Discussion started by: Errigour
2 Replies

10. Homework & Coursework Questions

Sparc Assembly

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I am having a hard time with this assignement i cant get the pfib value to print out the fib sequence. ... (1 Reply)
Discussion started by: kenjiro310
1 Replies
AS(1)							      General Commands Manual							     AS(1)

NAME
as - Mac OS X Mach-O GNU-based assemblers SYNOPSIS
as [ option ... ] [ file ... ] DESCRIPTION
The as command translates assembly code in the named files to object code. If no files are specified, as reads from stdin. All undefined symbols in the assembly are treated as global. The output of the assembly is left in the file a.out by default. The program /usr/bin/as is actually a driver that executes assemblers for specific target architectures. If no target architecture is specified, it defaults to the architecture of the host it is running on. OPTIONS
-o name Name the output file name instead of a.out. -arch arch_type Specifies the target architecture, arch_type, of the assembler to be executed. The target assemblers for each architecture are in /usr/libexec/gcc/darwin/arch_type/as or /usr/local/libexec/gcc/darwin/arch_type/as. There is only one assembler for an architecture family. If the specified target architecture is a machine-specific implementation, the assembler for that architecture family is executed (e.g., /usr/libexec/gcc/darwin/ppc/as for -arch ppc604e). See arch(3) for the currently known arch_types. -arch_multiple Precede any displayed messages with a line stating the program name (as) and the architecture (from the -arch arch_type flag), to distinguish which architecture the error messages refer to. When the cc(1) driver program is run with multiple -arch flags, it invokes as with the -arch_multiple option. -force_cpusubtype_ALL By default, the assembler will produce the CPU subtype ALL for the object file it is assembling if it finds no implementation-spe- cific instructions. Also by default, the assembler will allow implementation-specific instructions and will combine the CPU subtype for those specific implementations. The combining of specific implementations is architecture-dependent; if some combination of instructions is not allowed, an error is generated. With the optional -force_cpusubtype_ALL flag, all instructions are allowed and the object file's CPU subtype will be the ALL subtype. If the target architecture specified is a machine-specific implementation (e.g., -arch ppc603, -arch i486), the assembler will flag as errors instructions that are not supported on that architecture, and it will produce an object file with the CPU subtype for that specific implementation (even if no implementation-specific instructions are used). The -force_cpusubtype_ALL flag is the default for all x86 and x86_64 architectures. -dynamic Enables dynamic linking features. This is the default. -static Causes the assembler to treat as an error any features for dynamic linking. Also causes the .text directive to not include the pure_instructions section attribute. -- Use stdin for the assembly source input. -n Instructs the assembler not to assume that the assembly file starts with a .text directive. Use this option when an output file is not to contain a (__TEXT,__text) section or this section is not to be first one in the output file. -f Fast; no need for the assembler preprocessor (``app''). The assembler preprocessor can also be turned off by starting the assembly file with "#NO_APP ". This is intended for use by compilers which produce assembly code in a strict "clean" format that specifies exactly where whitespace can go. The assembler preprocessor needs to be run on hand-written assembly files and/or files that have been preprocessed by the C preprocessor cpp. This is typically needed when assembler files are assembled through the use of the cc(1) command, which automatically runs the C preprocessor on assembly source files. The assembler preprocessor strips out excess spaces, turns single-quoted characters into a decimal constants, and turns # <number> <filename> <level> into .line <number>;.file <filename> pairs. When the assembler preprocessor has been turned off by a "#NO_APP " at the start of a file, it can be turned back on and off again with pairs of "#APP " and "#NO_APP " at the beginnings of lines. This is used by the compiler to wrap assembly statements produced from asm() statements. -g Produce debugging information for the symbolic debugger gdb(1) so that the assembly source can be debugged symbolically. The debug- ger depends on correct use of the C preprocessor's #include directive or the assembler's .include directive: Any include file that produces instructions in the (__TEXT,__text) section must be included while a .text directive is in effect. In other words, there must be a .text directive before the include, and the .text directive must still be in effect at the end of the include file. Oth- erwise, the debugger will get confused when in that assembly file. -v Display the version of the assembler (both the Mac OS X version and the GNU version it is based on). -V Print the path and the command line of the assembler the assembler driver is using. -Idir Add the directory dir to the list of directories to search for files included with the .include directive. The default place to search is the current directory. -W Suppress warnings. -L Save non-global defined labels beginning with an 'L'; these labels are normally discarded to save space in the resultant symbol ta- ble. The compiler generates such temporary labels. Assembler options for the PowerPC processors -static_branch_prediction_Y_bit Treat a single trailing '+' or '-' after a conditional PowerPC branch instruction as a static branch prediction that sets the Y-bit in the opcode. Pairs of trailing "++" or "--" always set the AT-bits. This is the default for Mac OS X. -static_branch_prediction_AT_bits Treat a single trailing '+' or '-' after a conditional PowerPC branch instruction as a static branch prediction that sets the AT- bits in the opcode. Pairs of trailing "++" or "--" always set the AT-bits but with this option a warning is issued if this syntax is used. With this flag the assembler behaves like the IBM tools. -no_ppc601 Treat any PowerPC 601 instructions as an error. FILES
a.out output file SEE ALSO
The Mac OS X Assembler Reference in the Xcode documentation viewer: Perform a title search for "assembler" in Apple > Developer Tools Ref- erence Library. The assembler source in the cctools module of the Darwin sources. cc(1), ld(1), nm(1), otool(1), arch(3), Mach-O(5) Apple, Inc. April 24, 2007 AS(1)
All times are GMT -4. The time now is 10:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy