www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/06/07/12:21:19

Xref: news-dnh.mv.net comp.os.msdos.djgpp:206
Path: news-dnh.mv.net!mv!news.sprintlink.net!pipex!sunic!sunic.sunet.se!trane.uninett.no!news.uit.no!engstad.ingok.hitos.no!pke
From: pke AT engstad DOT ingok DOT hitos DOT no (Paal-Kr. Engstad)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Gnu Assembler Question
Date: 5 Jun 1995 15:51:54 GMT
Organization: University of Tromsoe, Norway
Lines: 30
Distribution: world
References: <3qm83p$7fg AT newshound DOT uidaho DOT edu>
Nntp-Posting-Host: engstad.ingok.hitos.no
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

In article <3qm83p$7fg AT newshound DOT uidaho DOT edu>, teney931 AT cs DOT uidaho DOT edu (Aric TenEyck) writes:
|>    A couple of them, actually:
|> 
|> 1)  How do I do an SHL EAX, 16 in GAS?  SHL %EAX, 16 give an undefined 
|> opcode error, as does SHL 16, %EAX.  I can do it by 16 SHL %EAX's, but 
|> the chip can do multi-bit shifts at once, so that is wasteful.

Answer:
	shll $16, %eax

Remember: 
	1. All lower case.
	2. Append 'l' for long (extended reg like eax), 
	   'w' for word (like ax), or 'b' for byte (like al or ah).
	3. Always opposite the operands (shift 16 times the eax reg).
	4. For immediates (numbers), prepend a $. For instance $0xA0000.  

|> 2)  I don't suppose that there is a converter for Intel format to GAS 
|> format, is there?

No, not that I know of. However, when you are accustomed to AT&T
format, you'll be surprised that you ever used the Intel format. It is
in _my_ opinion far superior.

|> --
|> You know whose |"There are few child care |    "The meek shall 
|> opinions these | problems that can not be | inherit the Earth. 
|> are and whose  | solved with duct tape."  | The rest of us are
|> they aren't.   |             -Father Duke | going to the stars."
|> 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019