Site banner
.
Home Forums Blogs Articles Photos Videos Contact FAQ                    
.
.
Wisdom Archive
Body Mind and Soul
Faith and Belief
God and Religion
Law of Attraction
Life and Beyond
Love and Happiness
Peace of Mind
Peace on Earth
Personal Faith
Spiritual Festivals
Spiritual Growth
Spiritual Guidance
Spiritual Inspiration
Spirituality and Science
Spiritual Retreats
More Wisdom
Buddhism Archives
Hinduism Archives
Sustainability
Theology Archives
Even more Wisdom
2012 - Year 2012
Affirmations
Aura
Ayurveda
Chakras
Consciousness
Cultural Creatives
Diksha (Deeksha)
Dream Dictionary
Dream Interpretation
Dream interpreter
Dreams
Enlightenment
Essential Oils
Feng Shui
Flower Essences
Gaia Hypothesis
Indigo Children
Kalki Bhagavan
Karma
Kundalini
Kundalini Yoga
Life after death
Mayan Calendar
Meaning of Dreams
Meditation
Morphogenetic Fields
Psychic Ability
Reincarnation
Spiritual Art, Music & Dance
Spiritual Awakening
Spiritual Enlightenment
Spiritual Healing
Spirituality and Health
Spiritual Jokes
Spiritual Parenting
Vastu Shastra
Womens Spirituality
Yoga Positions
Site map 2
Site map


Dream Sharing Forum

at Global Oneness Community.

Share your dreams and let others help you with the interpretation!
Dream Sharing Forum



.

PDP-8 - Subroutines on the PDP-8

PDP-8 - Subroutines on the PDP-8: Encyclopedia II - PDP-8 - Subroutines on the PDP-8

The PDP-8 did not implement any general-purpose stack so there was no stack upon which to store the PC, AC, or any other context when a subroutine was called or an interrupt occurred. Instead, the updated PC simply replaced the first word of the targeted subroutine. An indirect JMP instruction was then used to exit from the subroutine. For example, here is "Hello, World!" re-written to use a subroutine: *200 / Set assembly origin (load address) HELLO, CLA CLL / Clear the AC and the Link bit ...

See also:

PDP-8, PDP-8 - Description, PDP-8 - Versions of the PDP-8, PDP-8 - Input/Output, PDP-8 - Programming facilities, PDP-8 - Instruction set, PDP-8 - Example program, PDP-8 - Subroutines on the PDP-8, PDP-8 - Interrupts

PDP-8, PDP-8 - Description, PDP-8 - Example program, PDP-8 - Input/Output, PDP-8 - Instruction set, PDP-8 - Interrupts, PDP-8 - Programming facilities, PDP-8 - Subroutines on the PDP-8, PDP-8 - Versions of the PDP-8

PDP-8: Encyclopedia II - PDP-8 - Subroutines on the PDP-8



PDP-8 - Subroutines on the PDP-8

The PDP-8 did not implement any general-purpose stack so there was no stack upon which to store the PC, AC, or any other context when a subroutine was called or an interrupt occurred. Instead, the updated PC simply replaced the first word of the targeted subroutine. An indirect JMP instruction was then used to exit from the subroutine.

For example, here is "Hello, World!" re-written to use a subroutine:

   *200                    / Set assembly origin (load address)

   HELLO,  CLA CLL         / Clear the AC and the Link bit
           TAD (DATA-1)    / Point AC just *BEFORE* the data (accounting for later pre-increment behavior)
           DCA 10          / Put that into one of ten auto-pre-increment memory locations
   LOOP,   TAD I 10        / Pre-increment mem location 10, fetch indirect to get the next character of our message
           SNA             / Skip on non-zero AC
           HLT             / Else halt at end of message
           JMS OUT1        / Write out one character
           JMP LOOP        / And loop back for more

   OUT1,   0               / Will be replaced by caller's updated PC
           TSF             / Skip if printer ready
           JMP .-1         / Wait for flag
           TLS             / Send the character in the AC
           CLA CLL         / Clear AC and Link for next pass
           JMP I OUT1      / Return to caller

   DATA,  "H               / A well-known message
          "e               /
          "l               / NOTE:
          "l               /
          "o               /   Strings in PAL-8 and PAL-III were "sixbit"
          ",               /   To use ASCII, we'll have to spell that out, character by character
          "                /
          "w               /
          "o               /
          "r               /
          "l               /
          "d               /
          "!               /
          015              /
          012              /
          0                / Mark the end of our .ASCIZ string ('cause .ASCIZ hadn't been invented yet!)

This dedicated storage for the return address made the use of reentrancy and recursion difficult because the programmer would have needed to explicitly store away the return address onto a programmer-maintained stack. It also made it difficult to use ROM with the PDP-8 because read-write return-address storage was commingled with read-only code storage in the address space. Programs intended to be placed into ROMs approached this problem in several ways:

  • They avoided the use of subroutines,
  • They copied themselves to core memory before execution, or
  • They were placed into special ROM cards that provided a few words of read/write memory, accessed indirectly through the use of a thirteenth flag bit in each ROM word.




Adapted from the Wikipedia article "Subroutines on the PDP-8", under the G.N U Free Docmentation License. Please also see http://en.wikipedia.org/wiki

More material related to Pdp-8 can be found here:
Main Page
for
Pdp-8
Index of Articles
related to
Pdp-8


« Back








Search the Global Oneness web site
Global Oneness is a huge, really huge, web site. Almost whatever you are searching for within health, spirituality, personal development and inspirationals - you will find it here!
Google
 
 

Rate this article!

Please rate this article with 10 as very good and 1 as very poor.

.








Sneak-Peek of Global Oneness Community

Hi friend! The Global Oneness Community, the place for information and sharing about Oneness is not really launched yet (you will see there is still some clean up to do) ...but it is now open for a sneak-peek! And if you wish - please register and become one of the very first members to do so! Jonas

Forum Home, Articles, Photo Gallery, Videos, News, Sitemap
...and much more!


Dream Sharing Forum

at Global Oneness Community.

Share your dreams and let others help you with the interpretation!
Dream Sharing Forum



Forum
Articles
Images Pictures
Videos
News
Sitemap




 

 

 

 

 


 








  » Home » » Home »