Lab 1 Viewing CPU and memory, programming with machine instructions and assembly instructions

Source: Internet
Author: User

Experimental tasks

(1) Using debug, the following program segments are written to the memory, executed one at a time, observing the changes in the contents of the relevant registers in the CPU after each instruction execution.

  Machine code Assembly Instructions          

  B8 4e mov ax,4e20h         

Add ax,1416h

BB XX mov bx,2000h

D8 Add Ax,bx

C3 mov Bx,ax

D8 Add Ax,bx

B8 1a mov Ax,001ah

BB-XX mov bx,0026h

XX D8 Add Al,bl


XX C7 Add Bh,al

B4 XX mov ah,0

XX D8 Add Al,bl

9c Add al,9ch

(2) The following 3 instructions are written to the memory unit starting from 2000:0, and the 3 instructions are used to calculate 2 of the 8 parties.

  MOV ax,1

Add Ax,ax

JMP 2000,0003

The ax=0100 is 2 of the 8-square (256 of the 16 binary is 100H).

(3) View the contents in memory.

The ROM on the motherboard of the PC is written with a production date, in a few units of memory FFF00H~FFFFFH, please find this production date and try to change it.

The attempt to modify failed because ROM is read-only memory.

(4) Fill in the data in the memory unit starting with b8100h, such as:

-e b810:0000 01 01 02 02 03 03 04 04

Please fill in the different data first, observe the phenomenon, and then change the address to observe the phenomenon.

After filling in the data, a color pattern appears in the upper right corner of the screen.

After filling in different data, the pattern changed.

When you change the address, the same pattern appears in other places on the screen.

Summary and experience

Through this experiment, I realized the different of the assembly language and other high-level languages more intuitively, and understood the specific usage of the commands such as R,d,a,t,e.

But I still have some unresolved, in the experiment (2) I was originally intended to use g=0000 0013 direct operation results, but the program is directly stuck, hoping to know where I went wrong of the big guy to enlighten

Lab 1 Viewing CPU and memory, programming with machine instructions and assembly instructions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.