<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Samet Kilictas&#039;s Blog &#187; Motor</title>
	<atom:link href="http://samet.kilictas.com/tag/motor/feed/" rel="self" type="application/rss+xml" />
	<link>http://samet.kilictas.com</link>
	<description>J2E, PHP, Linux, PL/SQL and other random rants</description>
	<lastBuildDate>Sun, 06 Nov 2011 04:36:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Assembly Tutorials</title>
		<link>http://samet.kilictas.com/assembly-tutorials-program-controlling-dc-motor-and-stepper-motor-from-parallel-port/</link>
		<comments>http://samet.kilictas.com/assembly-tutorials-program-controlling-dc-motor-and-stepper-motor-from-parallel-port/#comments</comments>
		<pubDate>Sat, 06 Dec 2008 01:06:33 +0000</pubDate>
		<dc:creator>Samet Kilictas</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Assembly]]></category>
		<category><![CDATA[cyprus international university]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[DC]]></category>
		<category><![CDATA[DC motor]]></category>
		<category><![CDATA[kilictas]]></category>
		<category><![CDATA[Motor]]></category>
		<category><![CDATA[parallel]]></category>
		<category><![CDATA[parallel port]]></category>
		<category><![CDATA[Samet]]></category>
		<category><![CDATA[samet kilictas]]></category>
		<category><![CDATA[show]]></category>
		<category><![CDATA[Stepper]]></category>
		<category><![CDATA[Stepper Motor]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[year]]></category>

		<guid isPermaLink="false">http://samet.kilictas.com/?p=107</guid>
		<description><![CDATA[Here is myprojects during the course microprocessors.  Hope it will help you guys. Here you are can find following programs. Data and Time Showing Controlling DC Motor from/using parallel port Controlling Stepper Motor from/using parallel port #1 &#8211; Data and Time Showing ;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; ;&#8212; TERM PROJECT                      &#8212; ;&#8212; LECTURE: MICROPROCESSORS          &#8212; ;&#8212; LECTURER: HOSSEIN MEHRABANI       [...]]]></description>
			<content:encoded><![CDATA[<p>Here is myprojects during the course microprocessors.  Hope it will help you guys. Here you are can find following programs.</p>
<ul>
<li>Data and Time Showing</li>
<li>Controlling DC Motor from/using parallel port</li>
<li>Controlling Stepper Motor from/using parallel port</li>
</ul>
<p><strong>#1 &#8211; Data and Time Showing</strong></p>
<blockquote><p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;&#8212; TERM PROJECT                      &#8212;<br />
;&#8212; LECTURE: MICROPROCESSORS          &#8212;<br />
;&#8212; LECTURER: HOSSEIN MEHRABANI       &#8212;<br />
;&#8212; CODED BY: SAMET KILICTAS          &#8212;<br />
;&#8212; STUDENT NUMBER: 20040283          &#8212;<br />
;&#8212; E-MAIL: SAMET@KILICTAS.COM        &#8212;<br />
;&#8212; CYPRUS INTERNATIONAL UNIVERSITY   &#8212;<br />
;&#8212; 26-05-2008                        &#8212;<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;THE REQUIRED MACROS FOR PROGRAM&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
CURS_POSITION     MACRO ROW,COLUMN<br />
MOV BH,00<br />
MOV AH,02<br />
MOV DH,ROW<br />
MOV DL,COLUMN<br />
INT 10H<br />
ENDM<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
CLS_SCREEN MACRO<br />
MOV AX,0600H<br />
mov bh,00<br />
mov bh,0ah<br />
MOV CX,0<br />
MOV DX,184FH<br />
INT 10H<br />
ENDM<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
SHOW_INSCREEN MACRO STRING<br />
MOV AH,09<br />
MOV DX,OFFSET STRING</p></blockquote>
<p><span id="more-107"></span></p>
<blockquote><p>INT 21H<br />
ENDM<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
;PROGRAM STARTS FROM THIS POINT<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
.MODEL HUGE<br />
.STACK 9000<br />
.DATA<br />
Table DB &#8220;00$&#8221;,&#8221;01$&#8221;,&#8221;02$&#8221;,&#8221;03$&#8221;,&#8221;04$&#8221;,&#8221;05$&#8221;,&#8221;06$&#8221;,&#8221;07$&#8221;,&#8221;08$&#8221;,&#8221;09$&#8221;<br />
DB &#8220;10$&#8221;,&#8221;11$&#8221;,&#8221;12$&#8221;,&#8221;13$&#8221;,&#8221;14$&#8221;,&#8221;15$&#8221;,&#8221;16$&#8221;,&#8221;17$&#8221;,&#8221;18$&#8221;,&#8221;19$&#8221;<br />
DB &#8220;20$&#8221;,&#8221;21$&#8221;,&#8221;22$&#8221;,&#8221;23$&#8221;,&#8221;24$&#8221;,&#8221;25$&#8221;,&#8221;26$&#8221;,&#8221;27$&#8221;,&#8221;28$&#8221;,&#8221;29$&#8221;<br />
DB &#8220;30$&#8221;,&#8221;31$&#8221;,&#8221;32$&#8221;,&#8221;33$&#8221;,&#8221;34$&#8221;,&#8221;35$&#8221;,&#8221;36$&#8221;,&#8221;37$&#8221;,&#8221;38$&#8221;,&#8221;39$&#8221;<br />
DB &#8220;40$&#8221;,&#8221;41$&#8221;,&#8221;42$&#8221;,&#8221;43$&#8221;,&#8221;44$&#8221;,&#8221;45$&#8221;,&#8221;46$&#8221;,&#8221;47$&#8221;,&#8221;48$&#8221;,&#8221;49$&#8221;<br />
DB &#8220;50$&#8221;,&#8221;51$&#8221;,&#8221;52$&#8221;,&#8221;53$&#8221;,&#8221;54$&#8221;,&#8221;55$&#8221;,&#8221;56$&#8221;,&#8221;57$&#8221;,&#8221;58$&#8221;,&#8221;59$&#8221;<br />
mm  DB &#8220;:$&#8221;<br />
mm2  DB &#8220;/$&#8221;<br />
Date  DB &#8220;Date: $&#8221;<br />
Time  DB &#8220;   Time: $&#8221;<br />
Century DB &#8220;20$&#8221;<br />
CONSTANTV  DB 3<br />
MSG1 DB &#8216;PROJECT : DISPLAYING THE PROCESSORS DATE AND TIME ON MONITOR&#8217;,'$&#8217;<br />
MSG2 DB &#8216;LECTURE : MICROPROCESSORS [LECTURER : HOSSEIN MEHRABANI]&#8216;,&#8217;$&#8217;<br />
MSG3 DB &#8216;CODING  : SAMET KILICTAS [NO -&gt; 20040283] [CYPRUS INTERNATIONAL UNIVERSITY]&#8216;,&#8217;$&#8217;<br />
MSG4 DB &#8216;MOTOR STATUS :&#8217;,'$&#8217;<br />
MSG5 DB &#8216;PRESS H BUTTON FOR INSTRCONSTANTVTIONS&#8230;&#8217;,'$&#8217;<br />
MSG6 DB &#8216;DIRECTION :  ?&#8217;,'$&#8217;<br />
MSG7 DB &#8216;SPEED  : ?&#8217;,'$&#8217;<br />
MSG8 DB &#8216;EMAIL   : samet@kilictas.com&#8217;,'$&#8217;<br />
MSG9 DB &#8216;Good Bye..! <img src='http://samet.kilictas.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> &#8217;,'$&#8217;<br />
.CODE<br />
MAIN PROC<br />
MOV AX,@DATA<br />
PUSH AX<br />
POP DS</p>
<p>;**************************************************************************<br />
; Show main screen</p>
<p>MAINSCREEN:<br />
CLS_SCREEN<br />
CURS_POSITION 2,2<br />
SHOW_INSCREEN MSG1<br />
CURS_POSITION 3,2<br />
SHOW_INSCREEN MSG2<br />
CURS_POSITION 4,2<br />
SHOW_INSCREEN MSG3<br />
CURS_POSITION 5,2<br />
SHOW_INSCREEN MSG8</p>
<p>;**************************************************************************</p>
<p>CURS_POSITION 13,24<br />
SHOW_INSCREEN Date</p>
<p>MOV AH,04h  ; 04h function to get date information<br />
INT 1Ah</p>
<p>MOV AL,DL ; Here DL gives me the day information<br />
MUL CONSTANTV<br />
MOV DI,AX<br />
LEA DX,Table[DI]<br />
MOV AH,09h<br />
INT 21h</p>
<p>SHOW_INSCREEN mm2</p>
<p>MOV AH,04h  ; 04h function to get date information<br />
INT 1Ah</p>
<p>MOV AL,DH ; Here DH gives me the month information<br />
MUL CONSTANTV<br />
MOV DI,AX<br />
LEA DX,Table[DI]<br />
MOV AH,09h<br />
INT 21h</p>
<p>SHOW_INSCREEN mm2</p>
<p>SHOW_INSCREEN Century</p>
<p>MOV AH,04h  ; 04h function to get date information<br />
INT 1Ah</p>
<p>MOV AL,CL ; Here CL gives me the year information<br />
MUL CONSTANTV<br />
MOV DI,AX<br />
LEA DX,Table[DI]<br />
MOV AH,09h<br />
INT 21h</p>
<p>;**************************************************************************</p>
<p>SHOW_INSCREEN Time</p>
<p>MOV AH,2Ch  ; 2Ch function to get time information<br />
INT 21h</p>
<p>MOV AL,CH ; Here CH gives me the hour information<br />
MUL CONSTANTV<br />
MOV DI,AX<br />
LEA DX,Table[DI]<br />
MOV AH,09h<br />
INT 21h</p>
<p>SHOW_INSCREEN mm</p>
<p>MOV AL,CL ; Here CH gives me the minute information<br />
MUL CONSTANTV<br />
MOV DI,AX<br />
LEA DX,Table[DI]<br />
MOV AH,09h<br />
INT 21h</p>
<p>CURS_POSITION 50,15</p>
<p>;**************************************************************************</p>
<p>GOODBYE:<br />
MOV AH,4CH<br />
INT 21h<br />
MAIN ENDP<br />
END MAIN</p></blockquote>
<p><strong>#2 &#8211; Controlling DC Motor from/using parallel port</strong></p>
<blockquote><p>HOLD MACRO<br />
MOV AH,07<br />
INT 21H<br />
ENDM</p>
<p>WAY MACRO VALUE<br />
MOV DX,378H<br />
MOV AL,VALUE<br />
OUT DX,AL<br />
ENDM</p>
<p>CLR MACRO<br />
MOV AX,0600H<br />
MOV BH,00<br />
MOV BH,1fh<br />
MOV CX,0<br />
MOV DX,184fh<br />
INT 10H<br />
ENDM</p>
<p>CURSOR MACRO ROW,COLUMN<br />
MOV BH,00<br />
MOV AH,02<br />
MOV DH,ROW<br />
MOV DL,COLUMN<br />
INT 10H<br />
ENDM</p>
<p>DSPLY MACRO STRING<br />
MOV AH,09<br />
MOV DX,OFFSET STRING<br />
INT 21H<br />
ENDM</p>
<p>.MODEL SMALL<br />
.STACK 64<br />
.DATA</p>
<p>Message1 DB &#8216;CHOOSE AN OPTION&#8217;,'$&#8217;<br />
Message2 DB &#8216;DC MOTOR CONTROL&#8217;,'$&#8217;<br />
Message3 DB &#8216;PRESS G FOR TURN THE DC MOTOR TO Counter Clockwise&#8217;,'$&#8217;<br />
Message4 DB &#8216;PRESS D FOR TURN THE DC MOTOR TO Clockwise&#8217;,'$&#8217;<br />
Message5 DB &#8216;PRESS V FOR STOP THE DC MOTOR&#8217;,'$&#8217;<br />
Message6 DB &#8216;Choose an Operation from Menu&#8217;,'$&#8217;<br />
Message7 DB &#8216;Counter Clockwise&#8217;,'$&#8217;<br />
Message8 DB &#8216;Clockwise         &#8216;,&#8217;$&#8217;<br />
Message9 DB &#8216;Stopped      &#8216;,&#8217;$&#8217;</p>
<p>TurnRight EQU  00100101B<br />
TurnLeft  EQU  00011101B<br />
STOP  EQU  00001111B</p>
<p>.CODE</p>
<p>MAIN:<br />
here:    MOV AX,@DATA<br />
MOV DS,AX<br />
CALL Choice<br />
CMP AL,&#8217;g&#8217;<br />
CALL Left<br />
CMP AL,&#8217;d&#8217;<br />
CALL Right<br />
CMP AL,&#8217;v&#8217;<br />
CALL Away</p>
<p>Choice:<br />
CLR<br />
CURSOR 3,20<br />
DSPLY Message2<br />
CURSOR 6,10<br />
DSPLY Message3<br />
CURSOR 8,10<br />
DSPLY Message4<br />
CURSOR 10,10<br />
DSPLY Message5<br />
CURSOR 15,12<br />
DSPLY Message6<br />
HOLD<br />
RET</p>
<p>Left:<br />
CURSOR 17,12<br />
DSPLY Message7<br />
WAY TurnLeft<br />
CURSOR 19,12<br />
DSPLY Message1<br />
HOLD<br />
RET</p>
<p>Right:<br />
CURSOR 17,12<br />
DSPLY Message8<br />
WAY TurnRight<br />
CURSOR 19,12<br />
DSPLY Message1<br />
HOLD<br />
RET</p>
<p>Away:<br />
CURSOR 17,12<br />
DSPLY Message9<br />
CURSOR 21,12<br />
JMP quit<br />
RET</p>
<p>quit:    WAY STOP<br />
MOV AH,4CH<br />
INT 21H<br />
END MAIN</p></blockquote>
<p><strong>#3 &#8211; Controlling Stepper Motor from/using parallel port</strong></p>
<blockquote><p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;&#8212; TERM PROJECT                      &#8212;<br />
;&#8212; STEPPER MOTOR WITH 7 SEGMENT      &#8212;<br />
;&#8212; LECTURE: MICROPROCESSORS          &#8212;<br />
;&#8212; LECTURER: HOSSEIN MEHRABANI       &#8212;<br />
;&#8212; CODED BY: SAMET KILICTAS          &#8212;<br />
;&#8212; STUDENT NUMBER: 20040283          &#8212;<br />
;&#8212; E-MAIL: SAMET@KILICTAS.COM        &#8212;<br />
;&#8212; CYPRUS INTERNATIONAL UNIVERSITY   &#8212;<br />
;&#8212; 26-05-2008                        &#8212;<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;THE REQUIRED MACROS FOR PROGRAM&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
CURS_POSITION     MACRO ROW,COLUMN<br />
MOV BH,00<br />
MOV AH,02<br />
MOV DH,ROW<br />
MOV DL,COLUMN<br />
INT 10H<br />
ENDM<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
CLS_SCREEN MACRO<br />
MOV AX,0600H<br />
mov bh,00<br />
mov bh,0ah<br />
MOV CX,0<br />
MOV DX,184FH<br />
INT 10H<br />
ENDM<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
SHOW_INSCREEN MACRO STRING<br />
MOV AH,09<br />
MOV DX,OFFSET STRING<br />
INT 21H<br />
ENDM<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
PINS_OUT MACRO SEND<br />
MOV CX,SEND<br />
;AND CL,0fh<br />
;OR CL,CONSTANTBCD<br />
MOV DX,378H<br />
MOV AL,OFFSET SEND<br />
OUT DX,AL<br />
ENDM<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
;PROGRAM STARTS FROM THIS POINT<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
.MODEL HUGE<br />
.STACK 2000<br />
.DATA<br />
INSTMSG1 DB &#8216;INTRUCTIONS:&#8217;,'$&#8217;<br />
INSTMSG2 DB &#8216;SPEED UP: W&#8217;,'$&#8217;<br />
INSTMSG3 DB &#8216;SPEED DOWN: S&#8217;,'$&#8217;<br />
INSTMSG4 DB &#8216;FORWARD: D&#8217;,'$&#8217;<br />
INSTMSG5 DB &#8216;BACKWARD: A&#8217;,'$&#8217;<br />
INSTMSG6 DB &#8217;7 SEGMENT TEST: T BUTTON&#8217;,'$&#8217;<br />
INSTMSG7 DB &#8216;EXIT: E BUTTON&#8217;,'$&#8217;<br />
INSTMSG8 DB &#8216;PRESS B BUTTON TO MAIN MENU&#8217;,'$&#8217;<br />
INSTMSG9 DB &#8216;PAUSE: P&#8217;,'$&#8217;<br />
H_SYMBOL DB &#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8217;,'$&#8217;<br />
MSG1 DB &#8216;PROJECT : STEPPER CONTROLLER WITH 7 SEGMENT DISPLAY&#8217;,'$&#8217;<br />
MSG2 DB &#8216;LECTURE : MICROPROCESSORS [LECTURER : HOSSEIN MEHRABANI]&#8216;,&#8217;$&#8217;<br />
MSG3 DB &#8216;CODING  : SAMET KILICTAS [NO -&gt; 20040283] [CYPRUS INTERNATIONAL UNIVERSITY]&#8216;,&#8217;$&#8217;<br />
MSG4 DB &#8216;MOTOR STATUS :&#8217;,'$&#8217;<br />
MSG5 DB &#8216;PRESS H BUTTON FOR INSTRUCTIONS&#8230;&#8217;,'$&#8217;<br />
MSG6 DB &#8216;DIRECTION :  ?&#8217;,'$&#8217;<br />
MSG7 DB &#8216;SPEED  : ?&#8217;,'$&#8217;<br />
MSG8 DB &#8216;EMAIL   : samet@kilictas.com&#8217;,'$&#8217;<br />
MSG9 DB &#8216;Good Bye..! <img src='http://samet.kilictas.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> &#8217;,'$&#8217;<br />
MSG_DELETE DB &#8216;?                                 &#8216;,&#8217;$&#8217;<br />
MSG10 DB &#8217;7 SEGMENT TEST MODE: ?&#8217;,'$&#8217;<br />
MSG11 DB &#8216;ON &#8216;,&#8217;$&#8217;<br />
MSG12 DB &#8216;OFF&#8217;,'$&#8217;<br />
STARTED DB &#8216;RUNNING, PLEASE WAIT!&#8217;,'$&#8217;<br />
STOPPED DB &#8216;STOPPED!                &#8216;,&#8217;$&#8217;<br />
DIRECTION_FORWARD DB &#8216;Clockwise          &#8216;,&#8217;$&#8217;<br />
DIRECTION_BACKWARD DB &#8216;Counter Clockwise&#8217;,'$&#8217;<br />
DIRECTION_SIDE DB 1<br />
INTSCREEN_MODE DB 1                ; Default is forward<br />
COUNT DB 20 ; How many step u need ?????? <img src='http://samet.kilictas.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
CONSTANTBCD DB 00010000B<br />
SHOWSPEED DB 0<br />
zero DB    &#8217;1 -&gt; 1000MS DELAY&#8217;,'$&#8217;<br />
one DB &#8217;2 -&gt; 800MS DELAY &#8216;,&#8217;$&#8217;<br />
two DB &#8217;3 -&gt; 700MS DELAY &#8216;,&#8217;$&#8217;<br />
three DB &#8217;4 -&gt; 600MS DELAY &#8216;,&#8217;$&#8217;<br />
four DB    &#8217;5 -&gt; 500MS DELAY &#8216;,&#8217;$&#8217;<br />
five DB    &#8217;6 -&gt; 400MS DELAY &#8216;,&#8217;$&#8217;<br />
six DB &#8217;7 -&gt; 300MS DELAY &#8216;,&#8217;$&#8217;<br />
seven DB &#8217;8 -&gt; 200MS DELAY &#8216;,&#8217;$&#8217;<br />
eight DB &#8217;9 -&gt; 100MS DELAY &#8216;,&#8217;$&#8217;<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
.CODE<br />
MAIN:    MOV AX,@DATA<br />
MOV DS,AX</p>
<p>;*********************************<br />
; Show main screen</p>
<p>MAINSCREEN:<br />
CLS_SCREEN<br />
CURS_POSITION 2,2<br />
SHOW_INSCREEN MSG1<br />
CURS_POSITION 3,2<br />
SHOW_INSCREEN MSG2<br />
CURS_POSITION 4,2<br />
SHOW_INSCREEN MSG3<br />
CURS_POSITION 5,2<br />
SHOW_INSCREEN MSG8<br />
CURS_POSITION 12,2<br />
SHOW_INSCREEN MSG4<br />
CURS_POSITION 13,2<br />
SHOW_INSCREEN H_SYMBOL<br />
CURS_POSITION 14,2<br />
SHOW_INSCREEN MSG6<br />
CURS_POSITION 15,2<br />
SHOW_INSCREEN MSG7<br />
CURS_POSITION 16,2<br />
SHOW_INSCREEN MSG10<br />
CURS_POSITION 22,2<br />
SHOW_INSCREEN MSG5<br />
CURS_POSITION 30,2<br />
MOV INTSCREEN_MODE,1</p>
<p>;*****************************************************************<br />
; Important jump point is here **********************************</p>
<p>CHECKPOINT:</p>
<p>; Get input from the keyboard<br />
MOV AH,07<br />
INT 21H</p>
<p>; Save the input<br />
MOV BL,AL ; Save AL to BL (i.e. The Ascii value of the key hit)</p>
<p>; Check the input character ?????  What i should do ????<br />
CMP BL,&#8217;H'    ;H Button<br />
JNE H1<br />
JMP INSTSCREEN<br />
H1:    CMP BL,&#8217;h&#8217;<br />
JNE H2<br />
JMP INSTSCREEN<br />
H2:    CMP BL,&#8217;P'    ;P Button<br />
JNE P1<br />
JMP PAUSE<br />
P1:    CMP BL,&#8217;p&#8217;<br />
JNE P2<br />
JMP PAUSE<br />
P2:    CMP BL,&#8217;E'    ;E Button<br />
JNE E1<br />
JMP GOODBYE<br />
E1:    CMP BL,&#8217;e&#8217;<br />
JNE E2<br />
JMP GOODBYE<br />
E2:    CMP BL,&#8217;B'    ;B Button<br />
JNE B1<br />
JMP MAINSCREEN<br />
B1:    CMP BL,&#8217;b&#8217;<br />
JNE B2<br />
JMP MAINSCREEN<br />
B2:    CMP BL,&#8217;W'    ;W Button<br />
JNE W1<br />
JMP SPEEDUP<br />
W1:    CMP BL,&#8217;w&#8217;<br />
JNE W2<br />
JMP SPEEDUP<br />
W2:    CMP BL,&#8217;S'    ;S Button<br />
JNE S1<br />
JMP SPEEDDOWN<br />
S1:    CMP BL,&#8217;s&#8217;<br />
JNE S2<br />
JMP SPEEDDOWN<br />
S2:    CMP BL,&#8217;D'    ;D Button<br />
JNE D1<br />
JMP FORWARD<br />
D1:    CMP BL,&#8217;d&#8217;<br />
JNE D2<br />
JMP FORWARD<br />
D2:    CMP BL,&#8217;A'    ;A Button<br />
JNE A1<br />
JMP BACKWARD<br />
A1:    CMP BL,&#8217;a&#8217;<br />
JNE A2<br />
JMP BACKWARD<br />
A2:    CMP BL,&#8217;T'    ;T Button<br />
JNE T1<br />
JMP SEGMENTTEST<br />
T1:    CMP BL,&#8217;t&#8217;<br />
JNE M<br />
JMP SEGMENTTEST</p>
<p>; If no key exists jump to the mainscreen..!<br />
M:    JMP CHECKPOINT</p>
<p>;*********************************<br />
; Show instruction screen</p>
<p>INSTSCREEN:<br />
CLS_SCREEN<br />
CURS_POSITION 2,2<br />
SHOW_INSCREEN INSTMSG1<br />
CURS_POSITION 3,2<br />
SHOW_INSCREEN H_SYMBOL<br />
CURS_POSITION 4,2<br />
SHOW_INSCREEN INSTMSG2<br />
CURS_POSITION 5,2<br />
SHOW_INSCREEN INSTMSG3<br />
CURS_POSITION 6,2<br />
SHOW_INSCREEN INSTMSG4<br />
CURS_POSITION 7,2<br />
SHOW_INSCREEN INSTMSG5<br />
CURS_POSITION 8,2<br />
SHOW_INSCREEN INSTMSG6<br />
CURS_POSITION 9,2<br />
SHOW_INSCREEN INSTMSG7<br />
CURS_POSITION 10,2<br />
SHOW_INSCREEN INSTMSG9<br />
CURS_POSITION 15,2<br />
SHOW_INSCREEN INSTMSG8<br />
CURS_POSITION 50,50<br />
MOV INTSCREEN_MODE,2<br />
MOV AL,00<br />
JMP CHECKPOINT</p>
<p>;*********************************<br />
;All system paused</p>
<p>PAUSE:<br />
PINS_OUT 11110000B<br />
CURS_POSITION 16,25<br />
SHOW_INSCREEN MSG12<br />
CURS_POSITION 50,50<br />
JMP CHECKPOINT</p>
<p>;*********************************<br />
; Speed up</p>
<p>SPEEDUP:<br />
CMP SHOWSPEED,8<br />
JE NOG<br />
ADD SHOWSPEED,1<br />
NOG:    CMP SHOWSPEED,0<br />
JNE aaaa<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN zero<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,00010000B<br />
PINS_OUT 00010000B<br />
JMP NOU<br />
aaaa:    CMP SHOWSPEED,1<br />
JNE qqq<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN one<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,00100000B<br />
PINS_OUT 00100000B<br />
JMP NOU<br />
qqq:    CMP SHOWSPEED,2<br />
JNE www<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN two<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,00110000B<br />
PINS_OUT 00110000B<br />
JMP NOU<br />
www:    CMP SHOWSPEED,3<br />
JNE eee<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN three<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,01000000B<br />
PINS_OUT 01000000B<br />
JMP NOU<br />
eee:    CMP SHOWSPEED,4<br />
JNE rrr<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN four<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,01010000B<br />
PINS_OUT 01010000B<br />
JMP NOU<br />
rrr:    CMP SHOWSPEED,5<br />
JNE ttt<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN five<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,01100000B<br />
PINS_OUT 01100000B<br />
JMP NOU<br />
ttt:    CMP SHOWSPEED,6<br />
JNE yyy<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN six<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,01110000B<br />
PINS_OUT 01110000B<br />
JMP NOU<br />
yyy:    CMP SHOWSPEED,7<br />
JNE uuu<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN seven<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,10000000B<br />
PINS_OUT 10000000B<br />
JMP NOU<br />
uuu:    CMP SHOWSPEED,8<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN eight<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,10010000B<br />
PINS_OUT 10010000B<br />
NOU:<br />
JMP CHECKPOINT</p>
<p>;*********************************<br />
; Speed down</p>
<p>SPEEDDOWN:<br />
CMP SHOWSPEED,0<br />
JE NOGG<br />
SUB SHOWSPEED,1<br />
NOGG:    CMP SHOWSPEED,0<br />
JNE aaaaa<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN zero<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,00010000B<br />
PINS_OUT 00010000B<br />
JMP NOUU<br />
aaaaa:    CMP SHOWSPEED,1<br />
JNE qqqq<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN one<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,00100000B<br />
PINS_OUT 00100000B<br />
JMP NOUU<br />
qqqq:    CMP SHOWSPEED,2<br />
JNE wwww<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN two<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,00110000B<br />
PINS_OUT 00110000B<br />
JMP NOUU<br />
wwww:    CMP SHOWSPEED,3<br />
JNE eeee<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN three<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,01000000B<br />
PINS_OUT 01000000B<br />
JMP NOUU<br />
eeee:    CMP SHOWSPEED,4<br />
JNE rrrr<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN four<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,01010000B<br />
PINS_OUT 01010000B<br />
JMP NOUU<br />
rrrr:    CMP SHOWSPEED,5<br />
JNE tttt<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN five<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,01100000B<br />
PINS_OUT 01100000B<br />
JMP NOUU<br />
tttt:    CMP SHOWSPEED,6<br />
JNE yyyy<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN six<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,01110000B<br />
PINS_OUT 01110000B<br />
JMP NOUU<br />
yyyy:    CMP SHOWSPEED,7<br />
JNE uuuu<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN seven<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,10000000B<br />
PINS_OUT 10000000B<br />
JMP NOUU<br />
uuuu:    CMP SHOWSPEED,8<br />
CURS_POSITION 15,11<br />
SHOW_INSCREEN eight<br />
CURS_POSITION 50,50<br />
MOV CONSTANTBCD,10010000B<br />
PINS_OUT 10010000B<br />
NOUU:<br />
JMP CHECKPOINT</p>
<p>;*********************************<br />
; Show me the step pleasee&#8230;.</p>
<p>;Forward &#8212;<br />
STF:    MOV COUNT,20<br />
STEPSF:    CALL DELAY<br />
PINS_OUT 10100011B<br />
CALL DELAY<br />
PINS_OUT 11110110B<br />
CALL DELAY<br />
PINS_OUT 10101100B<br />
CALL DELAY<br />
PINS_OUT 11111001B<br />
DEC COUNT<br />
CMP COUNT,0<br />
JE F<br />
LOOP STEPSF<br />
F:    CURS_POSITION 12,18<br />
SHOW_INSCREEN STOPPED<br />
CURS_POSITION 14,15<br />
SHOW_INSCREEN MSG_DELETE<br />
CURS_POSITION 50,50<br />
JMP CHECKPOINT<br />
RET</p>
<p>;Backward &#8212;</p>
<p>STB:    MOV COUNT,20<br />
STEPSB:    CALL DELAY<br />
PINS_OUT 10111001B<br />
CALL DELAY<br />
PINS_OUT 11111100B<br />
CALL DELAY<br />
PINS_OUT 10110110B<br />
CALL DELAY<br />
PINS_OUT 11110011B<br />
DEC COUNT<br />
CMP COUNT,0<br />
JE B<br />
LOOP STEPSB<br />
B:    CURS_POSITION 12,18<br />
SHOW_INSCREEN STOPPED<br />
CURS_POSITION 14,15<br />
SHOW_INSCREEN MSG_DELETE<br />
CURS_POSITION 50,50<br />
JMP CHECKPOINT<br />
RET</p>
<p>;*********************************<br />
; System little forward please</p>
<p>FORWARD:<br />
MOV DIRECTION_SIDE,1<br />
CURS_POSITION 14,15<br />
SHOW_INSCREEN DIRECTION_FORWARD<br />
CURS_POSITION 12,18<br />
SHOW_INSCREEN STARTED<br />
CURS_POSITION 50,50<br />
CALL STF<br />
JMP CHECKPOINT</p>
<p>;*********************************<br />
; System little backward please</p>
<p>BACKWARD:<br />
MOV DIRECTION_SIDE,2<br />
CURS_POSITION 14,15<br />
SHOW_INSCREEN DIRECTION_BACKWARD<br />
CURS_POSITION 12,18<br />
SHOW_INSCREEN STARTED<br />
CURS_POSITION 50,50<br />
CALL STB<br />
JMP CHECKPOINT</p>
<p>;*********************************<br />
; Test the 7 segment display</p>
<p>SEGMENTTEST:<br />
PINS_OUT 10000000B<br />
CURS_POSITION 16,25<br />
SHOW_INSCREEN MSG11<br />
CURS_POSITION 50,50<br />
JMP CHECKPOINT</p>
<p>;*********************************<br />
; Delay routines &#8230;. which u need it fot stepper motor steps</p>
<p>DELAY:    CMP SHOWSPEED,0<br />
JNE aa<br />
MOV CX,65535<br />
JMP NO<br />
aa:    CMP SHOWSPEED,1<br />
JNE qq<br />
MOV CX,53032<br />
JMP NO<br />
qq:    CMP SHOWSPEED,2<br />
JNE ww<br />
MOV CX,46403<br />
JMP NO<br />
ww:    CMP SHOWSPEED,3<br />
JNE ee<br />
MOV CX,39774<br />
JMP NO<br />
ee:    CMP SHOWSPEED,4<br />
JNE rr<br />
MOV CX,33145<br />
JMP NO<br />
rr:    CMP SHOWSPEED,5<br />
JNE tt<br />
MOV CX,26516<br />
JMP NO<br />
tt:    CMP SHOWSPEED,6<br />
JNE yy<br />
MOV CX,19887<br />
JMP NO<br />
yy:    CMP SHOWSPEED,7<br />
JNE uu<br />
MOV CX,13258<br />
JMP NO<br />
uu:    CMP SHOWSPEED,8<br />
MOV CX,6629</p>
<p>NO:<br />
CALL WAITF<br />
RET</p>
<p>WAITF:    PUSH AX<br />
WAITF1:<br />
IN    AL,61H<br />
AND    AL,10H<br />
CMP    AL,AH<br />
JE    WAITF1<br />
MOV    AH,AL<br />
LOOP    WAITF1<br />
POP    AX<br />
RET<br />
SUB CX,CX<br />
RET</p>
<p>;*********************************<br />
; Print the good bye message</p>
<p>GOODBYE:<br />
CLS_SCREEN<br />
CURS_POSITION 15,25<br />
SHOW_INSCREEN MSG9<br />
CURS_POSITION 30,25<br />
PINS_OUT 11110000B<br />
MOV AH,4CH<br />
INT 21H<br />
END MAIN</p></blockquote>
<a href='http://twitter.com/share?url=http%3A%2F%2Fsamet.kilictas.com%2F%3Fp%3D107&count=vertical&related=&text=Assembly%20Tutorials' class='twitter-share-button' data-text='Assembly Tutorials' data-url='http://samet.kilictas.com/?p=107' data-counturl='http://samet.kilictas.com/assembly-tutorials-program-controlling-dc-motor-and-stepper-motor-from-parallel-port/' data-count='vertical' data-via='sametkilictas'>Tweet</a>]]></content:encoded>
			<wfw:commentRss>http://samet.kilictas.com/assembly-tutorials-program-controlling-dc-motor-and-stepper-motor-from-parallel-port/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

