abrir bandeja de cd rom con ensamblador

(1/1)

jim12328:
hola tengo este código
Código
.model small
.stack
code segment para
assume cs:code,ds:code
org 100h
start:
mov cx,0h
unlock:
mov ah,45h
mov al,01h
mov dl,cl
int 13h
eject:
mov ah,46h
mov al,0
mov dl,cl ;s.o.
int 13h
cmp ah,0b1h
je unlock
inc cl
jnz unlock
mov ax,4c00h
int 21h
code ends
end start
 
 
 
supuestamente abre la bandeja del cd rom, compila y hasta ahí todo bien
pero al final no abre la bandeja alguien me puede decir que es lo que falta para que pueda abrir la bandeja de verdad me urge alguien que me pueda ayudar

ivancea96:
Te pongo directamente el código que usa uno de los ejemploos de FASM:

Código
format PE GUI 4.0
 
include 'win32a.inc'
 
; no section defined - fasm will automatically create .flat section for both
; code and data, and set entry point at the beginning of this section
 
invoke MessageBoxA,0,_message,_caption,MB_ICONQUESTION+MB_YESNO
cmp eax,IDYES
jne exit
 
invoke mciSendString,_cmd_open,0,0,0
invoke mciSendString,_cmd_eject,0,0,0
invoke mciSendString,_cmd_close,0,0,0
 
exit:
invoke ExitProcess,0
 
_message db 'Do you need additional place for the beer?',0
_caption db 'Desktop configuration',0
 
_cmd_open db 'open cdaudio',0
_cmd_eject db 'set cdaudio door open',0
_cmd_close db 'close cdaudio',0
 
; import data in the same section
 
data import
 
library kernel32,'KERNEL32.DLL',\
user32,'USER32.DLL',\
winmm,'WINMM.DLL'
 
import kernel32,\
ExitProcess,'ExitProcess'
 
import user32,\
MessageBoxA,'MessageBoxA'
 
import winmm,\
mciSendString,'mciSendStringA'
 
end data
 

Si no entiendes algo, solo pregunta.

simorg:
Tema duplicado:

http://foro.elhacker.net/asm/ayuda_con_este_codigo_en_ensamblador-t414362.0.html;msg1941716#new


Tema cerrado.

Navegación

[0] Índice de Mensajes