a re for asm file???

Peter Hansen peter at engcorp.com
Wed Oct 2 00:06:09 EDT 2002


jubafre at brturbo.com wrote:
> 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?????

Hi Juliano,

With all these postings, I'm starting to get curious.
What's the application for this?  I know there are already
lots of assembler programs out there, so there must be a good
reason you are trying to build one from scratch in Python.
Can you share your goals with us?

-Peter




More information about the Python-list mailing list