1 Replies - 786 Views - Last Post: 07 February 2011 - 03:32 PM

#1 tnecniv   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 109
  • Joined: 03-October 09

cmd hung when this set of code is run

Posted 05 February 2011 - 03:51 AM

stk	segment	stack
	DB	128 DUP(?)
tos	label	word
stk	ends
;

data segment
	array DB	11,21,31,41,51
data ends
;

code segment
	ASSUME CS:code, DS:data, ss:stk
	count	EQU	5
;

start:
	MOV BX,data ;initialize data segment
	Mov DS,BX
;

screen:
	MOV CL, count ; CL=5

	MOV	AH,2 ; display interrupt
	MOV	DL,array[BX] ; contents in array put inside DL
	INT	21h
	
	INC BX
	DEC CL
	
	JNZ screen; if CL is not zero repeat screen
;	
exit1:	
	MOV AH,4ch
	INT 21h
;		
code ends





i am suppose to print out the numbers in the array.

i guess my problem lies in this 3 lines:

MOV AH,2 ; display interrupt
MOV DL,array[BX] ; contents in array put inside DL
INT 21h


i have little understanding on assembly. when i run the set of code my cmd will hung and not responding. i am not able to end task to terminate the hung cmd.

Please advise what is wrong

Is This A Good Question/Topic? 0
  • +

Replies To: cmd hung when this set of code is run

#2 nathanpc   User is offline

  • SCIENCE!
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,171
  • Joined: 31-July 09

Re: cmd hung when this set of code is run

Posted 07 February 2011 - 03:32 PM

Have you already tried a debugger? I recommend you to use OllyDbg
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1