delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/18/12:55:39

From: Mike purtell <mtp4 AT pge DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: error: operator size not specified
Date: Wed, 17 Feb 1999 09:02:45 -0800
Organization: Pacific Gas And Electric Company
Lines: 58
Message-ID: <36CAF635.4E2454D6@pge.com>
NNTP-Posting-Host: mtp4ws01.comp.pge.com
Mime-Version: 1.0
X-Mailer: Mozilla 4.5 [en] (Win98; I)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

This could probably be cleared up a lot easier if I had Mathew
Mastracci's email ID ( This is from his "how to nasm with DJGPP"
tutorial section 4.3 [and this sucker won't compile]) but since I
don't...

The following function bails at the line

 mov [VideoRAM], 0ffffh

with the error message  "operator size not specified" emenating from the
nasm compiler.
Since this is (n)asm but calls dj lib-function
__dpmi_segment_to_descriptor I didn't know whether to post here or a
comp.lang.asm.x86 or elsewhere...

Here's the function
;
---------------------------------------------------------------------------

; Prototype: int InitGraphics(void);
; Returns: -1 on error, else zero
;
---------------------------------------------------------------------------

_InitGraphics__Fv:
 push ebp
 mov ebp, esp

 push dword 0a000h                     ; Push segment for function
 call ___dpmi_segment_to_descriptor    ; Note the triple underscore
 cmp eax, -1                           ; Check for error
 jne .SelectorOkay                     ; No error, selector is valid

 mov [VideoRAM], 0ffffh                ; Error, make selector invalid /*
CHOKE !! */
 jmp .Done                             ; End function, will return -1

.SelectorOkay:
 mov [VideoRAM], ax                    ; Load selector from ax
 xor eax, eax                          ; Clear eax to return zero

.Done:
 mov esp, ebp
 pop ebp
 ret
;--------------------------------------------
You got it, I'm REAL new to this asm stuff...
I did define the VideoRAM symbol as
VideoRAM    dw 0000hand declared the function
[GLOBAL _InitGraphics__Fv]
in the header

If it would help to post the whole asm module and .cc please say so.

is there any dj help ot there ?
Mike Purtell
mtp4 AT pge DOT com

- Raw text -


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