View Single Post
Old May 20th, 2006, 8:55 AM   #31
Narue
Professional Programmer
 
Narue's Avatar
 
Join Date: Sep 2005
Posts: 419
Rep Power: 4 Narue is on a distinguished road
You've commented out all of your labels. There's a reason the code I posted follows this theme:
org 100h
jmp start

; Data definitions here

start:
        ; Executable code here
If you don't jump over the data definitions, they'll be treated as executable instructions, which very rarely works. Also, since you're treating snum as a byte string, you should use db instead of dw. You want something more like this:
org	100h
jmp	start

save db 4 dup '$'
snum db "Enter second$"

start:
	mov	ah,09
	mov	dx,snum
	int	21h

	mov	ax,04C00h
	int	21h
You can also place your data definitions after the executable code and save yourself the trouble, if you want:
org	100h

	mov	ah,09
	mov	dx,snum
	int	21h

	mov	ax,04C00h
	int	21h

save db 4 dup '$'
snum db "Enter second$"
Now it's a moot issue because you terminate the program before IP gets to the data definitions. By the way, one trick you may have noticed to save yourself two mov's at the end is to mov a two byte value to ax rather than splitting it up into two mov's of one byte to ah and al.
__________________
Even if the voices aren't real, they have some pretty good ideas.
Narue is offline   Reply With Quote