Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Howto compile 8086 Assembly code? 1

Status
Not open for further replies.

dumboGuy

Programmer
Joined
Sep 16, 2003
Messages
5
Location
IN
I have some (8086) assembly code (in SMALL mode). I need to compile this using VC++ (into an .obj file). How do I do this? Any advice and suggestions welcome

thanks in advance
 
Can't you just put it inside an _asm block?

/Per

if (typos) cout << &quot;My fingers are faster than my brain. Sorry for the typos.&quot;;
 
you can write it inline
vor example:

__asm mov ax, ax

or

__asm
{
push ax
pop ax
}

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Thanks for the tip...

but it does not seem to be working since different SEGMENTs are initialized... also it is not recognizing data types 'dw'.

I've forgotten how I was doing it in college :(
 
could you give a piece of code?

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Thanks for the effort Ion

I need the Gestalt pattern matcher logic:


I've been trying to compile it with the Borland's ancient Tasm32 (ver 5.0) and Turbo C++ (ver 1.01). Managed to link and execute seperately but it dint work successfully.

regards
 
Oh, I understand, you used Borland products. Microsoft VisualC++ supports only MASM instruction.

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Made a start on trying to convert, where I instead of using the static asm data, allocate regular C++ variables.

Code:
void foo()
{
	__int16 stcknum=0;
	__int16 score=0;
	__int16* ststr1[25];
_asm
{


        push   bp                 ;save BP reg.
        mov    bp,sp              ;save SP reg in BP for use in program
        push   es                 ;save the ES segment register
        mov    ax,ds              ;copy DS segement register to ES
        mov    es,ax
        xor    ax,ax              ;zero out AX for clearing of SCORE var.
        mov    score,ax           ;zero out SCORE
        mov    stcknum,ax         ;initalize number of stack entries to 0
        mov    esi,ststr1        ;move beginning pointer of string 1 to SI
   .
   .
etc


/Per

if (typos) cout << &quot;My fingers are faster than my brain. Sorry for the typos.&quot;;
 
Thanks for both the links Salem. Thanks all for the tips. I needed the hack real quick.

/dumbo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top