Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

johnc82

problem drawing a line using asm with .exe file

This topic is 5541 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi my problem is i can''t display the line that i draw by using the following code: my asm source .exe file:
title draw2 test

sseg segment para stack ''stack''
	db 100 dup(?)
sseg ends

dseg segment

dseg ends

cseg segment
main proc far
	assume ss:sseg, ds:dseg, cs:cseg

	mov ax, dseg
	mov ds, ax
	
	mov ax, 0600h
	mov bh, 07
	mov cx, 0000
	mov dx, 184fh
	int 10h

	mov ah, 00h
	mov al, 06
	int 10h
		
	mov cx, 100
	mov dx, 50
again:	mov ah, 0ch
	mov al, 01
	int 10h

	inc cx
	cmp cx, 200
	jnz again	

	mov ah, 4ch
	int 21h

main endp
cseg ends
end main
but when use .com asm code it can display the line my asm source .com file:
title drwa test

page 60, 132

cseg segment
	
	org 100h
	assume cs:cseg, ds:cseg, es:cseg

progcode proc near
	mov ax, 0600h
	mov bh, 07
	mov cx, 0000
	int 10h

	mov ah, 00
	mov al, 06
	int 10h

	mov cx, 100
	mov dx, 50
	
back: 	mov ah, 0ch
	mov al, 01
	int 10h
	
	inc cx
	cmp cx, 200
	jnz back

	int 3	
	
progcode endp

cseg ends
	end progcode

Share this post


Link to post
Share on other sites
Advertisement
Chances are your EXE is being loaded into 32-bit protected mode, in which case Windows will hijack it and do unpleasant things with low-level drawing code unless you specifically tell the system you should be allowed to poke video memory.

Share this post


Link to post
Share on other sites
No, sorry. I quit writing programs in ASM before p-mode became a big thing, and the only ASM I''ve done since has been very low-level anyways.

Share this post


Link to post
Share on other sites
You don''t mention which assembler you use to create your .EXE

Chances are there''s a directive (.DOSSEG or .MODE or something) which will make a 16-bit DOS executable for you.

Hope this helps.






Stevie

Don''t follow me, I''m lost.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!