|  | Atari coding BBS
 
 
 
| GEMDOS Error PLEASE HELP :'( | 
|---|
 
| Posted by: Matt | Apr,19.2013-11:58 |  
| Hi all...
 
 I am currently working on a program that saves virus killer bootsectors (such as medway boys protector II for example.) for use in a program to eventually add your own bootsectors to disks.
 
 After The FWrite() call, the program ends on Trap #1 (I've highlighted this bit in the code)
 The current directory is A:
 
 And when tracing the program in MOnST it just says program terminated
 
 Ive included code so far...
 
 Thanks for any help on this one!
 
 
 *****************************************************************
 *								*
 *	Bootsector Restoration Program (BRP V1.0 - Alpha)	*
 *								*
 *****************************************************************
 
 
 read_dev	equ	1	;(0)=Drive A:      (1)=Drive B:
 write_dev	equ	0
 
 
 
 bsr	read_boot
 bsr	create_file
 
 bsr	open_file
 bsr	write_file
 bsr	close_file
 
 clr.l	-(sp)
 trap	#1
 
 
 
 
 
 
 
 *****************************************************************
 *								*
 *	Subroutines						*
 *								*
 *****************************************************************
 
 read_boot:
 move.w	#1,-(sp)	;count
 move.w	#0,-(sp)	;side
 move.w	#0,-(sp)	;track
 move.w	#1,-(sp)	;sector
 move.w	#read_dev,-(sp)
 move.l	#0,-(sp)	;reserved/not used
 pea	boot_space	;reserve 512 bytes of space
 move.w	#$08,-(sp)
 trap	#14
 lea	20(sp),sp
 rts
 
 create_file:
 move.w	#0,-(sp)
 pea	fname
 move.w	#$3c,-(sp)
 trap	#1
 addq.l	#8,sp
 move.l	d0,handle
 rts
 open_file:
 move.w	#1,-(sp)
 pea	fname
 move.w	#$3D,-(sp)
 trap	#1
 addq.l	#8,sp
 move.l	d0,handle
 rts
 write_file:
 pea	boot_space
 move.l	#512,-(sp)
 move.w	handle,-(sp)
 -------------------------------
 trap	#1   *********************** Where the program essentially STOPS
 --------------------------------
 lea	10(sp),sp
 rts
 close_file:
 move.w	handle,-(sp)
 move.w	#$3e,-(sp)
 trap	#1
 addq.l	#4,sp
 rts
 
 
 data
 boot_space:	ds.b	512
 handle:		ds.l	1
 fname:		dc.b	'bootsect.bin',0
 
 
 |  
 
 
 
 
 [All messages in this thread]      [Start new thread]
 
 
 
 What's the anti-troll code?
 That's your personal code to be able to add comments and messages on the dhs.nu site.
 Don't have a code or forgot it? Fix it here.
 |