Very Short Intro To Assembly Language Programming
Very Short Intro To Assembly Language Programming
A high-level statement (e.g., System.out.println(Pi = +Math.PI); ) around hundreds of assembly language statements. Tedious Time consuming More prone to error, Debugging is even more tedious Not suitable for lazy programmers
Final code runs faster if you invest time to code. Why? 10% of the program is responsible for 90% of the execution time! Where to start?
Size of your assembly program is much smaller than that of high-level. Speed and space critical devices use assembly:
RFID card Device drivers BIOS routines
Installation: Step 1
We will be using 8088 Assembler and Tracer Toolkit (Check course materials @Blackboard) Download and extract 8088 tra.zip. The folder structure:
Installation: Step 1
Create a folder named tracer in C: or D: drive. Copy the contents of windows (not the windows folder itself) in 8088 tra.zip into the tracer folder. Make sure you have the following folder structure:
Installation: Step 1
Three EXE les in C:\tracer\bin folder as88 assembler s88 interpreter t88 debugger-tracer The interpreter s88 is for debugging purpose along with t88. Add C:\tracer\bin folder in PATH environment, so that you can execute these three from anywhere using command prompt. [ Please check Addendum-1 ] Please be familiar with how to type in commands in the command prompt
you need to modify security property of the le cong.nt in order to add the above line and save the changes. [ Please check Addendum-3 ] If you can not modify the cong.nt le, every output produced by the t88 will be shown really garbled (as you saw during my presentation)!! Then a reboot (or, a logo should be sucient)
Assembler source les have an extension .s To create a binary for a source code named project1.s, enter the command as88 project1 It performs the assembly and generate three les:
project1.88 The 8088 binary project1.# A le which links the le positions in the source le to the positions in the binary le project1.$ A copy of the source le which contains secondary sources and satises preferred conventions for the assembly process.
s88 is almost similar to t88, except that it does not show the tracer window. To trace (without the trace window) the previous project1, we enter the command s88 project1
It has 14 registers, each 16 bits wide PC/IP contains the memory location of the next instruction to be executed CS Segment (64KB) and the CS register Data segment (64KB) and DS register
AX,BX,CX and DX are the general registers. Each of these general registers can be treated as a pair of 8-bit registers: AH,AL, BH,BL, CH,CL,DH,DL.
MOV AX, BX ADD CX, 20 Direct Addressing example ADD CX, (20) Register indirect Addressing example ADD DX, (BX) MOV CX,5(SI) Register indirect Addressing is possible with only BX, SI and DI registers.
The software, documentation, this presentation at Blackboard Appendix C of your Tanenbaums book (6th Edition)
4 5 6
Ashis Kumer Biswas Assembly Language Programming
This is not a permanent solution, i.e., if you logout this will be wiped out. However, if you really want a permanent solution, then append the above command in any startup scripts (e.g., /home/ashis/.bashrc)
Ashis Kumer Biswas Assembly Language Programming
3 4 5
Click START menu. Type in the search box cong.nt (without the quotes). Once, you nd it at the top of the start menu, right click on the le name, then select Properties from the context menu. Click on the Security tab. Then select your user name and click the Edit button. Click on the tiny checkboxes in the Allow column so that you have full control of the le. Then click OK.
Thank You