begin process at 2010 03 11 19:47:53
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Archive Assembleur

 > 

Archives

 > 

delphi et asm

 > 

fichier .obj


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

fichier .obj

mardi 10 août 2004 à 19:38:15 | fichier .obj

Janseverus

Hello tt le monde :)
Alors voila j'ai un petit problème, j'ai deux fichiers un .obj et un .asm qui sont apelés dans un programme sous delphi mais a la compilation il me dt qu'il y a imcompatibilté car le fichier lié est en 16bits et qu'il faut le mettre en 32 bits.... et ca je sais pas comment faire qq'un a une suggestion?
Merci de votre aide :)
mardi 10 août 2004 à 19:53:56 | Re : fichier .obj

ToutEnMasm

Salut,
Si le fichier asm accepte d'être recompiler avec un assembleur 32 bits c'est gagné.
Dans le cas contraire,il faut trouver le bon assembleur,compatible avec delphi (masm32 a des chances de l'être) et retravailler le source pour que le compilateur accepte de produire le fichier objet.
Sa risque d'être long,ToutEnMasm

mardi 10 août 2004 à 20:21:40 | Re : fichier .obj

BruNews

Administrateur CodeS-SourceS
masm32 produit du obj 32 compatible Delphi.

Comme dit ToutEnMasm, le prob c'est le source a reecrire en 32 bits, supprimer appels aux interruptions etc...
Bonne route.

ciao...
BruNews, Admin CS, MVP Visual C++
mardi 10 août 2004 à 20:29:54 | Re : fichier .obj

Janseverus

Voila ma source vous la pensez compatible en 32bits?


code segment byte public
assume cs:code
public mmsend
public mmread
public binread

;************************************************

mmsend proc far

cmd_add equ <8[bp]>
mm_add equ <6[bp]>

push bp
mov bp,sp

push ax
push bx
push dx
push si
push ds

lds si,cmd_add ;string address (offset) into SI
;segment into ds
inc si ;skip over the length byte

mov dx,mm_add ;port address into DX; passed by value
inc dx

wait_mm_rdy:
in al,dx ;wait for MM2000 to be ready
cmp al,80h ;bit 7=1
jne wait_mm_rdy

mov al,byte ptr[si] ;get data
mov ah,al ;save data

dec dx
out dx,al ;send data
inc dx

or al,80h ;send DAV signal
out dx,al ;output data and DAV signal

wait_mm_dac:
in al,dx ;wait for MM2000 to accept data
cmp al,0 ;i.e. not ready -- bit 7=0
jne wait_mm_dac

cli ;disable interrupts

mov al,0 ;set DAV not data valid and
out dx,al ;remove data

inc si
cmp ah,0dh ;test if last char. sent
je wait_mm_rdy_exit

sti ;enable interrupts
jmp wait_mm_rdy

wait_mm_rdy_exit:
in al,dx ;wait for MM2000 to be ready for exit
cmp al,80h ;bit 7=1
jne wait_mm_rdy_exit

sti ;enable interrupts
pop ds
pop si
pop dx
pop bx
pop ax
mov sp,bp
pop bp
ret 6

mmsend endp

;************************************************

mmread proc far

resp_add equ <8[bp]>
mm_addr equ <6[bp]>

push bp
mov bp,sp

push ax
push bx
push dx
push di
push ds

lds di,resp_add ;string address (offset) into di
;segment into ds
mov bx,di ;save pointer to string length
mov al,0
mov [bx],al ;string length = 0 at start
inc di ;point to beginning of string

mov dx,mm_addr ;port address into DX
inc dx

wait_mm_ready:
in al,dx ;wait for MM2000 not ready to receive
cmp al,0 ;i.e. ready to send
jne wait_mm_ready

pc_ready_for_data:
mov al,80h
out dx,al ;send PC ready to interface

wait_mm_dav:
in al,dx ;wait for MM2000 to indicate DAV
cmp al,80h ;bit 7=1
jb wait_mm_dav ;jump if below

dec dx ;get data
in al,dx
inc dx

mov [di],al ;store data at string address
inc byte ptr [bx] ;inc. resp. string length
mov ah,al ;save received character
inc di

mov al,0 ;indicate to MM2000 data accepted
out dx,al ;set bit 7=0
cmp ah,0ah
je exit

wait_mm_ndav:
in al,dx ;wait for MM2000 to indicate not DAV
cmp al,0 ;bit 7=0
jne wait_mm_ndav

jmp pc_ready_for_data

; Exit if character received is line feed

exit:
in al,dx
cmp al,80h
jne exit

pop ds
pop di
pop dx
pop bx
pop ax
mov sp,bp
pop bp
ret 6

mmread endp

;***************************************

binread proc

bin_add equ <8[bp]>
mm_addr equ <6[bp]>

push bp
mov bp,sp

push ax
push bx
push dx
push di

mov dx,mm_addr ;port address into DX
inc dx

lds bx,bin_add ;bx<-offset, ds<-segment
mov cx,bx
add cx,3
dec bx


bwait_mm_ready:
in al,dx ;wait for MM2000 not ready to receive
cmp al,0 ;i.e. ready to send
jne bwait_mm_ready

bpc_ready_for_data:
mov al,80h
out dx,al ;send PC ready to interface

bwait_mm_dav:
in al,dx ;wait for MM2000 to indicate DAV
cmp al,80h ;bit 7=1
jb bwait_mm_dav ;jump if below

dec dx ;get data
in al,dx
inc dx

inc bx
mov [bx],al

mov al,0 ;indicate to MM2000 data accepted
out dx,al ;set bit 7=0

cmp bx,cx
je bexit

bwait_mm_ndav:
in al,dx ;wait for MM2000 to indicate not DAV
cmp al,0 ;bit 7=0
jne bwait_mm_ndav

jmp bpc_ready_for_data

; Exit if character received is line feed

bexit:
in al,dx
cmp al,80h
jne bexit

pop di
pop dx
pop bx
pop ax
mov sp,bp
pop bp
ret 6

binread endp

;---------------------------------------
code ends
end



Merci pour les réponses :)
mardi 10 août 2004 à 20:39:16 | Re : fichier .obj

BruNews

Administrateur CodeS-SourceS
pas du tout.
cli, sti, etc n'ont rien a faire en mode protege.

ciao...
BruNews, Admin CS, MVP Visual C++
mardi 10 août 2004 à 20:41:13 | Re : fichier .obj

Janseverus

mouarf oki thx kan meme


Cette discussion est classée dans : fichier, obj


Répondre à ce message

Sujets en rapport avec ce message

Fasm obj [ par Bombela ] Salut.Je suis passé à FASM depuis pas longtemps.Je veux générer un fichier .obj COFFMais si je met : mov dx, msgJ'au une erreur.Pour que ça marche, il Inclure un fichier obj a VC++ 6 [ par Mr.X ] Je voudrais savoir si il y a un moyen de recuperer une fonction d'un fichier objet ( qui avant était en assembleur ) depuis Win32, cad inclure à la co nasm+alink pour un compilateur C [ par roygrizzly ] Salut a tous, Je suis en train de programmer un compilateur pour un sous language C pour mes cours. Je travaille sous cygwin car on est obligé. Tout suprimer un fichier en TASM aprés une recherche [ par infoelectronique ] salut j'ai accès aux fichiers [ par tezca_system ] Bonsoir,Par avance je m'excuse si ma question est un écho à un sujet deja evoqué sur ce site.Je souhaite manipuler en asm un fichier texte.Pouvoir lir Compilation d'un fichier COM avec MASM [ par Oeil_de_taupe ] Bonjour,J'imagine que mon manque de neurone peut expliquer mon problème mais je viens de chercher pendant toute l'arprès-midi sans trouver la solution developpez une routine interruption erreur critique 24h [ par msm_007 ] Salut a tous. je suis débutant ds ce domaine c'est pourquoi je besoin d'aide. je veux reimplementer les routines d'interruption de DOS suivante : Tra Creer un exe qui va chercher un fichier texte sur le net ? [ par sharkjo ] Voila mon souci je cheche a creer un programe ce programme grace a un bouton quand on clique dessus il ca aller checher des infos que jai place dans u fichier .bas .bat [ par jonquille80 ] Bonjour,J'ai besoin de modifier une application qui fonctionne sur dos j'ai deux fichiers .bat et .bas je n,arrive pas à ouvrir aucun de ce fichiers j [API] - VirtualAlloc [ par Nowid50 ] Bonjour à tous !Voila je me sers de cette API pour stocker du code assembleur dans un fichier.Et j'aimerais savoir si je modifie le contenu (en utilis


Nos sponsors


Appels d'offres

Sondage...

Comparez les prix

CalendriCode

Mars 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728
293031    

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,608 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales