www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/06/14/14:08:52

Xref: news-dnh.mv.net comp.os.msdos.djgpp:359
Path: news-dnh.mv.net!mv!news.sprintlink.net!howland.reston.ans.net!news.moneng.mei.com!rio.moneng.mei.com!rick
From: rick AT rio DOT moneng DOT mei DOT com (Rick Bronson)
Newsgroups: comp.os.msdos.djgpp
Subject: How to convert MASM to go32?
Date: 14 Jun 1995 15:46:49 GMT
Organization: Marquette Electronics, Inc.
Lines: 91
Distribution: world
Nntp-Posting-Host: rio.moneng.mei.com
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

Hello,

  I wondered if someone could give me some help converting some MASM
code to djgpp.  Here is a very short routine that I think I've
converted, could someone tell me if I'm on the right track?  Here is
the original code changed only to ATT format:

-----------------------------------------------------------------------------
  _init_shade:	#proc	far
	pushw	%bp
	movw	%sp,%bp
	push	%ds              #save c required registers
	push	%es
	pushw	%di
	pushw	%si
	movw	dgroup,%ax       #setup dgroup segment
	movw	%ax,%ds
	movw	shade_data,%ax
	movw	%ax,%es
	movw	$0,%bx
init_loop1:
	movw	$-1,%es:current_y(%ebx) #indicate there is no last value
	addw	lines_len,%bx
	cmpw	lines_len*9,%bx
	jb	init_loop1

	popw	%si
	popw	%di
	pop	%es
	pop	%ds
	popw	%bp
	ret
-----------------------------------------------------------------------------

  And here is the converted code:
  
-----------------------------------------------------------------------------
 104              	_init_shade:	#proc	far
 106 0000 6655     		pushw	%bp
 107 0002 6689E5   		movw	%sp,%bp
 109 0005 1E       		push	%ds              #save c required registers
 110 0006 06       		push	%es
 111 0007 6657     		pushw	%di
 112 0009 6656     		pushw	%si
 117 000b BB380B00 		movl	$shade_data,%ebx
 117      00
 121              	init_loop1:
 122 0010 66C78338 		movw	$-1,current_y(%ebx) #indicate there is no last value
 122      0B0000FF 
 122      FF
 123 0019 66031D06 		addw	lines_len,%bx
 123      000000
 124 0020 663B1D36 		cmpw	lines_len*9,%bx
 124      000000
 125 0027 72E7     		jb	init_loop1
 127 0029 665E     		popw	%si
 128 002b 665F     		popw	%di
 129 002d 07       		pop	%es
 130 002e 1F       		pop	%ds
 132 002f 665D     		popw	%bp
 133 0031 C3       		ret
-----------------------------------------------------------------------------
  Am I even close?

  Also I have the following undefines, are these in a library
  somewhere or do I need to supply them?

_bios_keybrd
_dos_getdrive
_dos_setdate
_dos_settime
_enable
_disable
_inp
_outp
_strerror
itoa
ltoa
inp
outp

  Thanks for any and all help.

  Rick
                                                                       _
..------------------------------------------------------------.        | |
| Rick Bronson   rick AT mei DOT com   Tel 414-444-7396      _o_    |        / /__
| Invivo Research                                     \|/    |_______/ (___)
| 2636 N. 66th             "Onde esta dinheiro?"     `---'   |         (___)
| Wauwatosa, WI 53213       -- Gal Costa          Disk | Golf|_______  (___)
`------------------------------------------------------------'       \_(___)

- Raw text -


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