Author Topic: Help to write a program on msam32 IDe  (Read 1672 times)

Nabho

  • Regular Member
  • *
  • Posts: 7
Help to write a program on msam32 IDe
« on: October 14, 2014, 12:11:35 PM »
Search a program in an array and print whetehr it's positive or negative

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 4807
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Help to write a program on msam32 IDe
« Reply #1 on: October 14, 2014, 02:00:11 PM »
This sounds like homework, tell us what you are trying to do and what you have written.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

Gunther

  • Member
  • *****
  • Posts: 3515
  • Forgive your enemies, but never forget their names
Re: Help to write a program on msam32 IDe
« Reply #2 on: October 14, 2014, 05:36:33 PM »
Hi  Nabho,

as Hutch already mentioned: The best way to get help is to post your code here and to describe your goals. We can look over your code, can give hints, tips and tricks, but we won't do your homework for you.

Gunther
Get your facts first, and then you can distort them.

Nabho

  • Regular Member
  • *
  • Posts: 7
Re: Help to write a program on msam32 IDe
« Reply #3 on: October 14, 2014, 06:23:17 PM »
I don't know anything about asm and the teachers asked me to do it without any help

Nabho

  • Regular Member
  • *
  • Posts: 7
Re: Help to write a program on msam32 IDe
« Reply #4 on: October 14, 2014, 06:59:00 PM »
here's the code i used in MSAM32 ide

.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib

.data

a db 02h,02h,02h,02h,02h,02h,02h,02h,02h,02h

.code

start: mov ax,@data

 mov ds,axa

 mov cl,10

 lea si,a

 mov ax,0000h

again: add al,[si]

 inc si

 dec cl

 jnz again

 mov cl,0ah

 div cl

 mov ah,4ch

 int 21h

 end start

 .end

whenever i click on assemble and link on ide i get error s

line 26:error A2155:cannot use 16-bit register with a 32-bit address
line 16:error A2004:symbol type conflict

herge

  • Member
  • ***
  • Posts: 480
Re: Help to write a program on msam32 IDe
« Reply #5 on: October 15, 2014, 11:01:44 PM »
Hi:

 mov ds, axa
should be mov ds, ax

 Regrds herge
Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.