GIDForums  

Go Back   GIDForums > Computer Programming Forums > Assembly Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 27-Sep-2010, 07:56
wawachi776 wawachi776 is offline
New Member
 
Join Date: Oct 2008
Posts: 7
wawachi776 can only hope to improve

CDROM eject and insert...


;;================================================ =======
.model tiny
.code
Go:
mov byte Job,00h ; open the door
jmp short GetDrive
GetDrive: mov al,device ; get second char on command line
mov device,ax ; put in device
JustDoIt: mov bx,offset ioctlo ; Do the I/O
mov [bx+16],ds ; data seg
mov cx,device ;
push cx
mov ax,1510h ;
int 2Fh ;
mov bx,offset ioctlo ;
mov dx,[bx+3] ; status
xor ax,ax ; assume no error
test dx,8000h ;
jz short NoRetErr ;
mov al,02h ; other error
NoRetErr:
inc cx
push cx
test dx,20h ;
cmp cx,5Ah
je short NotBuzyo ;
mov al,01h ; busy error
xor ax,ax
xor bx,bx
xor dx,dx
testIT:
pop cx
mov device,cx
jmp short Go
NotBuzyo: mov ah,4Ch ; Exit program, close files
int 21h ; and return to DOS
device dw 00h ; 3 = D:, 4 = E:, etc.
Job db 0 ; cc (00 = Open it, 05 = close it)
ioctlo db 13,0,12 ; rhlen,subu,comc
dw 00h ; status
dup 8,0 ; reserved
db 0 ; mdb
dw offset Job ; *trandad (off)
dw 00h ; *trandad (seg)
dw 01h,00h ; tranct,ssn
dw 00h,00h ; *volid

.end
;================================================= ========

can somebody help me...this code is only for ejecting the cd rom tray..i want to add a code for inserting bak the cd tray but i dont know what code to put....
thanks in advance for your help!!!!=D
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDApp · GIDBlog · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 23:31.


vBulletin, Copyright © 2000 - 2014, Jelsoft Enterprises Ltd.