Skip to main content

Posts

Showing posts with the label Microcontroller Programs

Basic microcontroller programs all in one file

BASIC MICROCONTROLLER PROGRAMS    There total 11 microcontroller programs are given one by one also provided  text document file for download at the end. 1.move block of data within internal RAM org 000h mov r0,#30h mov r1,#40h mov r2,#3 start: mov a,@r0 mov@r1,a inc r0 inc r1 djnz r2,start here: sjmp here end 2.packed to unpacked org 000h mov r1,#18h mov a,r1 anl a,#0fh mov r2,a mov a,r1 anl a,#0f0h swap a mov r3,a end 3. unpacked to packed org 000h mov r1,#1h mov r2,#8h mov a,r1 swap a add a,r2 here:sjmp here end 4. bcd to ascii code un_bcd equ 40h asci equ 41h org 000h mov a,#30h orl a,un_bcd mov asci,a here: sjmp here end 5. ascii to bcd asci equ 40h un_bcd equ 41h org 0h mov a,asci anl a,#0fh mov un_bcd,a here :sjmp here 6. evaluate simple arthmatic #include<reg51.h> void main() { unsigned char y; y=(((5*2)-(4+1))/3)%2; while(1); } 7.Addition three 8bit no. res equ 44h org 000h mov r0,#40h mov r2,#3 clr a mov r7,a start:add a,@r0 da a jnc next inc r7 next:inc r0 mov res,a d