Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

More Assembley



Assembly language by its very nature is system specific. In addition, 
each assembler has different directives. Directives are instructions to the 
assmbler to do various things. In many assembler, directives begin with a 
leading dot, such as .DATA, which tells MASM that what follows goes 
into the data section. The MASM assembler was designed specifically 
for MS-DOS, hence the .model directive. Under DOS you had various 
"models" based upon the pointer size. Also, on DOS, there were several 
assemblers that were different. Microsoft's MASM had different directives 
than did Borland's. Since Intel Linux must at least be on a 386, things 
are going to be different. I can't give you any more help since I have not 
done Intel assembler work for about 7 years. You really need to get the 
online docs for NASM.

On 1 Feb 00, at 9:13, Anthony J. Gabrielson wrote:

> Hello,
> 	Okay, I'm begining to really dislike assembly.  How would I do
> this program under nasm?
> 
> Thanks,
> Anthony
> 
> On Mon, 31 Jan 2000, Jerry Feldman wrote:
> 
> > That looks like Microsoft DOS (MASM).
> > "Anthony J. Gabrielson" wrote:
> > > hello,	
> > > 	I have copied a nice small program out of my assembly book that
> > > won't compile.  I was wondering if somebody might know why?
> > > 
> > > .MODEL SMALL
> > > .STACK 100H
> > > .DATA
> > > name_msg        DB 'Please enter your name:  ',0
> > > query_msg       DB 'How many times to repeat welcome msg?  ',0
> > > confirm_msg1    DB 'Repeat welcome msg ',0
> > > confirm_msg2    DB ' time (y/n) ',0
> > > welcome_msg     DB 'Welcome to Assembly Language Programming ',0
> > > 
> > > user_name       DB 16 DUP (?) ;Buffer for user name
> > > response        DB ?
> > > 
> > > .CODE
> > > INCLUDE io.mac
> > > 
> > > main PROC
> > >         .STARTUP
> > >         PutStr  name_msg
> > >         nwln
> > >         GetStr  user_name,16
> > >         nwln
> > > ask_count:
> > >         PutStr  query_msg                                                    
> > >   
> > >         GetInt  CX
> > >         nwln
> > >         PutStr  confirm_msg1
> > >         PutInt  CX
> > >         PutStr  confirm_msg2
> > >         GetCh   response
> > >         nwln
> > >         cmp     response,'y'
> > >         nwln
> > >         jne     ask_count
> > > display_msg:
> > >         PutStr  welcome_msg
> > >         PutStr  user_name
> > >         nwln
> > >         loop    display_msg
> > >         .EXIT
> > > main    ENDP
> > >         END     main 
> > > 
> > > I get these errors:
> > > test.asm:1: parser: instruction expected
> > > test.asm:1: attempt to define a local label before any non-local labels
> > > test.asm:2: parser: instruction expected
> > > test.asm:2: attempt to define a local label before any non-local labels
> > > test.asm:3: attempt to define a local label before any non-local labels
> > > test.asm:10: comma expected after operand 1
> > > test.asm:14: parser: instruction expected
> > > test.asm:16: parser: instruction expected
> > > test.asm:18: parser: instruction expected
> > > test.asm:20: parser: instruction expected
> > > test.asm:21: symbol `nwln' redefined
> > > test.asm:23: parser: instruction expected
> > > test.asm:23: symbol `PutStr' redefined
> > > test.asm:24: parser: instruction expected
> > > test.asm:25: symbol `nwln' redefined
> > > test.asm:26: parser: instruction expected
> > > test.asm:26: symbol `PutStr' redefined
> > > test.asm:27: parser: instruction expected
> > > test.asm:28: parser: instruction expected
> > > test.asm:28: symbol `PutStr' redefined
> > > test.asm:29: parser: instruction expected
> > > test.asm:30: symbol `nwln' redefined
> > > test.asm:32: symbol `nwln' redefined        
> > > test.asm:35: parser: instruction expected
> > > test.asm:35: symbol `PutStr' redefined
> > > test.asm:36: parser: instruction expected
> > > test.asm:36: symbol `PutStr' redefined
> > > test.asm:37: symbol `nwln' redefined
> > > test.asm:40: parser: instruction expected
> > > test.asm:40: symbol `main' redefined
> > > test.asm:41: parser: instruction expected
> > > 
> > > I used the command nasm test.asm
> > > 
> > > Anyway I am greatly confused - I thought I understood 'At Least a little
> > > bit'
> > > 
> > > Thanks for the help,
> > > Anthony
> > > 
> > > -
> > > Subcription/unsubscription/info requests: send e-mail with
> > > "subscribe", "unsubscribe", or "info" on the first line of the
> > > message body to discuss-request at blu.org (Subject line is ignored).
> > > 
> > 
> > -- 
> > --
> > Gerald Feldman <gaf at mediaone.net>
> > Boston Computer Solutions and Consulting
> > ICQ#156300
> > 
> > 
> > 
> > 
> 
> -
> Subcription/unsubscription/info requests: send e-mail with
> "subscribe", "unsubscribe", or "info" on the first line of the
> message body to discuss-request at blu.org (Subject line is ignored).


--
Jerry Feldman
Contractor, eInfrastructure Partner Engineering   
508-467-4315 http://www.testdrive.compaq.com/linux/

Compaq Computer Corp.
200 Forest Street MRO1-3/F1
Marlboro, Ma. 01752
-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org