Google

Mar 29, 2008

centigrade (celsius) to fahrenheit calculation for 8086 Assembly Language

; this program prints out the result in binary code.
; to see result in hexadecimal or decimal form click vars.
name "celsi"

org 100h
jmp start

tc db 10 ; t celsius.
tf db 0 ; t fahrenheit.

result1 db ? ; result in fahrenheit.
result2 db ? ; result in celsius.

start:

; convert celsius to fahrenheit according
; to this formula: f = c * 9 / 5 + 32
mov cl, tc
mov al, 9
imul cl
mov cl, 5
idiv cl
add al, 32
mov result1, al

mov bl, result1
call print ; print bl


; convert fahrenheit to celsius according
; to this formula: c = (f - 32) * 5 / 9

mov cl, tf
sub cl, 32
mov al, 5
imul cl
mov cl, 9
idiv cl
mov result2, al

mov bl, result2
call print ; print bl

; wait for any key press...
mov ah, 0
int 16h


ret ; return to the operating system.


; procedure prints the binary value of bl
print proc near

pusha

; print result in binary:
mov cx, 8
p1: mov ah, 2 ; print function.
mov dl, '0'
test bl, 10000000b ; test first bit.
jz zero
mov dl, '1'
zero: int 21h
shl bl, 1
loop p1
; print binary suffix:
mov dl, 'b'
int 21h
; print carrige return and new line:
mov dl, 0Dh
int 21h
mov dl, 0Ah
int 21h

popa
ret ; return to the main program.
print endp

Mar 26, 2008

Troubleshooting a simple 8086 microprocessor based microcomputer

This post will teach you how to troubleshoot a simple microcomputer system such as an SDK-86 board

Identify the Symptoms
make the list of symptoms that you find.they to find wether the proble is with the system or the it is with how the person is use the machine.

Make a careful visual and tactile inspection
check for the components that have been extensively hot.
check to see that all ic are firmly seated in there sockets and that IC's have no bent pins.
check for broken wires and loose connections or a thin film of dust etc.
ome meter check to verify your suspicions.

Check the power supply
determine the power supply voltages for the manual and check the supply voltages directly on the appropriate pins of some IC's to make sure the voltage is actually getting there.

Do a signal Rool Call
make a quick check of some key signals around the CPU of the microprocessor. if the problem is a bad IC this can help point you towards the one that is bad.
check if clock signals is present with the oscilloscope.
check if CPU is putting out control signals such as RD WR and ALE.
check the bus line to see if there is any activity on the buses. if there is no activity on these buses then the common problem is that the CPU is stuck on hold wait halt or reset condition or by afilure od some TTL devices.
perform check on the RAM and ROM and port decoders.

Systematically substitute socketed IC's
the easiest case of substitution is that where you have two identical microprocessor one that works and one that doesn't and the IC's of both units are in the sockets for this case you can use the working system to test the IC's from the non working system.

Troubleshoot soldered in IC's


Equipment for troubleshooting Microcomputers
Logical Analyzers
a logical analyzer is very powerfully troubleshooting tool but to use it effectively you need some detailed knowledge ans d program listing for the system that you are trying to troubleshoot.

for detailed steps for the trouble shooting you can refer the book microprocessor and interfacing by DOUGLAS V HALL . This post is based on that the steps given in that book

You might be also interested in:
:: Assembly Language Programs to compute an expression
:: Interfacing Analog-to-Digital converter to 8086 using 8255
:: Interfacing Digital-To-Analog converter to 8086 using 8255

Mar 21, 2008

Invoke function

The Invoke function is used to specific to MASM, and it can call functions without
having to push the parameters beforehand. This saves us a lot of typing effort.

Here is an example
invoke SendMessage, [hWnd], WM_CLOSE, 0, 0

that is interpreted as

push 0
push 0
push WM_CLOSE
push [hWnd]
call [SendMessage]

You might be also interested in:
:: Find Square Root of a hexadecimal number in assembly language
:: common intreview questions on 8086
:: Assembly Language Source Codes

Mar 15, 2008

free and open source 8086 Microprocessor Emulator

i8086emu

this is a free and open source Intel 8086 based microprocessor cross-platform emulator. It has support for dynamically loadable device plugins and some peripherals like a PIT, PIC, 8-segment-displays, buttons and leds. i8086emu comes with an ncurses and an GTK-2 gui

here is the screen short of the emulator this can work major operating systems likeAll 32-bit MS Windows (95/98/NT/2000/XP), All POSIX (Linux/BSD/UNIX-like OSes) Linux this software is downloaded more than 4500 time from sourceforge.net

dowload it here download microprocessor emulator

You might be also interested in:
:: Find Square Root of a hexadecimal number in assembly language
:: common intreview questions on 8086
:: Assembly Language Source Codes

Mar 12, 2008

8051 based project for electrical students

(AT89S52) Prepaid Energy Meter


this project is based on implementing a similar technology like prepaid cellphone or prepaid dth home service in electrical power utilization generally for domestic costumers

this instrument we are calling prepaid eneargy meter this has provision for tariff indicator and gives an alarm sound to consumer before the whole amount is reduced.

working of the instrument:

Every domestic consumer can buy a prepaid card (is nothing but an EEPROM IC) with a password stored inside it using a Micro controller program. The memory card is available at various ranges ie. Rs 500, Rs 1000, Rs 100 etc.In this instrument we have given the name for memory card as prepaid energy card. When the consumer insert a prepaid energy card into the card reader which is connected in prepaid energy meter with tariff indicator kit.Then the card reader will read the stored password and delete the information from the EEPROM IC using the MC program. So that the prepaid energy card cannot be reused by others. Suppose if a consumer buy a card for Rs.500 he can insert this amount through the card reader so that prepaid energy meter with tariff indicator kit will be activated. According to the power consumption the amount will be reduced. When the amount is exausted, the relay will automatically shutdown the whole system.


download the program here :

this is the circuit digram



You might be also interested in:

:: bit reversal and sorting programs
:: Find Square Root of a hexadecimal number in assembly language
:: common intreview questions on 8086

Mar 8, 2008

Program to display ASCII characters on the display unit

this is the program to display ascii characters on the screen it is written in assembly language and can work of 8086 microprocessors


.model small
.stack
.data
.code
; program starting
main proc
mov dl, 00h
lop: mov ah, 02h
int
21h
inc dl
jnz lop
mov ax,4c00h
int 21h
main endp
end main
; end of the program

You might be also interested in:

:: Interfacing Stepper Motor to 8086 using 8255
:: MASM 611 SOFTWARE
:: bit reversal and sorting programs

Mar 2, 2008

why there are two ground pins in 8086

here are the different answers

first one :
1 for analog n other for digital ground as i ve heard..the diff b/w analog n digital ground is digital ground doesnt have transient currents sumthin like that i heard dont knw in detail..


second one :
several pins of 8086 are multiplexed (means they have different functions in different situations). the functions of those pins are controlled by these ground pins. the two functions of processor is grouped in two groups namely 'min mode operation' and 'max mode operation'.

third one :
there are two pins to support max mode and min mode.....one of the mode is multiprocessor mode i.e. in ithis mode u can connect two or more multiprocessors to work in cooperation. if both pin r grounded it means single procesor mode..

last one :
consider a circuit where ur 8086 has to be activated only when certain condition is met. say the output of a logic circuit is low. the output pin of this device is connected to the gnd pin of 8086. when ever the out put pin is low there is a voltage diff between vcc and gnd pins of 8086 and 8086 is activated. so the logic device output pin acts a current sink. the sinking capacities of normal ttl devices are far less compared to the current sourced by a 8086 up. hence 2 gnd pins to split current from 8086 and ensure the current at gnd pin of 8086 does not exceed the sinking capacities of the peripherals.

You might be also interested in: