*Help a newbie with this source code* 
Author Message
 *Help a newbie with this source code*

Could someone please tell me (a newbie) what's wrong with this source
code, when I try to assemble it it gives me this message.
array.asm(9): error A2008: syntax error :proc
array.asm(14): fatal error A1010: unmatched block nesting : main
Am using MASM 6.11.Please don't tell me I need NASM cause I have it, and
the book I'm learning from is mainly for MASM.
Thanks

.model small
.stack 100h
.data
array1 db 10,20,30,40,50
a1_Count = ($ - array1)
extrn Clrscr:proc
extrn Writeint:proc
.code
proc main
call Clrscr
jmp Writeloop
mov ax, 4c00h
int 21h
main endp

Writeloop proc

mov ax,ds
mov bx,offset array1
mov cx,a1_Count
mov bx,array1
mov si,0
mov ax,[bx+si]
push bx
mov bx,10
call Writeint
pop bx
inc si
dec cx
cmp cx,0
jne Writeloop
ret
Writeloop endp
end main



Wed, 09 Jan 2002 03:00:00 GMT  
 *Help a newbie with this source code*

writes:

Quote:
>proc main
>call Clrscr
>jmp Writeloop
>mov ax, 4c00h
>int 21h
>main endp

it should be "main proc" for line 9. name of label, then type (for masm)
then you're getting the unmatched block nesting because you didn't declare the
"main proc" right, it doesn't know what you're talking about.
GS d- s: a---- C++++ W++
 N++ K- W+++++ M-- PS
PE+ Y+ PGP- t 5 X++ R
tv+ b DI+++ D---- Ge-- h! r+


Thu, 10 Jan 2002 03:00:00 GMT  
 *Help a newbie with this source code*


   >Could someone please tell me (a newbie) what's wrong with this
   >source code, when I try to assemble it it gives me this message.
   >array.asm(9): error A2008: syntax error :proc
   >array.asm(14): fatal error A1010: unmatched block nesting : main
   >Am using MASM 6.11.Please don't tell me I need NASM cause I have it,
   >and the book I'm learning from is mainly for MASM.
   >Thanks
   >..model small
   >..stack 100h
   >..data
   >array1 db 10,20,30,40,50
   >a1_Count = ($ - array1)
   >extrn Clrscr:proc
   >extrn Writeint:proc
   >..code
   >proc main
   >call Clrscr
   >jmp Writeloop
    ^^^
****** Here's one problem.  You obviously need "call;" not "jmp." ******

   >mov ax, 4c00h
   >int 21h
   >main endp
   >Writeloop proc

   >mov ax,ds
   >mov bx,offset array1
   >mov cx,a1_Count
   >mov bx,array1
   >mov si,0
   >mov ax,[bx+si]
   >push bx
   >mov bx,10
   >call Writeint
   >pop bx
   >inc si
   >dec cx
   >cmp cx,0
   >jne Writeloop
   >ret
   >Writeloop endp
   >end main

.....................................................................
Return address is mangled to foil spambots. Remove all "g"s to e-mail.

Net-Tamer V 1.08X - Test Drive



Thu, 10 Jan 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. newbie: help with source code examples.

2. LOST SOURCE CODE IN CLIPPER : HELP HELP HELP !!!!!

3. Data Recovery SOURCE CODE ( SOURCE CODES of Professional Data Recovery Software )

4. Converting FORTRAN source code to C source code

5. quick newbie question, please help, .bmp of code attached - code.bmp [0/4]

6. Source code request for newbie(me)

7. Help! Utter newbie needs help with basic code

8. Newbie seeks help compiling TCL source

9. source code lost, please help

10. HELP! with source code

11. Help with source code

12. Help with Printing Source Code

 

 
Powered by phpBB® Forum Software