How to resolve the algorithm Hello world/Text step by step in the PDP-1 Assembly programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Hello world/Text step by step in the PDP-1 Assembly programming language

Table of Contents

Problem Statement

Display the string Hello world! on a text console.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Hello world/Text step by step in the PDP-1 Assembly programming language

Source code in the pdp-1 programming language

hello   
/ above: title line - was punched in human readable letters on paper tape
/ below: location specifier - told assembler what address to assemble to
100/
lup,	lac i ptr		/ load ac from address stored in pointer
	cli			/ clear io register
lu2,	rcl 6s			/ rotate combined ac + io reg 6 bits to the left
				/ left 6 bits in ac move into right 6 bits of io reg
	tyo			/ type out character in 6 right-most bits of io reg
	sza			/ skip next instr if accumulator is zero
	jmp lu2			/ otherwise do next character in current word
	idx ptr			/ increment pointer to next word in message
	sas end			/ skip next instr if pointer passes the end of message
	jmp lup			/ otherwise do next word in message
	hlt			/ halt machine
ptr,	msg			/ pointer to current word in message
msg,	text "hello, world"	/ 3 6-bit fiodec chars packed into each 18-bit word
end,	.         		/ sentinel for end of message
start 100			/ tells assembler where program starts

  

You may also check:How to resolve the algorithm Keyboard input/Obtain a Y or N response step by step in the F# programming language
You may also check:How to resolve the algorithm Isqrt (integer square root) of X step by step in the jq programming language
You may also check:How to resolve the algorithm Roots of unity step by step in the Icon and Unicon programming language
You may also check:How to resolve the algorithm Hello world/Newline omission step by step in the Common Lisp programming language
You may also check:How to resolve the algorithm CSV data manipulation step by step in the PARI/GP programming language