question

Discussion in 'Programmer's Corner' started by 4ndr3c03lh0, Nov 4, 2010.

  1. 4ndr3c03lh0

    Thread Starter New Member

    Jun 3, 2010
    7
    0
    Anyone here can help me a project in assembly language?
     
  2. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    Maybe, there are a lot of types of assembler, could you elaborate?
     
  3. 4ndr3c03lh0

    Thread Starter New Member

    Jun 3, 2010
    7
    0
    Wanted to implement a driver hits the car park ..
    Have to present on Port A (bits 0 to 3) the number of seats available in the park (originally 9).
    She also has two traffic lights to control the entrance: red in PA1 and green in PA0 .. When the park is full the traffic light turns red, but while there are free places the green traffic light is lit..
     
  4. 4ndr3c03lh0

    Thread Starter New Member

    Jun 3, 2010
    7
    0
    I work in AVRStudio .. And what is the AT90S8515 Microcontroller
     
  5. 4ndr3c03lh0

    Thread Starter New Member

    Jun 3, 2010
    7
    0
    This is the code that I've done:

    .include"8515def.inc"

    .org $0000
    rjmp inicio
    .org $0001
    rjmp atint0
    .org$ 0002
    rjmp atint1
    .org $0007
    rjmp attim0
    .org $0009
    rjmp atps

    inicio:
    ldi r16, low(ramend)
    out spl, r16
    ldi r16, high(ramend)
    out sph, r16
    ldi r16, 0x80
    out ddra, r16
    ldi r16, 0x0C
    out portd, r16
    swap r16
    out gimsk, r16
    ldi r16, 0x0E
    out mcucr, r16
    ldi r16, 0
    out tcnt0, r16
    ldi r16, 0x05
    out tccr0, r16
    ldi r16, 0x02
    out timsk, r16
    ldi r16, 51
    out ubbr, r16
    ldi r16, 0x88
    out ucr, r16
    ldi r17, 94
    ldi r18,0x09
    ldi r19, 0x00
    sei

    atint1:
    rcall ENTRAOUSAI

    RETI

    ENTRAOUSAI:
    dec r18
    cpse r18, r19
    rjmp VERDE
    rjmp VERMELHO


    VERDE:
    out porta, r18
    sbi porta, 4

    VERMELHO:
    out porta, r18
    sbi porta, 5
     
Loading...