Professional Documents
Culture Documents
/*(wa
; For detail explanation of program refer page no. 11> of book ; Microprocessor And Microcomputer by A. P. Godse #&A M ! #&A ,-A M ! ,-A /#%.../ ; Get t=e contents of memory location %.../ into accumulator *"A ; sa)e t=e contents in * register %%../ ; Get t=e contents of memory location %%../ into accumulator. %.../ ; ,tore t=e contents of accumulator at address %.../. A"* ; Get t=e sa)ed contents back into A register %%../ ; ,tore t=e contents of accumulator at address %%../ ; -erminate program execution
/*(wa
; For detail explanation of program refer page no. 11> of book ; Microprocessor And Microcomputer by A. P. Godse #51 /"%.../ ; 1nitiali2e /# register pair as a pointer ; to memory location %.../ #51 &"%%.. / ; 1nitiali2e &' register pair as a pointer ; to memory location %%../ M ! *"M ; Get t=e contents of memory location ; 1.../ into * register #&A5 & ; Get t=e contents of memory location ; %.../ into A register M ! M"A ; ,tore t=e contents of A register into memory ; location %.../ M ! A"* ; +opy t=e contents of * register into accumulator ,-A5 & ; ,tore t=e contents of A register into memory ; location %%../. /#; -erminate program execution
/*(e arate the digits of a hexa decimal nos and store it in two diff+ locations*/
; For detail explanation of program refer page no. 1>. of book ; Microprocessor And Microcomputer by A. P. Godse #&A %%../ ; Get t=e packed *+& number A91 F./ ; Mask lo$er nibble ::+ ::+ ::+ ::+ ; Ad(ust =ig=er *+& digit as a lo$er digit ,-A %3../ ; ,tore t=e partial result #&A %%../ ; Get t=e original *+& number A91 .F/ ; Mask =ig=er nibble ,-A %3.1/ ; ,tore t=e result /#; -erminate program execution
/**/
; For detail explanation of program refer page no. 1E1 of book ; Microprocessor and Microcomputer by A. P. Godse #51 ,P"%0.. ; 1nitiali2e stack pointer M!1 +" .E/ ; 1nitiali2e count $it= E *A+67 M ! A"* ; ::+ ; :otate * register contents rig=t M ! *"A ; ,a)e contents of register * ;9+ ,61P ; 1f no carry skip M!1 A".+./ ,1M ; 1f carry" send =ig= on , & ;MP 9'5,61P7 M!1 A"0./ ,1M ; 1f no carry" send lo$ on , & 9'5-7+A## &'#AA ; Gait for specific time &+: + ; &ecrement count by 1 ;9< *A+6 ; if count 4 ." if not repeat /#; ,top program execution
&'#AA7 #51 &"...1 *A+617 &+5 & M ! A"' :A & ;9< *A+61 :'-
/**/
; For detail explanation of program refer page no. 1E1 of book ; Microprocessor H Microcomputer by A. P. Godse #51 ,P" %>FF/ #51 /" %.../ ; Memory pointer :1M ; :ead ,1& A91 E./ ; +=eck &> bit of Accumulator +A## &'#AA ; 1I% bit time delay for stop bit M!1 *" .E/ ; 1nitiali2e bit counter M!1 &" ../ ; +lear data register 3P17 +A## &'#AA ; 1bit time :1M ; :ead ,1& line A91 E. / ; Mask bits *DJ*. :A & ; : data bit $it= pre)ious bits ::+ M ! &" A ; ,tore data bit at appropriate position &+: * ;9< 3P1 :#+ ; ,=ift left to correct result M ! M" A ; ,tore result :1M ; :ead stop bit A91 E./ +< ':: : ; 1f not stop bit call error /#; -erminate program. &'#AA7 M!1 '".1 *A+617 &+: ' ;9< *A+61 :'':: :7 M!1 A".FF :'-
/*store the nos in a memory loc+ .n the re#erse order in another memory loc+*/
; For detail explanation of program refer page no. 1?1 of book ; Microprocessor And Microcomputer by A. P. Godse M!1 +" .A/ ; 1nitiali2e counter #51 /" %%../ ; 1nitiali2e source memory pointer #51 &" %3.?/ ; 1nitiali2e destination memory pointer *A+67 M ! A" M ; Get byte from source memory block
; ,tore byte in t=e destination memory block ; 1ncrement source memory pointer ; &ecrement destination memory pointer ; &ecrement counter ; 1f counter . repeat ; -erminate program execution
/*-ransfer / nos in memory ointed "y loc+ #alue in another memory loc+ */
; For detail explanation of program refer page no. 1?% of book ; Microprocessor And Microcomputer by A. P. Godse #51 /"%%../ ; 1nitiali2e lookup table pointer #51 &"%1../ ; 1nitiali2e source memory pointer #51 *"%.../ ; 1nitiali2e destination memory pointer *A+67 #&A5 & ; Get t=e number M ! #"A ; A point to t=e sBuare M ! A"M ; Get t=e sBuare ,-A5 * ; ,tore t=e result at destination memory location 195 & ; 1ncrement source memory pointer 195 * ; 1ncrement destination memory pointer M ! A"+ ; +P1 .5/ ; +=eck for last number ;9< *A+6 ; 1f not repeat /#; 'nd of program
/*(earch for a no in the list if found store address where it is found else store 0000*/
; For detail explanation of program refer page no. 1?0 of book ; Microprocessor And Microcomputer by A. P. Godse #51 /"%.../ ; 1nitiali2e memory pointer M!1 *" 5%/ ; 1nitiali2e counter *A+67 M ! A"M ; Get t=e number +MP + ; +ompare $it= t=e gi)en byte ;< #A,; Go last if matc= occurs 195 / ; 1ncrement memory pointer &+: * ; &ecrement counter ;9< *A+6 ; 1f not 2ero" repeat #51 /" ..../ ,/#& %%../ ;MP '9& ; ,tore .. at %%../ and %%.1/ #A,-7 ,/#& %%../ ; ,tore memory address '9&7 /#; ,top
/#-
/*Decimal addition of 2 nos in 1 different mem+ 2oc+ And store in 1 other mem+ loc+*/
; For detail explanation of program refer page no. 1?D of book ; Microprocessor And Microcomputer by A. P. Godse #51 /"%.../ ; 1nitiali2e pointer1 to first number #51 &"%1../ ; 1nitiali2e pointer% to second number #51 *"%%../ ; 1nitiali2e pointer3 to result ,-+ +M+ ; +arry 4 . *A+67 #&A5 & ; Get t=e digit A&& M ; Add t$o digits &AA ; Ad(ust for decimal ,-A5 * ; ,tore t=e result 195 / ; 1ncrement pointer1 195 & ; 1ncrement pointer% 195 * ; 1ncrement result pointer M ! A" # +P1 " .D ; +=eck for last digit ;9< *A+6 ; 1f not last digit repeat /#; -erminate program execution
/#-
/*Addition of 2 nos in 1 different mem+ 2oc+ And store in %0 other mem+ loc+*/
; For detail explanation of program refer page no. 1?E of book ; Microprocessor And Microcomputer by A. P. Godse #51 /" %%../ ; 1nitiali2e memory pointer 1 #51 *" %3../ ; 1nitiali2e memory pointer % #51 &" %0../ ; 1nitiali2e result pointer *A+67 #&A5 * ; Get t=e number from array % A&& M ; Add it $it= number in array 1 ,-A5 & ; ,tore t=e addition in array 3 195 / ; 1ncrement pointer1 195 * ; 1ncrement pointer% 195 & ; 1ncrement result pointer M ! A" # +P1 " .A ; +=eck pointer1 for last number ;9< *A+6 ; 1f not" repeat /#; ,top
/*.n a list of /0 nos se arate the e#en nos and store the in different memory loc+*/
; For detail explanation of program refer page no. 1?? of book ; Microprocessor And Microcomputer by A. P. Godse #51 /" %%../ ; 1nitiali2e memory pointer1 #51 &" %3../ ; 1nitiali2e memory pointer% M!1 +" 3%/ ; 1nitiali2e counter *A+67 M ! A" M ; Get t=e number A91 .1/ ; +=eck for e)en number ;9< ,61P ; 1f &&" donKt store M ! A" M ; Get t=e number ,-A5 & ; ,tore t=e number in result list 195 & ; 1ncrement pointer % ,61P7 195 / ; 1ncrement pointer1 &+: + ; &ecrement counter ;9< *A+6 ; 1f not 2ero" repeat /#; ,top
/#-
/*Decimal addition*/
; For detail explanation of program refer page no. 135 of book ; Microprocessor And Microcomputer by A. P. Godse #51 /" %%../ ; 1nitiali2e pointer M ! A"M ; Get t=e first number 195 / ; 1ncrement t=e pointer A&& M ; Add t$o numbers &AA ; +on)ert /'5 to )alid *+& ,-A %3../ ; ,tore t=e result /#; -erminate program execution JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ