SunQuest
           Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old February 21st, 2007, 01:22 AM
Purple Avenger Purple Avenger is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Posts: 271 Purple Avenger User rank is Sergeant (500 - 2000 Reputation Level)Purple Avenger User rank is Sergeant (500 - 2000 Reputation Level)Purple Avenger User rank is Sergeant (500 - 2000 Reputation Level)Purple Avenger User rank is Sergeant (500 - 2000 Reputation Level)Purple Avenger User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 1 h 51 m 31 sec
Reputation Power: 9
Internal design of a FORTRAN compiler

I stumbled across this doing some random Googling. Interesting stuff if you're into compiler design. Design constraints for the old 8088 are much different than for newer chips

IBM doc on the internal design of early RM Fortran compiler

Reply With Quote
  #2  
Old February 23rd, 2007, 07:20 PM
Purple Avenger Purple Avenger is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Posts: 271 Purple Avenger User rank is Sergeant (500 - 2000 Reputation Level)Purple Avenger User rank is Sergeant (500 - 2000 Reputation Level)Purple Avenger User rank is Sergeant (500 - 2000 Reputation Level)Purple Avenger User rank is Sergeant (500 - 2000 Reputation Level)Purple Avenger User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 1 h 51 m 31 sec
Reputation Power: 9
More on this particular FORTRAN compiler...

I've been looking at the OBJ's it emits and another trick they used has become apparent.

It emits small blobs of code (LEDATA records) and it defers resolution of certain things (ex. forward jump offsets and stack depth allocation for autovars) until after an LEDATA record has been written out.

Once it knows the final values of those things, it emits other small 1 and 2 byte long LEDATA's that essentially "backpatch" and override some of the prior contents of the earlier LEDATA records.

Fortran allows for implied declaration of variables, so a Fortran compiler won't know up front the size of local vars until its hit the last line in a function. So they emit the code for the body of the function before knowing what the final amount they needed to sub from SP was and backpatch it later on.

This backpatching scheme clearly helped the compiler work better on low memory machines since it didn't need to keep all the code it was emitting around, just info about back patches.

Essentially, it pushes some of what would normally be considered code generation off onto the linker for resolution.

In the versions of this compiler that came out a few of years later, most (not all though) of this backpatch dance seems to have been eliminated...and its memory requirements on the packaging went up dramatically as well

Last edited by Purple Avenger : February 23rd, 2007 at 07:23 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Internal design of a FORTRAN compiler


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway