?
Solved

how to compile asm with vc . net

Posted on 2005-03-31
8
Medium Priority
?
552 Views
Last Modified: 2011-10-03
Hello,

I'm trying to run my program in the vc. net.. However, it doesnt run as I want.
the masm 7 just dont want to jump to the procedure. the program work fine with the masm 6.15(not .net)

here is my program (which throw me out in the first procedure call:


.model small,c

N=9h ; a trianlge with N lines
ascii_c = '@' ; ascii_c is getting the ascii code of "@"
first_line=((2*N)-1)

.stack 100h

DATA segment "data"
;.data
DATA ends

;.code

CODE segment "code"

Assume cs:CODE, ds:DATA
;mov ax,@data


start:
;_start PROC
    ;mov ax,@data
      ;mov ds,ax
mov ax,0b800h ;  
mov ds,ax
mov dx,50
mov bx,dx ;
mov al,ascii_c ; al get the value ascii_c (which is the asci code of "@"
mov ah,7h ;
mov si,N
mov cx,si
dec cx
call test1  --------->>>>>>>>>>>>>>>************>>>>>> THIS IS WHERE I GET THE ERROR
call start_location


mov si,first_line+1  ; start of the loop in step of 2, si is the counter
triangle:

            call print_line
            call adjust_screen_location
          sub bx,0a0h
            sub si,2
            jnz triangle ; while si is not 0

;Now starting to print the 2nd triangle of the Shield of David
mov bx,dx
mov si,N
sub si,(N/2)
mov cx,si
call start_location

mov si,first_line+1  ; start of the loop in step of 2, si is the counter

triangle2:
            call print_line
            call adjust_screen_location
          add bx,0a0h
            sub si,2
            jnz triangle2 ; while si is not 0
        

kkk: jmp kkk


mov ah,4ch ;Exit Code
int 21h

;_start ENDP


start_location PROC near ;adjust the start location of the screen
      traingleStartpos:
                  add bx,0a0h
                  loop traingleStartpos
      RET
start_location ENDP

test1 PROC near
  add bx,2
 RET
test1 ENDP

adjust_screen_location proc
            sub si,2
            mov cx,si  ;
            add si,2
          screen_location:
                  sub bx,2
                  loop screen_location

      ret
adjust_screen_location endp

print_line proc ; Print the line in the triangle
            dec si
            mov cx,si ; siמ
            inc si
          print: ;
                  mov [bx],ax
                  add bx,2
                  loop print
            ret
print_line endp
end start
CODE ends
END
--------------
this is the error that I get:
"Unhandled exception at 0x3828105a in triangle.exe: 0xC0000005: Access violation reading location 0x3828105a."
anyway , the LST file is ok.
I dont know what the problem. I tried to solve this but without success.
the command line is : ml -Zi -c -Zm  "-Fl$(IntDir)\$(InputName).lst" "-Fo$(IntDir)\$(InputName).obj" "$(InputPath)"
and the output is: $(IntDir)\$(InputName).obj

Thanks,
Eyal


0
Comment
Question by:eylkrn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 8

Expert Comment

by:_corey_
ID: 13703549
What error are you getting?

corey
0
 

Author Comment

by:eylkrn
ID: 13727630
Hi correy,

As I said:
this is the error that I get:
"Unhandled exception at 0x3828105a in triangle.exe: 0xC0000005: Access violation reading location 0x3828105a."

well, anyway , I've search a little bit in the web. and it seems that there is no way to compile or debug a 16bit code with the .net. am I right?

Eyal
0
 
LVL 8

Assisted Solution

by:_corey_
_corey_ earned 750 total points
ID: 13727721
Sorry about that, I didn't see the bottom at all.

Well, I've not tried that in VS.NET, however Digiital Mars has a compiler and add-ons for 16-bit development.

http://www.digitalmars.com/ [" Digital Mars C and C++ Compilers for Win32, Win16, DOS32 and DOS"]

corey
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:eylkrn
ID: 13727826
Hi,

What do you mean an add-on? and what exact is this Digital Mars? can you please detail? .
the compiler that I'm using is masm .
I'm current debugging with the cv. which is not so comfortable.
will I be able to debug in the Visual studio with this digital mars or is it an stand alone package?

Thanks,
Eyal
0
 
LVL 8

Expert Comment

by:_corey_
ID: 13727991
It's a stand-alone package *as far as I know*.  And like I said, it's the only 16-bit development setup I've heard of or somewhat used.

Digital Marks makes a set of free C and C++ (and a new language D) compilers for both 32-bit, 16-bit and DOS environments.  VS.NET is a 32-bit environment only unless someone else has information.

corey
0
 
LVL 4

Accepted Solution

by:
furqanchandio earned 750 total points
ID: 14055004
if VC 6 did not support 16 bit assembly how can VC.net

i think you will have to rewrite your program in 32 bit
0
 
LVL 4

Expert Comment

by:furqanchandio
ID: 14055006
plus small memory model is dos specific

32 bit applications use flat memory model
0
 

Author Comment

by:eylkrn
ID: 14055167
yes,
after a small research that I did it appear that only 32bit will work

thanks,
eyal
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Introducing Priority Question, our latest feature.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question