www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/06/17:33:20

From: Jens Vaasjo <jvaasjo AT gpu DOT srv DOT ualberta DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: NASM
Date: Mon, 06 Jan 1997 13:23:06 -0700
Organization: University of Alberta, Edmonton, Canada
Lines: 43
Message-ID: <32D15F2A.7DF2@gpu.srv.ualberta.ca>
References: <199701060350 DOT EAA06726 AT math DOT amu DOT edu DOT pl>
NNTP-Posting-Host: async3-3.remote.ualberta.ca
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Once upon a time (on  4 Jan 97 at 20:42) Nikita Proskourine said:
>
> Thanks, I already got NASM from one of SimTel mirrors. It seems like
> a really good way to use old .asm code with djgpp, but I got a
> problem: it doesn't seem to recognize "mov byte ptr". What am I
> doing wrong? Oh, another thing, how do I define stack size in my asm


MOV BYTE PTR [whatever],0x05   won't work

for some reason they changed it to  

MOV BYTE [whatever],0x05

Same with PUSH 0xFFFF  you need PUSH WORD 0xFFFF.
 
I guess they thought that the could reduce typing by cutting
out the unnessecery PTR keyword. 

so for BYTE PTR, WORD PTR, DWORD PTR just charge it to
BYTE, WORD, DWORD. Its all in the documentation.

Look though the docs that come with it, NASM uses some slight 
differences from what you may expect from most intel assembliers.

By the way you probably won't have to touch things like A16,A32,O16,O32
as well as things like MOV AX,[WORD ES:DI] as the previous repley
states,
these things are mainly needed for mixing 16bit and 32bit code.

Having WORD *in* the brackets causes it to use the pointer as a 16bit 
pointer instead of using the variable it points to as a 16bit sized 
variable. 

And 'A32 MOVSW' will make it use EDI and ESI while 'A16 MOVSW'
will make it use DI and SI however using [BITS 16] or [BITS 32] once
sets 
up a default so if you set [BITS 16] a plain 'MOVSW' will automatically
use
SI and DI.


Jens.

- Raw text -


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