Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,151,755 members, 7,813,503 topics. Date: Tuesday, 30 April 2024 at 01:05 PM

Please Help On This Topic: 2 Pass Assembler - Computers - Nairaland

Nairaland Forum / Science/Technology / Computers / Please Help On This Topic: 2 Pass Assembler (1856 Views)

I T Expert : How Do I Bye Pass The Password On My Laptop ? / How To By-pass Android Device Security Lock Pattern And Unlock Your Device / Nairalanders: I Need Help On This Topic Please (2) (3) (4)

(1) (Reply)

Please Help On This Topic: 2 Pass Assembler by scantee(m): 12:42pm On Feb 02, 2009
HI MY FELLOW NAIRALAND
PLEASE I WAS GIVEN AN ASIEGNMENT ON THIS TOPIC 2 PASS ASSEMBLER. (computer programming)
PLEASE WHO CAN HELP ME ON AND EXPLAIN THIS TO ME, THE USES, FUNCTION, IMPORTANTS ETC

I WILL BE GRATEFUL.

THANKS
email is scanteebest@yahoo.co.uk
Re: Please Help On This Topic: 2 Pass Assembler by scantee(m): 12:45pm On Feb 02, 2009
please help me is very urgent.

thanks one more
Re: Please Help On This Topic: 2 Pass Assembler by Maleeq(m): 8:18am On Feb 15, 2009
Hi,

Though you did not specify the platform/architecture you are building an assembler for, the idea is somewhat platform independent. . .(have different possible approach).

In basic, the assembler generates machine codes from an assembly language code. A simply way of achieving this is through the 2-pass organization. The need for this arises from consideration of the assembler functions and the nature of assembly language code. The primary ones being:
[list]
[li]The assembler generates machine code output.[/li]
[li]The assembler generates memory addresses for program labels.[/li]
[li]Assembly language control structures(jumps) cannot be written without forward reference. A forward reference occurs when you use a label in an operand that appears earlier in the code than its definition.[/li]
[/list]

Clearly now, the reasons for the 2-pass organization is necessitated by the facts that:
[list]
[li]The memory address for a label cannot be assigned until its definition has been read.[/li]
[li]Code generation for jumps and branches requires knowing the address of the jump or branch target.[/li]
[/list]

During the first pass, the assembler is assigning memory addresses to labels. Machine code is generated during the second pass.


Assembler technology is so wide to be covered here in full details. Please, the links below refers you to sites where you can find more information about this, as well as some basic algorithm for this.
[url=http://www.d.umn.edu/~gshute/asm/assemblers.html]Link 1: Basic Descriptions [/url]
Link 2: Difference between 1-pass and 2-pass
Link 3: Sample Algorithm
[url=http://www.cs.uiowa.edu/~rus/Courses/SysSoft/Notes/chap16a2.pdf]Link 4: Book For Assembly Principles[/url]

Like I said, this is just the basic/algorithm I have provided. You will then need to develop the actual assembler in your choice high-level programming language.

Cheers! and do google for some more info.

(1) (Reply)

How Can I Activate Or Remove A "This Window Is Not Genuine" Window Or Message? / !!!clearance Deals!!! / Browse Fast And Free With Ur Multilinks Modems

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 12
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.