King Fahd University of Petroleum and Minerals. College of Computer Science and Engineering. Computer Engineering Department COE 205

Size: px
Start display at page:

Download "King Fahd University of Petroleum and Minerals. College of Computer Science and Engineering. Computer Engineering Department COE 205"

Transcription

1 King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department COE 205 Computer Organization and Assembly Language Lab Manual Prepared By: Mr. Kamal Chenaoua (2000/2001)

2 TABLE OF CONTENTS PREFACE... III EXPERIMENT N O INTRODUCTION TO ASSEMBLY LANGUAGE PROGRAMMING...2 EXPERIMENT N O INPUT AND OUTPUT...10 EXPERIMENT N O SEGMENTATION AND ADDRESSING MODES...17 EXPERIMENT N O INDEXING AND DATA MANIPULATION...25 EXPERIMENT N O ARITHMETIC AND LOGICAL INSTRUCTIONS...31 EXPERIMENT N O SHIFT ROTATE AND JUMP INSTRUCTIONS...38 EXPERIMENT N O SUBROUTINE HANDLING INSTRUCTIONS AND MACROS...45 EXPERIMENT N O STRING HANDLING INSTRUCTIONS...55 EXPERIMENT N O ACCESSING VIDEO MEMORY...62 EXPERIMENT N O INTERRUPTS...80 EXPERIMENT N O USING THE MOUSE...94 EXPERIMENT N O SERIAL COMMUNICATIONS II

3 King Fahad University of Petroleum and Minerals Computer Engineering Department Preface About the Manual: The lab manual was prepared during the term 982, and updated during the terms 991, 992 and 993. Some experiments have been added with respect to previous terms. The manual includes now 12 experiments. Each experiment is divided into two parts, a theoretical part that explains the theory required to carry out the experiment in a proper manner. The second part is practical; it consists of a set of programs that the student has to run to understand the functioning of the tools introduced in the first part. The student then modifies some of these programs to accomplish given tasks. Finally, the student has to write his own programs in order to show his understanding of the material given in each lab session. The first experiment is an introduction to the tools that will be used throughout the lab. Experiments 2 to 8 constitute an overall view of assembly language programming. Experiments 9 to 12 deal with video, interrupts, mouse and serial communications. Finally, a project is given at the end of the term. The experiments are organized as follows and are scheduled on a weekly basis. 1) Introduction to assembly language programming using MASM 2) Input and Output 3) Segmentation and Addressing Modes 4) Indexing and Data Manipulation 5) Logic Instructions 6) Shift Rotate and Jump Instructions 7) Subroutine Handling Instructions and Macros 8) String Handling Instructions 9) Accessing Video Memory 10) Interrupts 11) Using the Mouse 12) Serial Communications Software: The software used is the MASM 6.11 that includes a set of tools, such as a workbench, and a debugger. The software is licensed, and is available on the network of the university. Projects: The last part of the lab is dedicated to a project in which the student is required to use all knowledge he has gained in the course. The project involves understanding of the hardware a s well as software of the PC. III

4 COE 205 Lab Manual Experiment N o 1 Experiment N o 1 Introduction to Assembly Language Programming Introduction: The aim of this experiment is to introduce the student to assembly language programming, and the use of the tools that he will need throughout the lab experiments. This first experiment let the student use the DOS Debugger and the Microsoft Macro Assembler (MASM). MASM related tools are introduced; these include the Programmer s WorkBench (PWB) and CodeView (CV). Such tools are interactive means for writing linking, and debugging assembly language programs. Objectives: Overview: 1- Introduction to the Microsoft Macro Assembler (MASM) 2- General structure of an assembly language program 3- Use of the Dos Debugger program 4- Use of the PWB, and Code View (CV). 5- Introducing Data representation in assembly In general, programming of a microprocessor usually takes several iterations before the right sequence of machine code instructions is written. The process, however, is facilitated using a special program called an Assembler. The Assembler allows the user to write alphanumeric instructions, or mnemonics, called Assembly Language instructions. The Assembler, in turn, generates the desired machine instructions from the Assembly Language instructions. Assembly Language programming consists of the following steps: STEP PRODUCES 1 Editing Source File 2 Assembling Object File 3 Linking Executable File 4 Executing Results Table 1.1: Assembly Language Programming Phases COE Department 2

5 COE 205 Lab Manual Experiment N o 1 Assembling the program: The assembler is used to convert the assembly language instructions to machine code. It is used immediately after writing the Assembly Language program. The assembler starts by checking the syntax, or validity of the structure, of each instruction in the source file. If any errors are found, the assembler displays a report on these errors along with a brief explanation of their nature. However, if the program does not contain any errors, the assembler produces an object file that has the same name as the original file but with the obj extension. Linking the program: The linker is used to convert the object file to an executable file. The executable file is the final set of machine code instructions that can directly be executed by the microprocessor. It is different than the object file in the sense that it is self-contained and re-locatable. An object file may represent one segment of a long program. This segment can not operate by itself, and must be integrated with other object files representing the rest of the program, in order to produce the final self-contained executable file. In addition to the executable file, the linker can also generate a special file called the map file. This file contains information about the start, end, and the length of the stack, code, and data segments. It also lists the entry point of the program. Executing the program The executable file contains the machine language code. It can be loaded in the RAM and be executed by the microprocessor simply by typing, from the DOS prompt, the name of the file followed by the Carriage Return Key (Enter Key). If the program produces an output on the screen, or a sequence of control signals to control a piece of hardware, the effect should be noticed almost immediately. However, if the program manipulates data in memory, nothing would seem to have happened as a result of executing the program. Debugging the program The Debugger can also be used to find logical errors in the program. Even if a program does not contain syntax errors it may not produce the desired results after execution. Logical errors may be found by tracing the action of the program. Once found, the source file should be reedited to fix the problem, then re-assembled and relinked. A special program called the Debugger is designed for that purpose. The debugger allows the user to trace the action of the program, by single stepping through the program or executing the program up to a desired point, called break point. It also allows the user to inspect or change the contents of the microprocessor internal registers or the contents of any memory location. COE Department 3

6 COE 205 Lab Manual Experiment N o 1 The DOS-Debugger: The DOS Debug program is an example of a simple debugger that comes with MS- DOS. Hence, it is available on any PC. It was initially designed to give the user the capability to trace logical errors in executable files. It allows the user to take an existing executable file and unassemble it, i.e. convert it to assembly language. Also, it allows the user to write assembly language instructions directly, and then convert them to machine language. The program is simple and easy to use, but offers limited capabilities, which make it unsuitable for serious Assembly language programming. Below, are summarized the basic DOS-Debugger commands. COMMAND Assemble Compare Dump Enter Fill Go Hex Input Load Move Name Output Proceed Quit Register Search Trace Unassemble Write SYNTAX A [address] C range address D [range] E address [list] F range list G [=address] [addresses] H value1 value2 I port L [address] [drive] [first sector] [number] M range address N [pathname] [argument list] O port byte P [=address] [number] Q R [register] S range list T [=address] [value] U [range] W [address] [drive] [first sector] [number] Table 1.2: Common DOS-Debug commands MS-MASM: Microsoft s Macro Assembler (MASM) is an integrated software package written by Microsoft Corporation for professional software developers. It consists of an editor, an assembler, a linker and a debugger (CodeView). The programmer s workbench combines these four parts into a user-friendly programming environment with built in on line help. COE Department 4

7 COE 205 Lab Manual Experiment N o 1 The following are the steps used if you are to run MASM from DOS. COMMAND 1 Edit, any editor will do Name.asm 2 Masm Filename Name.obj 3 Link Filename Name.exe 4 Filename Note: Steps 2 and 3 may be done in one single command: ML filename.asm FILE NAME Name.asm and Name.obj Table 1.3: Assembly Language Programming Phases MS-PWB: The PWB allows the user to define a project that may contain one or more files. Then, the user may select and save all the necessary assembling, linking, and debugging options for that project. Once these options are set, the user need not set them again for that project. The PWB allows the user to edit, assemble, run, or debug his program without leaving the PWB environment. It also allows the user to get help on any keyword by pointing to the keyword and pressing the F1 key. Notes on the use of MS-MASM: MASM may be run under DOS environment, or through PWB. Running MASM and CodeView Debugger from the MSDOS prompt: If you don't like the integrated PWB, you might run just the necessary programs from the MSDOS prompt. Here are the steps, assuming that your program is called "proj": 1. Open a DOS window. 2. Set the PATH so that the MASM programs are available The MASM programs are on the E drive; set the path so that DOS can find them. This only needs to be done once each time you open a MSDOS prompt. set PATH=%PATH%;E:\masm611\bin; E:\masm611\binr 3. Use a Text Editor to Edit the.asm File Create your file using one of the following programs: notepad proj.asm wordpad proj.asm edit proj.asm Make sure it has a.asm ending. Also, be sure you are doing your work on the A: drive, or on the D:\WORKAREA, and not in the C:\WINDOWS directory, or other drives. 4. Run the Compiler/Linker to generate an.exe file from the.asm file ml /Fl /Zi proj.asm COE Department 5

8 COE 205 Lab Manual Experiment N o 1 Make sure you use the two switches: /Fl creates a listing (.LST) file (the letter to the right of the F is a lower-case L); /Zi makes the finished product compatible with the CodeView debugger. You'll be notified of any errors with your program, and error statements should be placed in your.lst file (proj.lst in this case). 5. Run the Program Your final program (if there were no errors in the previous step) will have a.exe ending. To just run it, type: proj If you want to use the CodeView debugger to examine the instructions, registers, etc.: cv proj This brings up the regular full-screen version of CodeView. Running MASM and CodeView PWB: The basic steps for creating, building, and debugging an assembly language program are given below. The examples given in this first session are very simple; their main purpose is to show how o uses the PWB environment. A project is a complete set of files needed to define and build an assembly language program. The source language files for your programs are, of course, part of this project, but also there are listing files, and symbol table files for debugging, and files giving directions for building your program. It is best to create a separate folder to contain the project files for each programming assignment. You should copy this folder on a floppy disk for later use. 1. Create a folder for your new project. For the first assignment, the folder name could be lab1. 2. Copy any files that are needed from your floppy disk into your folder. 3. Run PWB.EXE by double clicking on the file or its shortcut in the C:\MASM611\BIN folder. The shortcut may be copied and the copy moved to the desktop to make it easier to find the PWB. 4. Once the PWB is running (and the DOS window appears), you may create a new project using the project menu. Type the correct path to the new project folder with project name and press the set project template button. Select Runtime support: None, Project Templates: DOS:EXE, and press OK. 5. You don't have any program files to add to the project yet, so click save list when the add file window appears. 6. Under the Options menu, select build options. Select Use Debug Options. Select OK. 7. Using the Options menu:language options:masm, select Set Debug Options. Check the boxes that will create a listing file with source, machine language, and symbol table: Generate Listing File, List Generated Instructions, Include all Source Lines, CodeView Debugger. Press OK. 8. Using the Options menu:link options, select CodeView debugger, debug options. Press the additional debug options "button" and select Full map output. This will give you a link map that tells where each program component will be loaded. Select OK. COE Department 6

9 COE 205 Lab Manual Experiment N o 1 9. Select new under the file menu to get an editor window for your program. Enter the program. Save your program naming it with a.asm suffix, e.g. : P11.ASM 10. Select edit project from the project menu, and add your new assembly program into the project list. Save the list. 11. Start the debugger, running your program, by selecting debug from the Run menu. It will ask you to build your project. That is a good idea, select Rebuild All. The Assembler will assemble your code, the linker will be called, and if there are no errors, the debugger window will appear. You can then start debugging. 12. If there were any errors, select View Results, then click next error under the project menu. It will show you the line containing the error in your source program, and you can correct it at this point. 13. Continue asking to see the next error until you run out of errors. 14. Select debug from the project window to have another try. 15. Repeat this procedure until you finally get the debugger. 16. Now you can run your program. You may step through your program one line at a time by using F8 and F10, or you may select go (F5) and run it without interruption. 17. In order to watch the contents of memory change, you need to select the memory window options in the options menu (of the debugger). Check the box which requests that the memory window be continually re-evaluated. If you don't check this box, the memory window will continue to reflect memory contents just before your program started running. 18. Breakpoints may be inserted at any line of code using the set breakpoint item in the Data menu, or press F9. If go (or F5) is selected, the program will stop on any line encountered with a breakpoint that is set. 19. Selecting source window options from the window menu allows you to have mixed source lines and object code. This will allow you to compare the instructions that are actually running with the lines of source code that you provided. 20. F10 will single step through your code, but will not single step through any called subroutines (It will "step-over" the subroutine call.) The subroutine will be called correctly; it will simply not be debugged. This is handy when you are using a subroutine that has already been debugged, or when a system routine is called. 21. F8 will single "step-into" a subroutine that is called, allowing you to debug the subroutine itself. 22. You may execute down to a given instruction by right clicking on the source line, moving the cursor to the source line, and then pressing the F7 key. 23. Taking the time to add comments to your code while first entering it will save much time in the long run. It is very hard to figure out what an undocumented assembly language program is doing after even a brief intermission. Comments help you to quickly locate desired sections of code. 24. Note: On the machines at the lab, it is frequently necessary to make sure the path is set correctly for the PWB to run. Right mouse-click on the PWB shortcut icon. Select Properties, and then select the Program tab. Under Batch file, type C:\MASM611\BIN\NEW-VARS. In the lab, only the network administrator can do this procedure. COE Department 7

10 COE 205 Lab Manual Experiment N o 1 Pre Lab Work: In this experiment you will practice editing, assembling, and linking an Assembly language program. First you will type a short program, using DOS Edit, then assemble and link the program using the MASM Assembler and Linker. Second you will practice the DOS-Debugger, and compare it to MASM s CodeView. Finally, you will use MS-PWB to develop a project around your short program and practice some of the advantages of PWB. 1- Study the material given in part I of this manual. 2- Review the material related to data representation. 3- Write the attached programs and bring them on a floppy disk to the lab. Use the DOS editor or the Windows notepad. If you use a word processor, make sure that you chose the option Save As Text while saving Note: The Exit function: The following instructions terminate the program and exit to DOS. Lab Work: MOV AH, 4CH 1- Assemble, Link and Run program Use the Debugger to run your program. 3- Notice the values given by the assembler to the numbers you used in your program. Draw a table and write each value with its corresponding representation. What do you conclude? 4- Repeat the same procedure using PWB and CodeView. What do you conclude? 6- Dress a table and write the values assigned by the assembler to the values you wrote in the editor. Explain that. 5- Assemble, Link and Run program What value do you find in DX register? 7- Repeat the same procedure using PWB and CodeView. 8- Change the line: MULT1 EQU 25 By: MULT1 EQU 25H, and run the program again. What do you notice? 9- Can you explain what the program does? COE Department 8

11 COE 205 Lab Manual Experiment N o 1 ; The following lines are just comments, they may be omitted, ; However, they are very useful. ; COE 205: Lab Exp. # 1 Program # 1 ; Student Name: Student ID: Section: TITLE A simple program.model SMALL.STACK 32.CODE MOV AX,2000 MOV BX,2000H MOV CX, B MOV DX, MOV AL,'A' MOV AH,'a' MOV AX,4C00H END ; COE 205: Lab Exp. # 1 Program # 2 ; Student Name: Student ID: Section: TITLE "Our second program".model SMALL.STACK 32.DATA MULT1 EQU 25 MULT2 DW 5.CODE MOV AX,@DATA MOV DS,AX MOV AX,00 MOV BX,MULT1 MOV CX,MULT2 MULT: ADD AX,BX DEC CX JNZ MULT MOV DX,AX END MOV AX,4C00H COE Department 9

12 COE 205 Lab Manual Experiment N o 2 Introduction: Experiment N o 2 Input and Output In this experiment you will be introduced to the basic Input and Output (I/O) operations using assembly language. You will use the DOS interrupt () function calls to access the keyboard and video display. More details will also be given on the structure of an assembly language program. The following major points are discussed: - Variable declaration using: DB, DW, DD - Constant declaration using: EQU - OFFSET operator - with the functions 1, 2, 8 and 9. Objectives: 1- Demonstrate keyboard access using the DOS function calls 01, 02 and Demonstrate string display using the DOS function call Show the difference between keyboard read functions, with echo and without echo. References: Textbook: Sections 2.1, 2.2, 2.3, 2.5 and 3.3. I/O DOS Function Calls: Table 2. 1 summarizes the main I/O functions. These functions are mainly used to read a character or a string from the keyboard, which could be an input data to a program, and display characters or strings, which could be results, or an output, of a program: Function Input in Output in Effect 01H AH AL Read a character with echo on the screen. 02H, 06H AH, Character in DL No output Display a character on the screen. Note: Interrupted by Ctrl + Break 08H AH AL Read character without echo. 09H AH No output Display a string terminated by a $ sign 0AH AH Offset in DX Read a string of characters from the keyboard Table 2. 1: Simple I/O DOS function calls COE Department 10

13 COE 205 Lab Manual Experiment N o 2 DOS Display Functions: These are DOS functions 02 and 06 for a single character display, and 09 for a string display. DOS Functions 02 and 06: Both functions are identical, except that function 02 can be interrupted by a control break (Ctrl-Break), while function 06 cannot. To display a single character ASCII character at the current cursor position use the following sequence of instructions: MOV AH, 06H ;(Or: MOV AH, 02H) MOV DL, Character Code The Character Code may be the ASCII code of the character taken from the ASCII table (See Experiment 4 Table 4.1) or the character itself written between quotes. The following displays number 2 using its ASCII code: MOV AH, 06H MOV DL, 32H This code also displays 2: DOS Functions 09: MOV AH, 06H MOV DL, 2 This function is used to display a string of characters ended with a $ sign. The following code displays the string MESSAGE defined as: MESSAGE DB This is the Message to be displayed, $.CODE MOV DX, OFFSET MESSAGE MOV AH, 09H DOS Input functions: These include reading a single character, with or without echo, functions 01 and 08, and reading a whole string. COE Department 11

14 COE 205 Lab Manual Experiment N o 2 Function 01H and 08H : To read single character and have it echoed (displayed) on the screen, use the following code: MOV AH, 01H ;AL contains now the ASCII code of the character read from the ;keyboard. If the character is to be read without echo, such as reading a password, use the following code: MOV AH, 08H ;AL contains now the ASCII code of the character read Reading a String: Reading a string is accomplished by Function 0AH. DOS function 0AH will accept a string of text entered at the keyboard and copy that string into a memory buffer. DOS 0AH is invoked with DS:DX pointing to an input buffer, whose size should be at least three bytes longer than the largest input string anticipated. Before invoking DOS function 0AH, you must set the first byte of the buffer with the number of character spaces in the buffer. After returning from DOS function 0AH, the second byte of the buffer will contain a value giving the number of characters actually read form the keyboard (Table 2.2). Buffer Length Actual Length Figure 2. 1: Keyboard buffer structure Function 0AH Entry Exit Read from Keyboard AH = 0AH ; DX = address of keyboard input buffer First byte of buffer contains the size of the buffer (up to 255) Second byte of buffer contains the number of characters read. Reading operation continues until buffer full, or a carriage return (CR = 0DH) is typed. Table 2. 2: : Functions 0AH of DOS interrupt. COE Department 12

15 COE 205 Lab Manual Experiment N o 2 Example: Below is an example on the use of function 0AH, when the user enters the word hello. Input: Output: 08 XX XX XX XX XX XX XX XX XX MOV AH, 0AH ;Read from keyboard the word hello C 6C 6F 0D XX XX Empty String: COE Department 13

16 COE 205 Lab Manual Experiment N o 2 Pre Lab Work: Review the material given in experiment number 1 for the use of PWB, and CodeView. Lab Work: 1. Study the attached hand out. 2. Review the material related to data representation. 3. Write the attached programs and bring them on a floppy disc to the lab. Use the PWB or DOS editor, or even the Windows notepad, to write your programs. Note: Give meaningful names to your programs, so that you can differentiate between them easily, e.g. pgm21.asm, stands for experiment 2 program Assemble and Link program Type the program s name at the prompt to run the program. 3- What does the program do? Notice how the program handles the three different characters. 4- Assemble, Link and Run program 2 5- Replace the line: MOV DX, OFFSET MESSAGE by: LEA DX, MESSAGE Then repeat step 4, what do you notice? 6- Check with CodeView the effects of the instruction LEA and the OFFSET operator? 7- Assemble, Link and Run program 3 8- After running the program, notice here the effect of the characters 0DH and 0AH at the end of the line containing: MESSAGE. What is your conclusion? 9- Notice also the effects of the function calls 01H, 08H. 10- Write down all your conclusions. Lab Assignment: Write an assembly language program that prompts you to enter a password of 3 characters in length. The password should not be echoed to the screen. The program then displays your name and ID number on the screen. Submit your work at the end of the lab. COE Department 14

17 COE 205 Lab Manual Experiment N o 2 ; Student Name: Student ID: Section: Title Exp. 2 Prog. 1 ; This program displays the characters A B C, using function 02..MODEL SMALL.DATA X EQU B Y DB 43H.STACK 200.CODE MOV AX,@DATA MOV DS,AX MOV AH,02 ; LOAD FUNCTION 02 MOV DL, A MOV DL,X MOV DL,Y ; LOAD CHARACTER TO BE DISPLAYED ; CALL INTERRUPT 21H ; LOAD CHARACTER TO BE DISPLAYED ; CALL INTERRUPT 21H ; LOAD CHARACTER TO BE DISPLAYED ; CALL INTERRUPT 21H MOV AX,4C00H; Exit to DOS END Title Exp. 2 Prog. 2 ; This program displays a string terminated by a $ sign using function 09H..MODEL SMALL.DATA MESSAGE DB This is the message to be displayed, $.STACK 200.CODE MOV AX,@DATA MOV DS, AX MOV DX, OFFSET MESSAGE MOV AH, 09H END MOV AX, 4C00H ; Exit to DOS COE Department 15

18 COE 205 Lab Manual Experiment N o 2 ; Character input with echo, function call 01H ; Character input without echo, function call 08H Title Exp. 2 Prog. 3.MODEL SMALL.DATA MESSAGE DB Enter a character:, $ MESSAGE2 DB The character you typed is:,0dh, 0AH, $.STACK 200.CODE MOV AX,@DATA MOV DS,AX LEA DX, MESSAGE MOV AH,09H ; Display message MOV AH,02 ; Function 02H, display character MOV DL,AL ; Load character to be displayed ; LEA DX, MESSAGE MOV AH,09H MOV AH, 08H ; Function read character without echo. ; Character read is returned in AL register. No echo on the display. MOV BL,AL ;Save character read in BL register LEA DX, MESSAGE2 MOV AH,09H ;Display MESSAGE2 MOV AH,02 MOV DL,BL ; Function 02H, display character ; Load character to be displayed from BL END MOV AH,4CH ; Exit to DOS COE Department 16

19 COE 205 Lab Manual Experiment N o 3 Introduction: Experiment N o 3 Segmentation and Addressing Modes In this experiment you will be introduced to physical segmentation of the memory, and the logical segmentation of programs. You will also deal with the different addressing modes, and learn how to calculate the physical and offset addresses. Objectives: 1- Addressing modes in the 8086 processor 2- Segmentation: Physical Segments and Logical Segments. References: Textbook: - Addressing modes: section 4.3, - Segmentation: section 3.1, - Lecture notes. Addressing Modes: The following table summarizes all addressing modes used by the 8086 processor. Addressing Mode Example Source operand Assuming: DS = 1000H, BX = 0200H, SI = 0300H Type Address Generation Addres s Register MOV AX,BX Register - - Immediate MOV AX, 0F7H Immed. - - Direct MOV AX,[1234H] Mem. DS x 10H +1234H 11234H Register-Indirect MOV AX,[BX] Mem. DS x 10H +0200H 10200H Based MOVAX,[BX+06] Mem. DS x 10H +0200H H 10206H Indexed MOVAX,[SI+06] Mem. DS x 10H +0300H H 10306H Based-Indexed MOV AX,[BX+SI+06] Mem. DS x 10H +0200H +0300H H 10506H Table 3.1: Addressing modes Structure of an Assembly Language Program: An assembly language program is written according the following structure and includes the following assembler directives: COE Department 17

20 COE 205 Lab Manual Experiment N o 3 TITLE Optional: Write the Title of your program.model SMALL Assembler directive that defines the memory model to use in the program. The memory model determines the size of the code, stack and data segments of the program.stack Assembler directive that reserves a memory space for program instructions in the stack.data Assembler directive that reserves a memory space for constants and variables.code Assembler directive that defines the program instructions END Assembler directive that finishes the assembler program Each of the segments is called a logical segment. Depending on the memory, the code and data segments may be in the same or in different physical segments according to table 3.3. Memory Model TINY SMALL MEDIUM COMPACT LARGE HUGE Size of Code and Data Code and data no more than 64KB combined Code and data segments must be no more than 64KB each Code can be more than 64KB, data still limited to no more than 64KB Code limited to no more than 64KB, data can be more than 64KB Code and data can each be more than 64K, no array can be larger than 64KB Code and data can each be more than 64KB, arrays can be larger than 64KB Table 3.3: Memory Models COE Department 18

21 COE 205 Lab Manual Experiment N o 3 Stack Directive: Memory allocation: - Directive is.stack for stack segment - Should be declared even if program itself doesn't use stack needed for subroutine calling (return address) and possibly passing parameters - May be needed to temporarily save registers or variable content - Will be needed for interrupt handling while program is running - Directive is.data for data segment - All variables must be declared, and memory space for each allocated. - Data definition directive can be followed by a single value, or a list of values separated by commas - Different data definition directives for different size types of memory 1. DB - define byte (8 bits) 2. DW - define word (16 bits) 3. DD - define double word (32 bits) 4. DQ - define quad word (64 bits) Code Segment: - Directive is.code for code segment - The "program" resides here End of Program: - Directive is End - Tells assembler that this is the end of the program Note: The sequence of instructions at the beginning of a program used to assign the data segment: MOV MOV DS, AX May be replaced by the following directive:.startup which assigns both DATA and CODE segments, and hence no warning will be issued by the assembler. However, it should be noted that the program would start at address CS:0017h. The Startup directive occupies the bytes CS:0000 to CS:0017. Identically, the sequence used to terminate and exit to DOS can be replaced by the.exit directive, which has exactly the same effect. COE Department 19

22 COE 205 Lab Manual Experiment N o 3 Pre Lab Work: 1. Study the attached hand out, and review the material related to segmentation and addressing modes. 2. Write programs 3-1 and Write the program given in assignment. 4. Fill in the tables associated with the different programs. 5. Bring your work to the lab. Lab Work: 1- Assemble, Link and Run program Use CodeView Debugger to fill in the table associated with program Calculate both the effective and physical addresses of each instruction. Put the results on the given table. 4- Assemble, Link and Run program Fill in table 2, associated with program 2, in which you specify only the addressing mode, for both source and destination, for each instruction. 6- Show all tables to the instructor. 7- Submit all your work at the end of the lab session. Lab Assignment: Write a program that prompts the user to enter a string, in capital letters, of a maximum length of 20 characters. Read the string in capital letters and convert it to small letters. Then display the new string. Note: To convert a capital letter to a small one, use the following instruction: ;Read character MOV AL, character_read ADD AL, 20H ; Display character in AL register Use the following to loop through the string you just entered. Again: MOV CX, Number_of_bytes_read Start loop here ; Convert to small letters. LOOP Again COE Department 20

23 COE 205 Lab Manual Experiment N o 3 ; This program displays a string terminated by a $ sign using function 09H. TITLE Program 3-1.MODEL SMALL.STACK 200.DATA MESSAGE DB This is the message to be displayed:, $ MESSAGE2 DB The message you just entered : ;, $ BUF DB 10 ; Number of characters to be read DB 10 DUP(?); Reserve 10 bytes for string.code MOV AX,@DATA MOV DS,AX LEA DX,MESSAGE MOV AH,09H MOV AH, 0AH MOV DX, OFFSET BUF LEA DX,MESSAGE2 MOV AH,09H LEA DX, BUF MOV AH,09H END MOV AX,4C00H COE Department 21

24 COE 205 Lab Manual Experiment N o 3 TITLE PROGRAM 2 EXPERIMENT 3 ; This program displays a message and reads a new message from the keyboard.model SMALL.STACK 200.DATA CRLF DB 0DH,0AH,'$' PROMPT DB 'Enter a name of max. length 30 char.: ',0DH,0AH,'$' STRING1 DB 'Mr. ','$' STRING2 DB ' studies 8086 programming. ','$' ; Allocate 32 bytes for BUFFER, and put the value 31 in the second byte. BUFFER DB 31,32 DUP(?).CODE.STARTUP LEA DX,PROMPT MOV AH,09H MOV AH,0AH LEA DX, BUFFER LEA DX, CRLF MOV AH,09H LEA DX,STRING1 MOV AH,09H ;This directive initializes the DS and CS segments. ;display prompt ;read into buffer ;move cursor to next line ;display string1 ;now display the buffer i.e. what has been read. MOV AH,09H MOV BH,00H MOV BL,BUFFER[1] MOV BUFFER[BX+2],'$' LEA DX,BUFFER[2] LEA DX,STRING2 MOV AH,09H LEA DX, CRLF MOV AH,09H ;move in BL buffer length ;put a $ sign at the end of buf ;load actual length of buffer ;display string2 ;move cursor to next line END MOV AH, 02H ; display number of characters read if less than 10 MOV DL,BUFFER[1] ; read second byte of buffer ADD DL, 30H ; convert to number MOV AX,4C00H COE Department 22

25 COE 205 Lab Manual Experiment N o 3 COE 205 Experiment 3, Program #1: Section: Student Name: Date: Student ID: Instruction MOV AX,@DATA MOV DS,AX Address/ Register Source Destination Addressing Mode Content Address/ Contents Register Before After LEA DX,MESSAGE MOV AH,09H Before, IP = After, IP = MOV AH, 0AH MOV DX, OFFSET BUF Before IP = After IP = LEA DX,MESSAGE2 MOV AH,09H Before IP = After IP = LEA DX, BUF MOV AH,09H Before IP = After IP = MOV AX,4C00H S k i p COE Department 23

26 COE 205 Lab Manual Experiment N o 3 COE 205 Experiment 3, Program #2: Section: Student Name: Date: Student ID: Instructions LEA DX,PROMPT MOV AH,09H MOV AH,0AH LEA DX, BUFFER LEA DX, CRLF MOV AH,09H LEA DX,STRING1 MOV AH,09H MOV AH,09H MOV BH,00H MOV BL,BUFFER[1] MOV BUFFER[BX+2],'$' LEA DX,BUFFER[2] LEA DX,STRING2 MOV AH,09H LEA DX, CRLF MOV AH,09H MOV AH, 02H MOV DL,BUFFER[1] ADD DL, 30H MOV AX,4C00H Source Addressing Modes Destination COE Department 24

27 COE 205 Lab Manual Experiment N o 4 Introduction: Experiment N o 4 Indexing and Data Manipulation In this experiment you will be introduced to data transfer and arithmetic instructions. You will also deal with indexing, and array manipulation. Objectives: References: Textbook: 1- Basic arithmetic instructions 2- Use of the ASCII table. 3- Manipulation of arrays - Sections 3.1 and 3.2, - Lecture notes. ASCII code Table: The ASCII table is a double entry table, which contains all alphanumeric characters and symbols. Each symbol, or character, has its own ASCII code. This code can either be in decimal or hexadecimal format. The code of a given character is found by concatenating the column number with the row number, if the code is to be expressed in hexadecimal. The row number is to be the least significant. For the same code to be expressed in decimal, the row number is added to the column number (See example given below). As an example, the symbol $ is at the intersection of row 4 and column 2, therefore its ASCII code is 24H. The decimal equivalent of this code can be found by adding 4 to 32, which yields 36. The following tables show the ASCII codes (Table 4.1), and examples on the use of the ASCII table (Table 4.2), and how to calculate the ASCII codes for different characters and symbols. COE Department 25

28 COE 205 Lab Manual Experiment N o 4 Table 4.1: ASCII Table Character Column # Row # Code (H) Code (10) a = 97 A = 65 β E 1 E = 225 % = 37 Table 4.2: Examples on the use of the ASCII table: Note on the use of arrays: The DB and DW directives are respectively used to declare a variable of size byte or word. The following declaration defines a variable X of size byte and assigns it the value 10H. X DB 10H Identically the following will define a variable of size word, and assigns it the value 13EFH: Y DW 13EFH COE Department 26

29 COE 205 Lab Manual Experiment N o 4 The DUP directive may be used to reserve more than one consecutive data item and initialize reserved items to the same value. For example, the instruction: ByteArray DB 100 DUP(0) Instructs the assembler to reserve an array of 100 bytes, and initializes each byte to the value zero. If the 0 in the above declaration is replaced with?, the assembler will not initialize the bytes of the array to any value. To access the different elements of an array, we use one of the following addressing modes (See Experiment # 3). - Based addressing mode. - Indexed addressing mode. - Based-Indexed addressing mode. The Based-Indexed addressing mode may be used to access a two-dimensional array. Here are examples of each case. Based addressing mode: Indexed addressing mode: Array1 DB 0,1,2,3,4,5,6,7,8,9 Array2 DB 10 DUP(0) Array3 DB 11,12,13,21,22,23,31,32,33 RowSize EQU 3 MOV BX, OFFSET Array1 ; Address Array1 MOV AL,[BX+4] ; Access 5 th element of Array1 MOV DI, OFFSET Array2 MOV [DI+6],AL MOV SI,3 MOV Array2[SI],AL ; Address Array2 ; Copy to 7 th element of Array2 ;Copy to 4 th element of Array2 Based-Indexed addressing mode: MOV BX, OFFSET Array3 ; Address Array3 MOV SI,1*RowSize ; Beginning of 2 nd row MOV DI,2*RowSize ; Beginning of 3 rd row MOV AL, [BX+SI+1] ; Access 2 nd element of 2 nd row MOV [BX+DI+2],AL ; Access 3 rd element of 3 rd row Remark: Notice that row R, has index (R-1), and element n has index (n-1). COE Department 27

30 COE 205 Lab Manual Experiment N o 4 Pre Lab Work: Lab Work: 1. Study programs 4.1 and 4.2, and review the material related to indexing and data manipulation. 2. Write both programs and see how program 4.1 manipulates the variables in internal registers, and how program 4.2 uses memory for the same purpose. 3. Modify program 4.1 so that it adds two numbers of two digits each. Use only registers, and make sure to take care of the carry when adding the two most significant digits. Call this program 4.3. Note: In this case try to understand how the program reads the numbers and how it manipulates them. This will help you in writing your program. As a hint, one should know that numbers are given in decimal to the program. 4. Modify program 4.3 so that it can handle numbers of four digits. Use arrays in this case. Call this program Bring your work to the lab. 1- Assemble, Link and Run program How many digits can you enter each time? Explain this. 3- What happens when the sum exceeds 9? Explain this. 4- Assemble, Link and Run program 2. Dress a table and show some inputs and outputs. 5- Repeat step 4 with program Show all your work to the instructor. 7- Submit all your work at the end of the lab session. Lab Assignment: Write a program that prompts the user to enter two numbers of 4 digits each. Then the program calculates the quotient and remainder of the division of the two numbers. The two numbers are entered as two arrays of size four (4). COE Department 28

31 COE 205 Lab Manual Experiment N o 4 TITLE "PROGRAM 1 EXPERIMENT 4" ; This program reads two numbers from the keyboard and ; gives their sum. This program uses internal registers ; to store the variables..model SMALL.STACK 200.DATA CRLF.CODE.STARTUP DB 0DH,0AH,'$' PROMPT1 DB 'Enter the first positive integer: ','$' PROMPT2 DB 'Enter the second positive integer: ','$' PROMPT3 DB 'The sum of the two numbers is: ','$' LEA DX,PROMPT1 MOV AH,09H ;DISPLAY PROMPT1 MOV AH,01H SUB AL,30H MOV CL,AL ;READ FIRST NUMBER ;Convert character to number ;SAVE THE NUMBER IN CL LEA DX,CRLF ;MOVE CURSOR TO NEXT LINE MOV AH,09H LEA DX,PROMPT2 ;DISPLAY PROMPT2 MOV AH,09H MOV AH,01H SUB AL,30H ADD AL,CL MOV CL,AL ADD CL,30H ;READ SECOND NUMBER ;Convert character to number ;PERFORM ADDITION AND SAVE RESULT IN CL ;CONVERT DIGIT TO CHARACTER LEA DX,CRLF ;MOVE CURSOR TO NEXT LINE MOV AH,09H LEA DX,PROMPT3 ;DISPLAY PROMPT3 MOV AH,09H.EXIT END MOV DL,CL MOV AH,02H ;DISPLAY SUM COE Department 29

32 COE 205 Lab Manual Experiment N o 4 TITLE "PROGRAM 2 EXPERIMENT 4" ; This program reads two numbers from the keyboard and ; displays their sum. This program uses the memory to ; store the variables..model SMALL.STACK 200.DATA CRLF DB 0DH,0AH,'$' PROMPT1 DB 'Enter the first positive integer: ','$' PROMPT2 DB 'Enter the second positive integer: ','$'.CODE.STARTUP.EXIT END PROMPT3 NUM1 DB? NUM2 DB? RES DB? LEA DX,PROMPT1 MOV AH,09H MOV AH,01H DB 'The sum of the two numbers is: ','$' ;DISPLAY PROMPT1 ;READ FIRST NUMBER SUB AL,30H MOV NUM1,AL LEA DX,CRLF MOV AH,09H LEA DX,PROMPT2 ;DISPLAY PROMPT2 MOV AH,09H ;Convert character to number ;SAVE NUM1 ;MOVE CURSOR TO NEXT LINE MOV AH,01H ;READ SECOND NUMBER SUB AL,30H MOV NUM2,AL ADD AL,NUM1 MOV RES,AL LEA DX,CRLF MOV AH,09H LEA DX,PROMPT3 ;DISPLAY PROMPT3 MOV AH,09H ;DISPLAY SUM MOV DL,RES ADD DL,30H MOV AH,02H ;Convert character to number ;SAVE NUM2 ;PERFORM ADDITION ;SAVE RESULT IN RES ;MOVE CURSOR TO NEXT LINE ;RETREIVE RES FROM MEMORY ;CONVERT DIGIT TO CHARACTER COE Department 30

33 COE 205 Lab Manual Experiment N o 5 Introduction: Experiment N o 5 Arithmetic and Logical Instructions In this experiment, you will be introduced to the logic instructions of the 8086 family of processors. You will also deal with the conversion of numbers from one radix to another. Objectives: References: 1- Logic Instructions 2- Base conversion Textbook: - Section Section Lecture notes. Arithmetic Instructions: The following table (Table 4.3) summarizes the arithmetic instructions used in the 8086 microprocessor. It also shows the effect of each instruction, a brief example, and the flags affected by the instruction. The * in the table means that the corresponding flag may change as a result of executing the instruction. The - means that the corresponding flag is not affected by the instruction, whereas the? means that the flag is undefined after executing the instruction. Type Instruction Example Meaning Flags Affected OF SF ZF AF PF CF Addition ADD ADD AX,7BH AX AX + 7B * * * * * * ADC ADC AX,7BH AX AX + 7B +CF * * * * * * INC INC [BX] [BX] [BX]+1 * * * * * - DAA DAA? * * * * * Subtraction SUB SUB CL,AH CL CL AH * * * * * * SBB SBB CL,AH CL CL AH CF * * * * * * DEC DEC DAT [DAT] [DAT] 1 * * * * * - DAS DAS? * * * * * NEG NEG CX CX 0 CX * * * * * * Multiplication MUL MUL CL MUL CX AX AL * CL (DX,AX) AX* CX *???? * IMUL IMUL BYTE PTR X AX AL * [X] *???? * IMUL WORD PTR X (DX,AX) AX* [X] Division DIV DIV WORD PTR X AX Q(([DX,AX])/[X]) DX R(([DX,AX])/[X])?????? IDIV IDIV BH AL Q(AX/BH)?????? AH R(AX/BH) Sign Extension CBW CBW AH MSB(AL) CWD CWD DX MSB(AX) Table 5.1: Summary of Arithmetic Instructions of the 8086 microprocessor COE Department 31

34 COE 205 Lab Manual Experiment N o 5 Notes: The DAA (Decimal Adjust after Addition) instruction allows addition of numbers represented in 8-bit packed BCD code. It is used immediately after normal addition instruction operating on BCD codes. This instruction assumes the AL register as the source and the destination, and hence it requires no operand. The effect of DAS (Decimal Adjust after Subtraction) instruction is similar to that of DAA, except the fact that it is used after performing a subtraction. CBW and CWD are two instructions used to facilitate division of 8 and 16 bit signed numbers. Since division requires a double-width dividend, CBW converts an 8-bit signed number (in AL), to a word, where the MSB of AL register is copied to AH register. Similarly, CWD converts a 16-bit signed number to a 32-bit signed number (DX,AX). Logical Instructions: Logic shift and rotate instructions are called bit manipulation operations. These operations are designed for low-level operations, and are commonly used for lowlevel control of input/output devices. The list of the logic operations of the 8086 is given in Table 5.1, along with examples, and the effect of these operations on the flags. The * in the table means that the corresponding flag may change as a result of executing the instruction. The - means that the corresponding flag is not affected by the instruction, whereas the? means that the flag is undefined after executing the instruction. Instruction Example Meaning Flags OF SF ZF AF PF AND AND AX, FFDFH AX AX AND FFDFH 0 * *? * OR OR AL, 20H AL AL OR 20H 0 * *? * XOR XOR NUM1, FF00 [NUM1] [NUM1]XOR FF00 0 * *? * NOT NOT NUM2 [NUM2] [ NUM2] Table 5.2: Summary of the Logic Instructions of the 8086 Microprocessor The logic operations are the software analogy of logic gates. They are commonly used to separate a bit or a group of bits in a register or in a memory location, for the purpose of testing, resetting or complementing. For example, if b is the value of a certain bit in a number. The related effects of the basic operations on a single bit are indicated in Table 5.3: COE Department 32

35 COE 205 Lab Manual Experiment N o 5 Operation Effect b AND 0 = 0 Reset the bit b OR 1 = 1 Set the bit b XOR 1 = b Complement the bit b XOR 0 = b - Table 5.3: Effects on bits of the basic logic instructions Byte manipulations for reading and displaying purposes: 1 / To put two decimal digits into the same byte use the following: MOV AH, 01H SUB AL, 30H MOV CH, AL ; Read high digit e.g. 8 MOV AH, 01H SUB AL, 30H MOV CL, AL ; Read low digit e.g. 3 MOV AL, 10000B ; Use MUL by 10000B to shift left by 4 bits MUL CH ; Shift AL 4 bits to the left XOR AH, AH ; Clear AH OR AL, CL ; Result in AL 83 If we want to perform addition: ; If AL contains the first number in BCD format ; and CL contains the second number in BCD format ADD AL, CL DAA ; Decimal adjust ; New result in AL in BCD format MOV CL, AL ; Number in CL register. See next how to display it as decimal number. 2 / To display a number in BCD format use the following: ; The number is in the CL register: MOV AL, CL ; Move CL to AL XOR AH, AH ; Clear AH MOV BL, 10000B DIV BL ; Shift AX 4 bits to the right AND AL, 0FH ; Clear 4 high nibbles of AL ADD AL, 30H ; Convert to character COE Department 33

36 COE 205 Lab Manual Experiment N o 5 ; Now Display AL as high digit first MOV AL, CL ; Read number again AND AL, 0FH ; Clear 4 high nibbles of AL ADD AL, 30H ; Convert to character ; Now Display AL as low digit second Displaying Data in any Number Base r: The basic idea behind displaying data in any number base is division. If a binary number is divided by 10, and the remainder of the division is saved as a significant digit in the result, the remainder must be a number between zero and nine. On the other hand, if a number is divided by the radix r, the remainder must be a number between zero and (r-1). Because of this, the resultant remainder will be a different number base than the input which is base 2. To convert from binary to any other base, use the following algorithm. Algorithm: 1. Divide the number to be converted by the desired radix (number base r). 2. Save the remainder as a significant digit of the result. 3. Repeat steps 1 and 2 until the resulting quotient is zero. 4. Display the remainders as digits of the result. Note that the first remainder is the least significant digit, while the last remainder is the most significant one. COE Department 34

37 COE 205 Lab Manual Experiment N o 5 Pre Lab Work: 1. Study program 5.2, and explain how base conversion is performed? 2. Write, assemble and link program 5.1. You will run it in the lab using CodeView. 3. Write, assemble, link and run program Modify the program so that it prompts the user for the RADIX and the number NUM to be converted. Call the new program prog Write a program that converts from decimal to hexadecimal. Name it Prog Bring your work to the lab. Lab Work: 1- Use CodeView to trace program 5.1. Fill in table 5.3. Notice any changes in the status flags, and explain them. 2- Run program 5.2, and see what value is displayed. 3- Change the value of the variable NUM and see the output value. 4- Now change the value of RADIX and see the value displayed. 5- Write a program that prompts the user to enter two numbers of 4 digits each. Converts these numbers to hexadecimal. Then calculates the sum, the difference of the two numbers, and finally displays the result in decimal format. Name it program Show all your work to the instructor. 7- Submit all your work at the end of the lab session. Lab Assignment: Write a program that reads two binary numbers of 8 digits each, stores them inside the internal registers. Multiply the two numbers using a simple MUL operation, and display the result in decimal format. To ease bit manipulation and shifting, use division and multiplication by 2, to perform right shift and left shift. COE Department 35

38 COE 205 Lab Manual Experiment N o 5 TITLE Program 5.1: Logic Instructions ; This program shows the effect of the logic instructions.model SMALL.STACK 200.DATA NUM1 DW.CODE.STARTUP NUM2 DB 0FA62H 94H.EXIT END MOV AX, NUM1 ;load AX with number NUM1 AND AX, 0FFDFH ;Reset 6 th bit of AX OR AL, 20H ;Set 6 th bit of AL XOR NUM1, 0FF00H ;Complement the high order byte of ; NUM1 NOT NUM2 ;Complement NUM2 XOR AX, AX ;Clear AX MOV AX, NUM1 AND AX, 0008H ; Isolate bit 4 of NUM1 XOR AX, 0080H ;Complement 4 th bit of AX Fill in table 5.3 while running the above program using CodeView. Statement 1. MOV AX, NUM1 2. AND AX, 0FFDFH 3. OR AL, 20H 4. XOR NUM1, 0FF00H 5. NOT NUM2 6. XOR AX, AX 7. MOV AX, NUM1 8. AND AX, 0008H 9. XOR AX, 0080H Destination Content Before After O F D F Status Flags I F S F Z F A F P F C F Table 5.4: Effects of Executing Program 5.1 COE Department 36

39 COE 205 Lab Manual Experiment N o 5 TITLE Lab Exp. # 5 Program # 5.2 ; This program converts a number NUM from Hexadecimal, ; to a new numbering base (RADIX)..MODEL SMALL.STACK 200.DATA RADIX DB 10 ;radix: 10 for decimal NUM DW 0EFE4H ;the number to be converted ;put here any other number. ;Note that: 0EFE4H = TEMP DB 10 DUP(?) ;Used to simulate a stack.code.startup MOV AX, NUM ;load AX with number NUM ;display AX in decimal MOV CX, 0 ;clear digit counter XOR BH, BH ;clear BH MOV BL, RADIX ;set for decimal XOR SI, SI ;Clear SI register DISPX1: MOV DX, 00 ;clear DX DIV BX ;divide DX:AX by 10 MOV TEMP[SI], DL ;save remainder INC SI INC CX ;count remainder OR AX, AX ;test for quotient of zero JNZ DISPX1 ;if quotient is not zero DEC SI DISPX2: MOV DL, TEMP[SI] ;get remainder MOV AH, 06H ;select function 06H ADD DL, 30H ;convert to ASCII ;display digit DEC SI DEC CX ;repeat for all digits JNZ DISPX2.EXIT ;exit to dos END COE Department 37

8. MACROS, Modules, and Mouse

8. MACROS, Modules, and Mouse 8. MACROS, Modules, and Mouse Background Macros, Modules and the Mouse is a combination of concepts that will introduce you to modular programming while learning how to interface with the mouse. Macros

More information

Faculty of Engineering Student Number:

Faculty of Engineering Student Number: Philadelphia University Student Name: Faculty of Engineering Student Number: Dept. of Computer Engineering Final Exam, First Semester: 2012/2013 Course Title: Microprocessors Date: 17/01//2013 Course No:

More information

BCD (ASCII) Arithmetic. Where and Why is BCD used? Packed BCD, ASCII, Unpacked BCD. BCD Adjustment Instructions AAA. Example

BCD (ASCII) Arithmetic. Where and Why is BCD used? Packed BCD, ASCII, Unpacked BCD. BCD Adjustment Instructions AAA. Example BCD (ASCII) Arithmetic We will first look at unpacked BCD which means strings that look like '4567'. Bytes then look like 34h 35h 36h 37h OR: 04h 05h 06h 07h x86 processors also have instructions for packed

More information

How To Use A Computer With A Screen On It (For A Powerbook)

How To Use A Computer With A Screen On It (For A Powerbook) page 44,100 TITLE ASMXMPLE Video equ 10h ;video functions interrupt number Keyboard equ 16h ;keyboard functions interrupt number DOS equ 21h ;call DOS interrupt number PrtSc equ 5h ;Print Screen Bios interrupt

More information

Complete 8086 instruction set

Complete 8086 instruction set Page 1 of 53 Complete 8086 instruction set Quick reference: AAA AAD AAM AAS ADC ADD AND CALL CBW CLC CLD CLI CMC CMP CMPSB CMPSW CWD DAA DAS DEC DIV HLT IDIV IMUL IN INC INT INTO I JA JAE JB JBE JC JCXZ

More information

ASCII and BCD Arithmetic. Chapter 11 S. Dandamudi

ASCII and BCD Arithmetic. Chapter 11 S. Dandamudi ASCII and BCD Arithmetic Chapter 11 S. Dandamudi Outline Representation of Numbers ASCII representation BCD representation» Unpacked BCD» Packed BCD Processing ASCII numbers» ASCII addition» ASCII subtraction»

More information

INTRODUCTION TO PROGRAMMING THE 8086

INTRODUCTION TO PROGRAMMING THE 8086 SAMPLE HELLO WORLD PROGRAM The following example shows a program that displays the traditional Hello, world! message on the screen. It contains the essential ingredients of an assembly language application.

More information

Quick Start Tutorial. Using the TASKING* Software Development Tools with the Intel 8x930 Family Evaluation Board

Quick Start Tutorial. Using the TASKING* Software Development Tools with the Intel 8x930 Family Evaluation Board Quick Start Tutorial Using the TASKING* Software Development Tools with the Intel 8x930 Family Evaluation Board This explains how to use the TASKING Microsoft* Windows*-based software development tools

More information

2011, The McGraw-Hill Companies, Inc. Chapter 3

2011, The McGraw-Hill Companies, Inc. Chapter 3 Chapter 3 3.1 Decimal System The radix or base of a number system determines the total number of different symbols or digits used by that system. The decimal system has a base of 10 with the digits 0 through

More information

Unpacked BCD Arithmetic. BCD (ASCII) Arithmetic. Where and Why is BCD used? From the SQL Server Manual. Packed BCD, ASCII, Unpacked BCD

Unpacked BCD Arithmetic. BCD (ASCII) Arithmetic. Where and Why is BCD used? From the SQL Server Manual. Packed BCD, ASCII, Unpacked BCD BCD (ASCII) Arithmetic The Intel Instruction set can handle both packed (two digits per byte) and unpacked BCD (one decimal digit per byte) We will first look at unpacked BCD Unpacked BCD can be either

More information

ASSEMBLY PROGRAMMING ON A VIRTUAL COMPUTER

ASSEMBLY PROGRAMMING ON A VIRTUAL COMPUTER ASSEMBLY PROGRAMMING ON A VIRTUAL COMPUTER Pierre A. von Kaenel Mathematics and Computer Science Department Skidmore College Saratoga Springs, NY 12866 (518) 580-5292 pvonk@skidmore.edu ABSTRACT This paper

More information

Appendix C: Keyboard Scan Codes

Appendix C: Keyboard Scan Codes Thi d t t d ith F M k 4 0 2 Appendix C: Keyboard Scan Codes Table 90: PC Keyboard Scan Codes (in hex) Key Down Up Key Down Up Key Down Up Key Down Up Esc 1 81 [ { 1A 9A, < 33 B3 center 4C CC 1! 2 82 ]

More information

================================================================

================================================================ ==== ==== ================================================================ DR 6502 AER 201S Engineering Design 6502 Execution Simulator ================================================================

More information

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC6504 - Microprocessor & Microcontroller Year/Sem : II/IV

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC6504 - Microprocessor & Microcontroller Year/Sem : II/IV DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC6504 - Microprocessor & Microcontroller Year/Sem : II/IV UNIT I THE 8086 MICROPROCESSOR 1. What is the purpose of segment registers

More information

Hardware and Software Requirements

Hardware and Software Requirements C Compiler Real-Time OS Simulator Training Evaluation Boards Installing and Using the Keil Monitor-51 Application Note 152 May 31, 2000, Munich, Germany by Keil Support, Keil Elektronik GmbH support.intl@keil.com

More information

Using Debug 1 INTRODUCING DEBUG

Using Debug 1 INTRODUCING DEBUG Using Debug Copyright Prentice-Hall Publishing, 1999. All rights reserved B.1 Introducing Debug B.2 Debug Command Summary Command Parameters B.3 Individual Commands? (Help) A (Assemble) C (Compare) D (Dump)

More information

Assembly Language Tutorial

Assembly Language Tutorial Assembly Language Tutorial ASSEMBLY LANGUAGE TUTORIAL by tutorialspoint.com tutorialspoint.com i ABOUT THE TUTORIAL Assembly Programming Tutorial Assembly language is a low-level programming language for

More information

Assembly Language Programming

Assembly Language Programming Assembly Language Programming Assemblers were the first programs to assist in programming. The idea of the assembler is simple: represent each computer instruction with an acronym (group of letters). Eg:

More information

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc. SKP16C62P Tutorial 1 Software Development Process using HEW Renesas Technology America Inc. 1 Overview The following tutorial is a brief introduction on how to develop and debug programs using HEW (Highperformance

More information

The string of digits 101101 in the binary number system represents the quantity

The string of digits 101101 in the binary number system represents the quantity Data Representation Section 3.1 Data Types Registers contain either data or control information Control information is a bit or group of bits used to specify the sequence of command signals needed for

More information

3. Programming the STM32F4-Discovery

3. Programming the STM32F4-Discovery 1 3. Programming the STM32F4-Discovery The programming environment including the settings for compiling and programming are described. 3.1. Hardware - The programming interface A program for a microcontroller

More information

Introduction to Microcontrollers

Introduction to Microcontrollers Introduction to Microcontrollers Motorola M68HC11 Specs Assembly Programming Language BUFFALO Topics of Discussion Microcontrollers M68HC11 Package & Pinouts Accumulators Index Registers Special Registers

More information

Informatica e Sistemi in Tempo Reale

Informatica e Sistemi in Tempo Reale Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)

More information

MICROPROCESSOR AND MICROCOMPUTER BASICS

MICROPROCESSOR AND MICROCOMPUTER BASICS Introduction MICROPROCESSOR AND MICROCOMPUTER BASICS At present there are many types and sizes of computers available. These computers are designed and constructed based on digital and Integrated Circuit

More information

Memory Management Simulation Interactive Lab

Memory Management Simulation Interactive Lab Memory Management Simulation Interactive Lab The purpose of this lab is to help you to understand deadlock. We will use a MOSS simulator for this. The instructions for this lab are for a computer running

More information

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer About the Tutorial Assembly language is a low-level programming language for a computer or other programmable device specific to a particular computer architecture in contrast to most high-level programming

More information

Z80 Instruction Set. Z80 Assembly Language

Z80 Instruction Set. Z80 Assembly Language 75 Z80 Assembly Language The assembly language allows the user to write a program without concern for memory addresses or machine instruction formats. It uses symbolic addresses to identify memory locations

More information

Lecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com

Lecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com CSCI-UA.0201-003 Computer Systems Organization Lecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com Some slides adapted (and slightly modified)

More information

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory. 1 Topics Machine Architecture and Number Systems Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number System Converting from Decimal to Binary Major Computer Components

More information

The 80x86 Instruction Set

The 80x86 Instruction Set Thi d t t d ith F M k 4 0 2 The 80x86 Instruction Set Chapter Six Until now, there has been little discussion of the instructions available on the 80x86 microprocessor. This chapter rectifies this situation.

More information

Two's Complement Adder/Subtractor Lab L03

Two's Complement Adder/Subtractor Lab L03 Two's Complement Adder/Subtractor Lab L03 Introduction Computers are usually designed to perform indirect subtraction instead of direct subtraction. Adding -B to A is equivalent to subtracting B from A,

More information

by Kip Irvine. Last update: 12/11/2003

by Kip Irvine. Last update: 12/11/2003 Loading and Executing a Child Process by Kip Irvine. Last update: 12/11/2003 MS-DOS has always taken a fairly straightforward approach to loading and executing programs. From the start, it was designed

More information

User Manual. DG LINK Application Program 071-0056-50. www.tektronix.com. This document applies to firmware version 2.00 and above.

User Manual. DG LINK Application Program 071-0056-50. www.tektronix.com. This document applies to firmware version 2.00 and above. User Manual DG LINK Application Program 071-0056-50 This document applies to firmware version 2.00 and above. www.tektronix.com Copyright Tektronix Japan, Ltd. All rights reserved. Copyright Tektronix,

More information

A Tiny Guide to Programming in 32-bit x86 Assembly Language

A Tiny Guide to Programming in 32-bit x86 Assembly Language CS308, Spring 1999 A Tiny Guide to Programming in 32-bit x86 Assembly Language by Adam Ferrari, ferrari@virginia.edu (with changes by Alan Batson, batson@virginia.edu and Mike Lack, mnl3j@virginia.edu)

More information

Control Technology Corporation CTC Monitor User Guide Doc. No. MAN-1030A Copyright 2001 Control Technology Corporation All Rights Reserved Printed in USA The information in this document is subject to

More information

A Computer Glossary. For the New York Farm Viability Institute Computer Training Courses

A Computer Glossary. For the New York Farm Viability Institute Computer Training Courses A Computer Glossary For the New York Farm Viability Institute Computer Training Courses 2006 GLOSSARY This Glossary is primarily applicable to DOS- and Windows-based machines and applications. Address:

More information

1 Classical Universal Computer 3

1 Classical Universal Computer 3 Chapter 6: Machine Language and Assembler Christian Jacob 1 Classical Universal Computer 3 1.1 Von Neumann Architecture 3 1.2 CPU and RAM 5 1.3 Arithmetic Logical Unit (ALU) 6 1.4 Arithmetic Logical Unit

More information

MACHINE ARCHITECTURE & LANGUAGE

MACHINE ARCHITECTURE & LANGUAGE in the name of God the compassionate, the merciful notes on MACHINE ARCHITECTURE & LANGUAGE compiled by Jumong Chap. 9 Microprocessor Fundamentals A system designer should consider a microprocessor-based

More information

The Hexadecimal Number System and Memory Addressing

The Hexadecimal Number System and Memory Addressing APPENDIX C The Hexadecimal Number System and Memory Addressing U nderstanding the number system and the coding system that computers use to store data and communicate with each other is fundamental to

More information

ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6)

ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6) ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6) 1 COMPUTER LANGUAGES In order for a computer to be able to execute a program, the program must first be present

More information

Comp 255Q - 1M: Computer Organization Lab #3 - Machine Language Programs for the PDP-8

Comp 255Q - 1M: Computer Organization Lab #3 - Machine Language Programs for the PDP-8 Comp 255Q - 1M: Computer Organization Lab #3 - Machine Language Programs for the PDP-8 January 22, 2013 Name: Grade /10 Introduction: In this lab you will write, test, and execute a number of simple PDP-8

More information

CPU Organization and Assembly Language

CPU Organization and Assembly Language COS 140 Foundations of Computer Science School of Computing and Information Science University of Maine October 2, 2015 Outline 1 2 3 4 5 6 7 8 Homework and announcements Reading: Chapter 12 Homework:

More information

How to test and debug an ASP.NET application

How to test and debug an ASP.NET application Chapter 4 How to test and debug an ASP.NET application 113 4 How to test and debug an ASP.NET application If you ve done much programming, you know that testing and debugging are often the most difficult

More information

PART B QUESTIONS AND ANSWERS UNIT I

PART B QUESTIONS AND ANSWERS UNIT I PART B QUESTIONS AND ANSWERS UNIT I 1. Explain the architecture of 8085 microprocessor? Logic pin out of 8085 microprocessor Address bus: unidirectional bus, used as high order bus Data bus: bi-directional

More information

Exceptions in MIPS. know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine

Exceptions in MIPS. know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine 7 Objectives After completing this lab you will: know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine Introduction Branches and jumps provide ways to change

More information

PROBLEMS (Cap. 4 - Istruzioni macchina)

PROBLEMS (Cap. 4 - Istruzioni macchina) 98 CHAPTER 2 MACHINE INSTRUCTIONS AND PROGRAMS PROBLEMS (Cap. 4 - Istruzioni macchina) 2.1 Represent the decimal values 5, 2, 14, 10, 26, 19, 51, and 43, as signed, 7-bit numbers in the following binary

More information

How to use the VMware Workstation / Player to create an ISaGRAF (Ver. 3.55) development environment?

How to use the VMware Workstation / Player to create an ISaGRAF (Ver. 3.55) development environment? Author Janice Hong Version 1.0.0 Date Mar. 2014 Page 1/56 How to use the VMware Workstation / Player to create an ISaGRAF (Ver. 3.55) development environment? Application Note The 32-bit operating system

More information

For Introduction to Java Programming, 5E By Y. Daniel Liang

For Introduction to Java Programming, 5E By Y. Daniel Liang Supplement H: NetBeans Tutorial For Introduction to Java Programming, 5E By Y. Daniel Liang This supplement covers the following topics: Getting Started with NetBeans Creating a Project Creating, Mounting,

More information

Installing, upgrading and troubleshooting your CLIO system under the Windows environment.

Installing, upgrading and troubleshooting your CLIO system under the Windows environment. Installing, upgrading and troubleshooting your CLIO system under the Windows environment. Audiomatica Srl Rev. 1.1. June 2001. Contents 1 What does this document cover?... 1 2 Windows compatibility...

More information

Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8

Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8 ECE Department Summer LECTURE #5: Number Systems EEL : Digital Logic and Computer Systems Based on lecture notes by Dr. Eric M. Schwartz Decimal Number System: -Our standard number system is base, also

More information

PCSpim Tutorial. Nathan Goulding-Hotta 2012-01-13 v0.1

PCSpim Tutorial. Nathan Goulding-Hotta 2012-01-13 v0.1 PCSpim Tutorial Nathan Goulding-Hotta 2012-01-13 v0.1 Download and install 1. Download PCSpim (file PCSpim_9.1.4.zip ) from http://sourceforge.net/projects/spimsimulator/files/ This tutorial assumes you

More information

MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1

MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1 MICROPROCESSOR A microprocessor incorporates the functions of a computer s central processing unit (CPU) on a single Integrated (IC), or at most a few integrated circuit. It is a multipurpose, programmable

More information

PC Assembly Language. Paul A. Carter

PC Assembly Language. Paul A. Carter PC Assembly Language Paul A. Carter November 20, 2001 Copyright c 2001 by Paul Carter This may be reproduced and distributed in its entirety (including this authorship, copyright and permission notice),

More information

Tips and Tricks SAGE ACCPAC INTELLIGENCE

Tips and Tricks SAGE ACCPAC INTELLIGENCE Tips and Tricks SAGE ACCPAC INTELLIGENCE 1 Table of Contents Auto e-mailing reports... 4 Automatically Running Macros... 7 Creating new Macros from Excel... 8 Compact Metadata Functionality... 9 Copying,

More information

Lab 1: Full Adder 0.0

Lab 1: Full Adder 0.0 Lab 1: Full Adder 0.0 Introduction In this lab you will design a simple digital circuit called a full adder. You will then use logic gates to draw a schematic for the circuit. Finally, you will verify

More information

CSI 333 Lecture 1 Number Systems

CSI 333 Lecture 1 Number Systems CSI 333 Lecture 1 Number Systems 1 1 / 23 Basics of Number Systems Ref: Appendix C of Deitel & Deitel. Weighted Positional Notation: 192 = 2 10 0 + 9 10 1 + 1 10 2 General: Digit sequence : d n 1 d n 2...

More information

Character Translation Methods

Character Translation Methods Supplement to: Irvine, Kip R. Assembly Language for Intel-Based Computers, 4th Edition. This file may be duplicated or printed for classroom use, as long as the author name, book title, and copyright notice

More information

1998-2002 by NetMedia, Inc. All rights reserved. Basic Express, BasicX, BX-01, BX-24 and BX-35 are trademarks of NetMedia, Inc. 2.

1998-2002 by NetMedia, Inc. All rights reserved. Basic Express, BasicX, BX-01, BX-24 and BX-35 are trademarks of NetMedia, Inc. 2. Version 2.0 1998-2002 by NetMedia, Inc. All rights reserved. Basic Express, BasicX, BX-01, BX-24 and BX-35 are trademarks of NetMedia, Inc. 2.00H 2 Contents 1. Downloader...4 2. Editor and compiler...8

More information

Visual Logic Instructions and Assignments

Visual Logic Instructions and Assignments Visual Logic Instructions and Assignments Visual Logic can be installed from the CD that accompanies our textbook. It is a nifty tool for creating program flowcharts, but that is only half of the story.

More information

Freescale Semiconductor, I

Freescale Semiconductor, I nc. Application Note 6/2002 8-Bit Software Development Kit By Jiri Ryba Introduction 8-Bit SDK Overview This application note describes the features and advantages of the 8-bit SDK (software development

More information

The x86 PC: Assembly Language, Design, and Interfacing 5 th Edition

The x86 PC: Assembly Language, Design, and Interfacing 5 th Edition Online Instructor s Manual to accompany The x86 PC: Assembly Language, Design, and Interfacing 5 th Edition Muhammad Ali Mazidi Janice Gillispie Mazidi Danny Causey Prentice Hall Boston Columbus Indianapolis

More information

13 Managing Devices. Your computer is an assembly of many components from different manufacturers. LESSON OBJECTIVES

13 Managing Devices. Your computer is an assembly of many components from different manufacturers. LESSON OBJECTIVES LESSON 13 Managing Devices OBJECTIVES After completing this lesson, you will be able to: 1. Open System Properties. 2. Use Device Manager. 3. Understand hardware profiles. 4. Set performance options. Estimated

More information

MARCH 2005. Conversion Software User Guide for Windows. Version 2.0

MARCH 2005. Conversion Software User Guide for Windows. Version 2.0 MARCH 2005 CDS Conversion Software User Guide for Windows Version 2.0 Updated: 2/24/2006 Table of Contents CDS Conversion Software V2 for Windows User Guide... 1 System Requirements... 1 Introduction...

More information

Getting Started with IntelleView POS Administrator Software

Getting Started with IntelleView POS Administrator Software Getting Started with IntelleView POS Administrator Software Administrator s Guide for Software Version 1.2 About this Guide This administrator s guide explains how to start using your IntelleView POS (IntelleView)

More information

S7 for Windows S7-300/400

S7 for Windows S7-300/400 S7 for Windows S7-300/400 A Programming System for the Siemens S7 300 / 400 PLC s IBHsoftec has an efficient and straight-forward programming system for the Simatic S7-300 and ern controller concept can

More information

2 ASCII TABLE (DOS) 3 ASCII TABLE (Window)

2 ASCII TABLE (DOS) 3 ASCII TABLE (Window) 1 ASCII TABLE 2 ASCII TABLE (DOS) 3 ASCII TABLE (Window) 4 Keyboard Codes The Diagram below shows the codes that are returned when a key is pressed. For example, pressing a would return 0x61. If it is

More information

Binary Representation. Number Systems. Base 10, Base 2, Base 16. Positional Notation. Conversion of Any Base to Decimal.

Binary Representation. Number Systems. Base 10, Base 2, Base 16. Positional Notation. Conversion of Any Base to Decimal. Binary Representation The basis of all digital data is binary representation. Binary - means two 1, 0 True, False Hot, Cold On, Off We must be able to handle more than just values for real world problems

More information

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System? Management Challenge Managing Hardware Assets What computer processing and storage capability does our organization need to handle its information and business transactions? What arrangement of computers

More information

MAS 500 Intelligence Tips and Tricks Booklet Vol. 1

MAS 500 Intelligence Tips and Tricks Booklet Vol. 1 MAS 500 Intelligence Tips and Tricks Booklet Vol. 1 1 Contents Accessing the Sage MAS Intelligence Reports... 3 Copying, Pasting and Renaming Reports... 4 To create a new report from an existing report...

More information

UTILITY INSTRUCTION MANUAL BNP-B2196 (ENG)

UTILITY INSTRUCTION MANUAL BNP-B2196 (ENG) UTILITY INSTRUCTION MANUAL BNP-B2196 (ENG) MELDASMAGIC is a registered trademark of Mitsubishi Electric Corporation. Microsoft and Windows are registered trademark of Microsoft Corporation in the USA.

More information

Modbus RTU Communications RX/WX and MRX/MWX

Modbus RTU Communications RX/WX and MRX/MWX 15 Modbus RTU Communications RX/WX and MRX/MWX In This Chapter.... Network Slave Operation Network Master Operation: RX / WX Network Master Operation: DL06 MRX / MWX 5 2 D0 Modbus Network Slave Operation

More information

Graded ARM assembly language Examples

Graded ARM assembly language Examples Graded ARM assembly language Examples These examples have been created to help students with the basics of Keil s ARM development system. I am providing a series of examples that demonstrate the ARM s

More information

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage Outline 1 Computer Architecture hardware components programming environments 2 Getting Started with Python installing Python executing Python code 3 Number Systems decimal and binary notations running

More information

C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands

C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands C Programming for Embedded Microcontrollers Warwick A. Smith Elektor International Media BV Postbus 11 6114ZG Susteren The Netherlands 3 the Table of Contents Introduction 11 Target Audience 11 What is

More information

Virtual Integrated Design Getting started with RS232 Hex Com Tool v6.0

Virtual Integrated Design Getting started with RS232 Hex Com Tool v6.0 Virtual Integrated Design Getting started with RS232 Hex Com Tool v6.0 Copyright, 1999-2007 Virtual Integrated Design, All rights reserved. 1 Contents: 1. The Main Window. 2. The Port Setup Window. 3.

More information

Remote Access Server - Dial-Out User s Guide

Remote Access Server - Dial-Out User s Guide Remote Access Server - Dial-Out User s Guide 95-2345-05 Copyrights IBM is the registered trademark of International Business Machines Corporation. Microsoft, MS-DOS and Windows are registered trademarks

More information

An Introduction to Assembly Programming with the ARM 32-bit Processor Family

An Introduction to Assembly Programming with the ARM 32-bit Processor Family An Introduction to Assembly Programming with the ARM 32-bit Processor Family G. Agosta Politecnico di Milano December 3, 2011 Contents 1 Introduction 1 1.1 Prerequisites............................. 2

More information

Alarm Message C B A. Alarm Message's scroll direction. Scroll the currently triggered Alarms on all screens. C B A. Display alarms.

Alarm Message C B A. Alarm Message's scroll direction. Scroll the currently triggered Alarms on all screens. C B A. Display alarms. 19 Alarm This chapter explains how to display and manage "Alarms" in GP-Pro EX, and discusses the useful features of Alarms. Please start by reading "19.1 Settings Menu" (page 19-2) and then turn to the

More information

The programming language C. sws1 1

The programming language C. sws1 1 The programming language C sws1 1 The programming language C invented by Dennis Ritchie in early 1970s who used it to write the first Hello World program C was used to write UNIX Standardised as K&C (Kernighan

More information

MICROPROCESSOR BCA IV Sem MULTIPLE CHOICE QUESTIONS

MICROPROCESSOR BCA IV Sem MULTIPLE CHOICE QUESTIONS MICROPROCESSOR BCA IV Sem MULTIPLE CHOICE QUESTIONS 1) Which is the microprocessor comprises: a. Register section b. One or more ALU c. Control unit 2) What is the store by register? a. data b. operands

More information

Computer Organization and Assembly Language

Computer Organization and Assembly Language Computer Organization and Assembly Language Lecture 8 - Strings and Arrays Introduction We already know that assembly code will execute significantly faster than code written in a higher-level language

More information

Hands-on Exercise 1: VBA Coding Basics

Hands-on Exercise 1: VBA Coding Basics Hands-on Exercise 1: VBA Coding Basics This exercise introduces the basics of coding in Access VBA. The concepts you will practise in this exercise are essential for successfully completing subsequent

More information

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection

More information

Number Representation

Number Representation Number Representation CS10001: Programming & Data Structures Pallab Dasgupta Professor, Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Topics to be Discussed How are numeric data

More information

Code::Blocks Student Manual

Code::Blocks Student Manual Code::Blocks Student Manual Lawrence Goetz, Network Administrator Yedidyah Langsam, Professor and Theodore Raphan, Distinguished Professor Dept. of Computer and Information Science Brooklyn College of

More information

SUDT AccessPort TM Advanced Terminal / Monitor / Debugger Version 1.37 User Manual

SUDT AccessPort TM Advanced Terminal / Monitor / Debugger Version 1.37 User Manual SUDT AccessPort TM Advanced Terminal / Monitor / Debugger Version 1.37 User Manual Version 1.0 - January 20, 2015 CHANGE HISTORY Version Date Description of Changes 1.0 January 20, 2015 Initial Publication

More information

8085 INSTRUCTION SET

8085 INSTRUCTION SET DATA TRANSFER INSTRUCTIONS Opcode Operand Description 8085 INSTRUCTION SET INSTRUCTION DETAILS Copy from source to destination OV Rd, Rs This instruction copies the contents of the source, Rs register

More information

WS_FTP Professional 12

WS_FTP Professional 12 WS_FTP Professional 12 Tools Guide Contents CHAPTER 1 Introduction Ways to Automate Regular File Transfers...5 Check Transfer Status and Logs...6 Building a List of Files for Transfer...6 Transfer Files

More information

Computer Science 281 Binary and Hexadecimal Review

Computer Science 281 Binary and Hexadecimal Review Computer Science 281 Binary and Hexadecimal Review 1 The Binary Number System Computers store everything, both instructions and data, by using many, many transistors, each of which can be in one of two

More information

WinProladder User Guide Content

WinProladder User Guide Content WinProladder User Guide Content 1 General Information... 1-1 1.1 Operation Environment Requirements... 1-1 1.1.1 Operating System... 1-1 1.1.2 Hardware Requirements... 1-1 1.2 Introduction to Functions

More information

Numeral Systems. The number twenty-five can be represented in many ways: Decimal system (base 10): 25 Roman numerals:

Numeral Systems. The number twenty-five can be represented in many ways: Decimal system (base 10): 25 Roman numerals: Numeral Systems Which number is larger? 25 8 We need to distinguish between numbers and the symbols that represent them, called numerals. The number 25 is larger than 8, but the numeral 8 above is larger

More information

Introduction to MIPS Assembly Programming

Introduction to MIPS Assembly Programming 1 / 26 Introduction to MIPS Assembly Programming January 23 25, 2013 2 / 26 Outline Overview of assembly programming MARS tutorial MIPS assembly syntax Role of pseudocode Some simple instructions Integer

More information

Version 1.5 Satlantic Inc.

Version 1.5 Satlantic Inc. SatCon Data Conversion Program Users Guide Version 1.5 Version: 1.5 (B) - March 09, 2011 i/i TABLE OF CONTENTS 1.0 Introduction... 1 2.0 Installation... 1 3.0 Glossary of terms... 1 4.0 Getting Started...

More information

Introduction. - Please be sure to read and understand Precautions and Introductions in CX-Simulator Operation Manual and

Introduction. - Please be sure to read and understand Precautions and Introductions in CX-Simulator Operation Manual and Introduction - Please be sure to read and understand Precautions and Introductions in CX-Simulator Operation Manual and CX-Programmer Operation Manual before using the product. - This guide describes the

More information

ScanWin Installation and Windows 7-64 bit operating system

ScanWin Installation and Windows 7-64 bit operating system ScanWin Installation and Windows 7-64 bit operating system In order to run the ScanWin Pro install and program on Windows 7 64 bit operating system you need to install a Virtual PC and then install a valid,

More information

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T) Unit- I Introduction to c Language: C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating

More information

When upgrading your TAPIT software make sure that all call accounting data has been exported before you begin the installation process.

When upgrading your TAPIT software make sure that all call accounting data has been exported before you begin the installation process. When upgrading your TAPIT software make sure that all call accounting data has been exported before you begin the installation process. Registration Settings: SERIAL NUMBER: COMPUTER ID: REGISTRATION NUMBER:

More information

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions CS101 Lecture 26: Low Level Programming John Magee 30 July 2013 Some material copyright Jones and Bartlett 1 Overview/Questions What did we do last time? How can we control the computer s circuits? How

More information

DsPIC HOW-TO GUIDE Creating & Debugging a Project in MPLAB

DsPIC HOW-TO GUIDE Creating & Debugging a Project in MPLAB DsPIC HOW-TO GUIDE Creating & Debugging a Project in MPLAB Contents at a Glance 1. Introduction of MPLAB... 4 2. Development Tools... 5 3. Getting Started... 6 3.1. Create a Project... 8 3.2. Start MPLAB...

More information

Short Description Installation Starting Up Configuration. Generalized Postprocessor

Short Description Installation Starting Up Configuration. Generalized Postprocessor Short Description Installation Starting Up Configuration Generalized Postprocessor Index TesoPost Generalized Postprocessor Index... 2 Short Description...3 Concept...3 System Requirements... 4 Delivered

More information