Dale - Computer Science Illuminated 236

Dale - Computer Science Illuminated 236 - language rather...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Comment Explanatory text for the human reader 7.5 Assembly Language 209 Pseudo-Op Operand *–SRII *’L RK /***/ d# Meaning Store the characters between the //'s into memory Generate three bytes of storage and set each byte to zero *)ND Signals the end of the assembly-language program *W "D *W "D d#O h#101O Generate a word with the decimal value 5 stored in it Generate a word with the hexadecimal value 0105 stored in it Assembly-Language Versions of Previous Program Program 1 (immediate addressing) Let’s take a look at the algorithm again. Recall that it writes 26788.2 on the screen. For our machine-language program, we had to further specify each step in this module. Because the assembly language allows us to directly specify the character to be output, this module is concrete if we use assembly
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: language rather than machine language. Each step in this module can be coded directly. Assembly language allows us to add a comment beside the instruction. A comment is text written for the human reader of the program that explains what is happening. Comments are an essential part of writing any program. The assembler ignores everything from the semi-colon through the end of the line. Here is our assembly language program with appropriate comments. R6" R#/6/,i ; utput 6 R6" R#/7/,i ; utput 7 R6" R#/8/,i ; utput 8 R6" R#/8/,i ; utput 8 R6" R#/./,i ; utput . ST P *)ND Write Hello Write H Write e Write l Write l Write o Write Hello...
View Full Document

This note was uploaded on 01/13/2011 for the course CSE 1550 taught by Professor Marianakant during the Fall '10 term at York University.

Ask a homework question - tutors are online