a re for asm file???

sismex01 at hebmex.com sismex01 at hebmex.com
Tue Oct 1 09:28:24 EDT 2002


> i have a file.asm
> 	
> 	LDA 	D1	;fdsfsd
> 	ADD 	D2	;gfsf
> 	STA 	D3	;jhgfj
> 	HLT		;jgh
> D1:	DB 	3	;7
> D2:	DB 	2	;876
> D3:	DB 	0	;jh
> 
> i don´t know to define a re to put in a list like this:
> 
> in x just the labels
> x=['D1', 'D2','D3', '3','2','1]
> 
> IN Y JUST THE INSTRUCTIONS
> Y=['LDA', 'ADD', 'HLT', 'DB','DB', 'DB']
> 
> how can i make this re to find the labels and the instructions
> for a generic file.asm like the file above?????
> 
> Juliano Freitas
> www.gebrasil.hpg.com.br
> 

Whooo, cool, 6510 asm :-) It's been a while...

Why not make a full-fledged parser? It'll be much more
useful, and also I don't think it'll be harder than
finding that "magic" Regex you're asking about;
after all, there's only a small number of instructions
and addressing modes.  If an XML parser can be build
on python alone, a 6502 asm parser can, also. :-)

Good luck!

-gustavo










Advertencia: 
La informacion contenida en este mensaje es confidencial y restringida y
esta destinada unicamente para el uso de la persona arriba indicada, Esta
comunicacion representa la opinion personal del remitente y no refleja
necesariamente la opinion de la Compañia. Se le notifica que esta
estrictamente prohibida cualquier difusion, distribucion o copia de este
mensaje. Si ha recibido esta comunicacion o copia de este mensaje por error,
o si hay problemas en la transmision, favor de comunicarse con el remitente.


Todo el correo electrónico enviado para o desde esta dirección será
procesado por el sistema de correo corporativo de HEB. Tal correo
electrónico esta sujeto a ser almacenado y puede ser revisado por alguien
ajeno al recipiente autorizado con el propósito de monitorear que se cumplan
las normas de seguridad de la empresa.




More information about the Python-list mailing list