The MASM Forum

Miscellaneous => 16 bit DOS Programming => Topic started by: Nabho on October 14, 2014, 12:11:35 PM

Title: Help to write a program on msam32 IDe
Post by: Nabho on October 14, 2014, 12:11:35 PM
Search a program in an array and print whetehr it's positive or negative
Title: Re: Help to write a program on msam32 IDe
Post by: hutch-- 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.
Title: Re: Help to write a program on msam32 IDe
Post by: Gunther 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
Title: Re: Help to write a program on msam32 IDe
Post by: Nabho 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
Title: Re: Help to write a program on msam32 IDe
Post by: Nabho 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
Title: Re: Help to write a program on msam32 IDe
Post by: herge on October 15, 2014, 11:01:44 PM
Hi:

mov ds, axa
should be mov ds, ax

Regrds herge