Presentation is loading. Please wait.

Presentation is loading. Please wait.

Https://schweigi.github.io/assembler-simulator/ Some Assembly https://schweigi.github.io/assembler-simulator/

Similar presentations


Presentation on theme: "Https://schweigi.github.io/assembler-simulator/ Some Assembly https://schweigi.github.io/assembler-simulator/"— Presentation transcript:

1 https://schweigi.github.io/assembler-simulator/
Some Assembly

2 Before “assembling”

3 Registers This design as four registers labeled A through D. (Recall when we dealt with microcode we had Accumulator and TMP.)

4 IP – when we did microcode we had a PC (program counter) and a MAR (memory address register). Since we are not breaking the steps down as much in assembly we just have IP (instruction pointer).

5 SP – Stack Pointer – recall that the stack obeys the LIFO protocol and can only be accesses at the top. The red arrow indicates the direction in which the stack will grow.

6 Memory-mapped output The memory locations just after the initial position of the Stack Pointer are “mapped” onto output. If this example they will display the character corresponding to the ASCII code

7 Flags The results of comparisons and perhaps issues such as whether or not overflow occurred will be found in the flags.

8 RAM Random Access Memory is memory that you read or write by supplying its address. A memory location is a byte (8 bits) – which corresponds to two hexadecimal characters

9 Shown are 16*16=256=28 memory locations.
RAM Shown are 16*16=256=28 memory locations. The address is 8 bits. Also two hexadecimal characters. The first will indicate the column. The second will indicate the row. A B C D E F 1 2 3 4 5 6 7 8 9 A B C D E F

10 When you first click on Step, the assembly program is converted to machine code and loaded into memory. And the first instruction JMP start was executed

11 The assembly program had labels that get mapped onto certain memory location when the program is put into machine code

12 ASCII Code (into Hex) H – 48 e – 65 l – 6C o – 6F – 20 W – 57 r – 72
! – 21 (end of string)

13 H e l l o W o r l d !

14 JMP start (and comments)
The label “start” got mapped onto the memory location 0F The JMP instruction changed the value of the IP to 0F so we are now pointing at the instruction there This gave us some room to declare our variable string (“Hello World!”) As you have probably guessed by now the semi-colon denotes that the rest of the line is a comment

15 Move C, hello Takes the label hello which corresponds to memory location 02 and places it in register C The IP is then incremented to the next instruction location which is 12

16 Move D, 232 Takes the number 232 (E8) and places it in register D. (E8 corresponds to the memory-mapped output.) The IP is then incremented to the next instruction location which is 15


Download ppt "Https://schweigi.github.io/assembler-simulator/ Some Assembly https://schweigi.github.io/assembler-simulator/"

Similar presentations


Ads by Google