Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 584
  • Last Modified:

how to compile asm with vc . net

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
eylkrn
Asked:
eylkrn
  • 3
  • 3
  • 2
2 Solutions
 
_corey_Commented:
What error are you getting?

corey
0
 
eylkrnAuthor Commented:
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
 
_corey_Commented:
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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
eylkrnAuthor Commented:
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
 
_corey_Commented:
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
 
furqanchandioCommented:
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
 
furqanchandioCommented:
plus small memory model is dos specific

32 bit applications use flat memory model
0
 
eylkrnAuthor Commented:
yes,
after a small research that I did it appear that only 32bit will work

thanks,
eyal
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now