Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Other Programming > Assembly Language
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Assembly Language section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 12th, 2007, 09:20 PM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default assembly code help

i have this code that does the following
;The following program, in assembly language of the pic16f84A microcontroller, configures the three
; lower pins of PORTA(RA0, RA1 and RA2) as inputs, and the pins of PORTB as output. The program then
;enters a non-terminating loop. in the loop program read the three input lines, interpret the input as
;a 3 bit binary value(RA0 as the least significant bit), and make PORTB line corresponding to the
;input value 'on' by outputting the value '1' on this line.
;All other output lins must remain '0'.
the code is
#DEFINE PAGE0 BCF 0x03,5
#DEFINE PAGE1 BSF 0x03,5

PCL: EQU 0x02
STATUS: EQU 0x03
PORTA: EQU 0x05
TRISA: EQU 0x05
PORTB: EQU 0x06
TRISB: EQU 0x06

W: EQU 0
F: EQU 1

    ORG 0x0
    goto MAIN
    org 5

MAIN:
    clrf PORTA
    clrf PORTB
    PAGE1
    movlw B'00000111'
    iorwf TRISA,F ;RA0-RA2 as input
    clrf TRISB ;Port B0-B7 as output
    PAGE0

LOOPX:
    movf PORTA, W
    andlw B'00000111'
    call TABLE
    movfw PORTB
    goto LOOPX

TABLE:
    addwf PCL, F
    retlw B'00000001'
    retlw B'00000010'
    retlw B'00000100'
    retlw B'00001000'
    retlw B'00010000'
    retlw B'00100000'
    retlw B'01000000'
    retlw B'10000000'

    END
iam wondering if anyone can help to modify the above code so it does following
the qestion is
in this question. de-multiplexer has an input line, pinRB0, and four output
lines, output0 to output3, which are, respectively, the pins RA0-RA3. the
demultiplexer copies the digital signal appearing on the input line on to one of
the four output lines. The output line is selected by a two bit
selection code input on the pins RB1 and RB2
END OF QUESTION......................Code this in assembly

Please reply soon: smsrks2007@gmail.com



  #2 (permalink)  
Old June 20th, 2007, 05:34 AM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

please can anyone help me out

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASSEMBLY CODE angelboy C# 2005 3 March 13th, 2007 01:20 PM
Converting .NET 2.0 Assembly to .Net 1.x Assembly pskaushik .NET Framework 2.0 1 November 25th, 2006 01:51 PM
assembly sreenu.pocha C# 4 July 26th, 2006 07:31 AM
Assembly arv1980 .NET Framework 2.0 1 January 15th, 2006 02:12 PM



All times are GMT -4. The time now is 03:59 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.