Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 12th, 2007, 09:20 PM
Registered User
 
Join Date: Jun 2007
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
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

please can anyone help me out






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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.