Handout: Getting started with Pep8 Link
to Word file
Read: Ch.4 to p. 156, "Hardware." First only Accumulator
A, and IndeX register X, Program Counter PC, Instruction Register IR,
form
of instructions as instruction specifier (Opcode + possibly register +
possibly + Addressing mode) and Operand specifier (2 bytes) if any.
Next, 156-160, load, store, add, subtract.
Day 3HW: Due Day 4.
Data in memory: A. a) Repeat class
work:
Copy "Program to examine memory" below into Source window in
Pep8,
follow the Running a program instructions in the
handout.
Examine the memory.
b) Replace the ASCII to be stored with your
name.
Assemble, Load, Execute. Examine the memory. Follow the
To hand in instructions, print your result.
c) 00 48 65 6C 6C 6F 21 21 21 21 01 02
03 04 zz That's a machine language program. Do
File>New, copy it into the Object code pane.
Load it, Execute it, Single step, and examine memory.
Change the machine language program so that
the ASCII string ends in **. Write on paper from
part
b what was stored in memory by this program, address & contents(
like
figure 4.4 p. 142) in ascii where that "works," otherwise hex.
Also, type something after the zz (leave a space) and see if it loads
and executes. (It's supposed to stop loading at zz; should ignore
anything else. Does it?)
STOP ; STOP must be at the end of the instructions
for the cpu to run
.ASCII "ABC abc" ;stores character data in sequential
memory
locations
.Byte 0x5a
.byte 0x5b
.word 0x5c
.word 513
.END ;END tells assembler we're done.
(You can type stuff after .END and it will be ignored.)
;Watch A, PC, IR and opcode and operand as
you step: Note PC gives address of NEXT instruction.
IR gives instruction specifier for instruction just completed,
and opcode stuff matches.
Registers show results of instruction just completed.
Find IR contents for LDA and ASLA, turn
to binary and check that codes match book, p. 153-4
| To Sievers Home Page |
CS225-Fall06/Day3.htm
|
|