Posts

Showing posts from May, 2018

All 0s and 1s pt.2

Last week, I wrote a blogpost that probably didn't make a lot of sense. "I don't really understand the programming, but from your description I can definitely follow the process behind making the poem." - Anonymous "I don't know how the LC-3 assembly language works..." - Anonymous "I thought it was an interesting choice to include all the coding that you did even though I didn't understand any of it." - Anonymous I tried to put forth a whole bunch of code without much explaining. While the comments to the code were there, there was obviously still a lot of confusion regarding the code and the decision to include that mess.  In this blogpost, I want to explain the code in a form of a poem :) **Also I made some edits to the code realizing that there were some bugs** .ORIG x3000 LEA R1,FONT_DATA ;Load the information the program wants to access LD R2,ZERO ;Character to print when program finds zeros in memory address LDR R

All 0s and 1s

Image
;MATTHEW JIN ;The actual poem is at the bottom of the page .ORIG x3000 LEA R1,FONT_DATA ;load output string's address LD R2,ZERO ;location x5000 stored LDR R2,R2,#0 ;character to be printed for 0 bits stored LD R3,ONE ;location x5001 stored LDR R3,R3,#0 ;character to be printed for 1 bits stored LD R4,INPUT ;location x5002 stored LDR R4,R4,#0 ;The ASCII character to be printed stored LD R6,FOUR ;Load register 6 with x0004 to serve as counter ;Multiply the value in R4 by 16 so that program can add the result to ;FONT_DATA to find ASCII character to be printed NEXT ADD R4,R4,R4 ;double the value in register 4 ADD R6,R6,#-1 ;decrement R6 BRp NEXT ADD R5,R5,#0 BRz ROW LABEL ADD R1,R1,R4 ;Add R4 to R1 to get to location of character ADD R5,R5,#0 BRzp NEXTLINE ADD R5,R5,#0 BRp NEW_ROW ROW ADD R5,R5,#15 ;row counter set to 15 NEW_ROW ADD R5,R5,#0 BRn DONE ;if row counter is negative, go to DONE NEW_CHA

Visual explication of "Envy" by Mary Lamb

Image
Envy BY MARY LAMB This rose-tree is not made to bear  The violet blue, nor lily fair,     Nor the sweet mignionet:  And if this tree were discontent,  Or wished to change its natural bent,     It all in vain would fret.  And should it fret, you would suppose  It ne’er had seen its own red rose,     Nor after gentle shower  Had ever smelled its rose’s scent,  Or it could ne’er be discontent     With its own pretty flower.  Like such a blind and senseless tree  As I’ve imagined this to be,     All envious persons are:  With care and culture all may find  Some pretty flower in their own mind,     Some talent that is rare. (Victoria K.)