![]() |
Jupyter at Bryn Mawr College |
|
|
Public notebooks: /services/public/dblank / CS240 Computer Organization / 2017-Fall / Notebooks |
Programming Constructs:
But that can be tedious if you need to step through 10,000 instructions. Therefore, we introduce the idea of a breakpoint.
%help - shows the following:
%bp [clear | SUSPENDHEX] - show, clear, or set breakpoints
%cont - continue running
%dis [STARTHEX [STOPHEX]] - dump memory as program
%dump [STARTHEX [STOPHEX]] - list memory in hex
%exe - execute the program
%mem HEXLOCATION HEXVALUE - set memory
%pc HEXVALUE - set PC
%reg REG HEXVALUE - set register REG to HEXVALUE
%regs - show registers
%reset - reset LC3 to start state
%step - execute the next instruction, increment PC
%bp
.ORIG x3100
0000 0000 0000 0001
0000 0000 0000 0010
1000 0000 0000 0100
0000 0000 0000 0101
0000 0000 0000 1000
0000 0000 0001 0000
0000 0000 0010 0000
0000 0000 0100 0000
0000 0000 1000 0000
0000 0001 0000 0000
.END
The program from Figure 6.7:
.ORIG x3000
0101000000100000
0001000000100001
0101001001100000
0001001001111011
0101011011100000
0001011011101010
0010100000001001
0110010100000000
0001010010000001
0000010000000101
0001100100100001
0001011011111111
0110010100000000
0000001111111010
0101000000100000
1111000000100101
0011000100000000
.END
%exe
%bp x300D
%exe
%cont
%cont
%bp clear
%cont