;; ;; Author: Bill Slough ;; ;; MAT 3670 ;; ;; A first assembly-language LC-3 program ;; ;; This is a variation on the world-famous "Hello, world" program ;; known to many programmers. ;; ;; Notes: ;; 1. HALT is equivalent to TRAP x25 (see Table A.2, page 543) ;; 2. PUTS is equivalent to TRAP x22 ;; 3. LEA (Load Effective Address) uses the IMMEDIATE addressing mode ;; 4. \n represents the "newline" character .ORIG x3000 ; specify the "origin"; i.e., where to load in memory LEA R0,HELLO ; R0 = address of output string PUTS ; write("Hello, world!\n") LEA R0,COURSE ; R0 = address of output string PUTS ; write("MAT 3670") LEA R0,UNIV ; R0 = address of output string PUTS ; write("EIU") HALT ; HELLO .STRINGZ "Hello, world!\n" COURSE .STRINGZ "MAT 3670\n" UNIV .STRINGZ "EIU\n" .END