LC-3 Changes, Dec 1

  • Fixed JSRR BASE
  • Added .STRINGC

Fixed JSRR BASE

In [1]:
.ORIG x3000
    LEA R2, HERE
    JSRR R2
    HALT
HERE:
    RET
.END
Assembled! Use %dis or %dump to examine.
In [2]:
%dis
============================================================
Memory disassembled:
============================================================
           x3000: xE402  LEA R2, HERE                              [line: 1]
           x3001: x4080  JSRR R2                                   [line: 2]
           x3002: xF025  HALT                                      [line: 3]
HERE:      x3003: xC1C0  RET                                       [line: 5]
In [3]:
%exe
============================================================
Computation completed
============================================================
Instructions: 4
Cycles: 28 (0.000014 milliseconds)

============================================================
Registers:
============================================================
PC: x048E
N: 0 Z: 0 P: 1 
R0: x0000 R1: x0000 R2: x3003 R3: x0000 
R4: x0000 R5: x0000 R6: x0000 R7: x3003 

.STRINGC

In [4]:
.ORIG x3000
      .FILL #1
DATA: .STRINGZ "a"
      .FILL #2
.END
Assembled! Use %dis or %dump to examine.
In [5]:
%dump
============================================================
Memory dump:
============================================================
           x3000: x0001
           x3001: x0061
           x3002: x0000
           x3003: x0002
In [6]:
.ORIG x3000
      .FILL #1
DATA: .STRINGC "a"
      .FILL #2
.END
Assembled! Use %dis or %dump to examine.
In [7]:
%dump
============================================================
Memory dump:
============================================================
           x3000: x0001
           x3001: x0061
           x3002: x0000
           x3003: x0002
           x3004: x0000
In [8]:
.ORIG x3000
      .FILL #1
DATA: .STRINGZ "ab"
      .FILL #2
.END
Assembled! Use %dis or %dump to examine.
In [9]:
%dump
============================================================
Memory dump:
============================================================
           x3000: x0001
           x3001: x0061
           x3002: x0062
           x3003: x0000
           x3004: x0002
In [10]:
.ORIG x3000
      .FILL #1
DATA: .STRINGC "ab"
      .FILL #2
.END
Assembled! Use %dis or %dump to examine.
In [11]:
%dump
============================================================
Memory dump:
============================================================
           x3000: x0001
           x3001: x6261
           x3002: x0000
           x3003: x0002
           x3004: x0002
           x3005: x0000
In [12]:
.ORIG x3000
      LEA R0, DATA
      PUTSP
      HALT
DATA: .STRINGC "abcdefg"
.END
Assembled! Use %dis or %dump to examine.
In [13]:
%dump x3000 x3008
============================================================
Memory dump:
============================================================
           x3000: xE002
           x3001: xF024
           x3002: xF025
           x3003: x6261
           x3004: x6463
           x3005: x6665
           x3006: x0067
           x3007: x0000
           x3008: x0000
In [14]:
%exe
abcdefg============================================================
Computation completed
============================================================
Instructions: 304
Cycles: 2047 (0.001024 milliseconds)

============================================================
Registers:
============================================================
PC: x048E
N: 0 Z: 0 P: 1 
R0: x3003 R1: x0000 R2: x0000 R3: x0000 
R4: x0000 R5: x0000 R6: x0000 R7: x3003