EASy68K  
It is currently Sun Dec 16, 2018 12:03 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sun Nov 07, 2010 10:45 pm 
Offline

Joined: Sat Oct 30, 2010 1:36 am
Posts: 4
Location: Malaysia
Hi

My name is Amy, i want to ask help from everyone. I need to write an assembly program entitle password entering by using keypad and the result will be displayed at LCD display. Hope everybody can help me ... Grateful for everything. Thanks


Top
 Profile  
 
PostPosted: Mon Nov 08, 2010 1:09 am 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
amy87 wrote:
I need to write an assembly program entitle password entering by using keypad and the result will be displayed at LCD display.

Hi Amy,

Please post the code you have written so far, as I don't think anyone here is answering homework assignments. Or frame the question around aspects of the task which you are having specific problems with.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 08, 2010 6:46 am 
Offline

Joined: Sat Oct 30, 2010 1:36 am
Posts: 4
Location: Malaysia
Hi

Thanks for soon reply. Act it is not my home assignment, it is my final University project. I not sure about the string code .

Here i attach my code , hope can help me so far.

some part from my program because the whole program is tooo long. I not sure aout the password compared and string sent to LCD display.

* KEYPAD SCANNING for one key
KEY1 MOVE D0, D1
BCLR #3, OUT
MOVE KEYPAD_INP, D0
AND #$0F,D0
CMP #$77, D0
BNE N1
MOVE #'1',D1
JSR DATAWRITE1
JSR DELAY1
N1 CMP #$7B, D0
BNE N2
MOVE #'2',D1
JSR DATAWRITE1
JSR DELAY1
N2 CMP #$7D, D0
BNE N3
MOVE #'3',D1
JSR DATAWRITE1
JSR DELAY1
N3 CMP #$7E, D0
BNE N4
MOVE #'A',D1
JSR DATAWRITE1
JSR DELAY1
N4 JSR DELAY1
BSET #3, OUT
RTS



*******************************************
MOVE #'N', D0
JSR DATAWRITE
NOP
MOVE #'U',D0
JSR DATAWRITE
NOP
MOVE #'M',D0
JSR DATAWRITE
NOP
* Izzit we can direct send the string by using such as #'S' to the address? Or need also changed it to ascii code?

Thanks for everything.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 08, 2010 7:56 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
The keypad code is problematic because you mask off bits you want to use/compare later. You'll need to review how you are supposed to read the keypad. I've rationalized the code some what, so that it exits and performs common code after it gets a match.

Code:
* KEYPAD SCANNING for one key
KEY1    MOVE D0, D1
    BCLR #3, OUT
    MOVE KEYPAD_INP, D0

    AND #$0F,D0  * ??? If you mask with $0F it will never pass $77,$7B,etc

    CMP #$77, D0    * $77 -> '1'
    BNE N1

    MOVE #'1',D1
    BRA X1

N1    CMP #$7B, D0    * $7B -> '2'
    BNE N2

    MOVE #'2',D1
    BRA X1

N2    CMP #$7D, D0    * $7C -> '3'
    BNE N3

    MOVE #'3',D1
    BRA X1

N3    CMP #$7E, D0    * $7E -> 'A'
    BNE N4

    MOVE #'A',D1

X1    JSR DATAWRITE1 * Common code
N4    JSR DELAY1
    BSET #3, OUT
    RTS


The output string can be done as a subroutine
Code:
   LEA   num,A0
   BSR   OUTSTR

   ...

OUTSTR   MOVE.B   (A0)+,D0
   BEQ   OUTDONE
   JSR   DATAWRITE
   NOP
   BRA   OUTSTR
OUTDONE   RTS

   ...

num   dc.b   'NUM',0


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 11, 2010 4:39 am 
Offline

Joined: Sat Oct 30, 2010 1:36 am
Posts: 4
Location: Malaysia
Thanks for the commment. If i dont want use subroutine for the string , is it possible?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 11, 2010 6:05 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
amy87 wrote:
Thanks for the comment. If i dont want use subroutine for the string , is it possible?


You are free to implement your project however you choose. However it is generally more efficient to use subroutines to contain and compartmentalize repetitive code of this nature. It might help showcase your assembly programming skills, and structured design, as the use of 68K is not very prevalent in the commercial world in 2010.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group