Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1

    Default Help assembly language


    mga kuya, pwede ko patabang sa among project sa assembly? gihatagan mo ug 3 ka program sa amu teacher, dapat daw amu isumpay.

    STEPPER MOTOR:
    Code:
    #start=stepper_motor.exe#
    
    
    
    name "stepper"
    
    
    #make_bin#
    
    
    steps_before_direction_change = 20h ; 32 (decimal)
    
    
    jmp start
    
    
    ; ========= data ===============
    
    
    ; bin data for clock-wise
    ; half-step rotation:
    datcw    db 0000_0110b
             db 0000_0100b    
             db 0000_0011b
             db 0000_0010b
    
    
    ; bin data for counter-clock-wise
    ; half-step rotation:
    datccw   db 0000_0011b
             db 0000_0001b    
             db 0000_0110b
             db 0000_0010b
    
    
    
    
    ; bin data for clock-wise
    ; full-step rotation:
    datcw_fs db 0000_0001b
             db 0000_0011b    
             db 0000_0110b
             db 0000_0000b
    
    
    ; bin data for counter-clock-wise
    ; full-step rotation:
    datccw_fs db 0000_0100b
              db 0000_0110b    
              db 0000_0011b
              db 0000_0000b
    
    
    
    
    start:
    mov bx, offset datcw ; start from clock-wise half-step.
    mov si, 0
    mov cx, 0 ; step counter
    
    
    next_step:
    ; motor sets top bit when it's ready to accept new command
    wait:   in al, 7     
            test al, 10000000b
            jz wait
    
    
    mov al, [bx][si]
    out 7, al
    
    
    inc si
    
    
    cmp si, 4
    jb next_step
    mov si, 0
    
    
    inc cx
    cmp cx, steps_before_direction_change
    jb  next_step
    
    
    mov cx, 0
    add bx, 4 ; next bin data
    
    
    cmp bx, offset datccw_fs
    jbe next_step
    
    
    mov bx, offset datcw ; return to clock-wise half-step.
    
    
    jmp next_step
    THERMOMETER:
    Code:
    #start=thermometer.exe#
    
    ; temperature rises fast, thus emulator should be set to run at the maximum speed.
    
    
    ; if closed, the thermometer window can be re-opened from emulator's "virtual devices" menu.
    
    
    
    
    
    
    #make_bin#
    
    
    name "thermo"
    
    
    ; set data segment to code segment:
    mov ax, cs
    mov ds, ax
    
    
    start:
    
    
    in al, 125
    
    
    cmp al, 60
    jl  low
    
    
    cmp al, 80
    jle  ok
    jg   high
    
    
    low:
    mov al, 1
    out 127, al   ; turn heater "on".
    jmp ok
    
    
    high:
    mov al, 0
    out 127, al   ; turn heater "off". 
    
    
    ok:
    jmp start   ; endless loop.
    LED:
    Code:
    #start=led_display.exe#
    
    
    
    #make_bin#
    
    
    name "led"
    
    
    mov ax, 1234
    out 199, ax
    
    
    mov ax, -5678
    out 199, ax
    
    
    ; Eternal loop to write
    ; values to port:
    mov ax, 0
    x1:
      out 199, ax  
      inc ax
    jmp x1
    
    
    hlt
    mao ni ang problem:
    Assume that you have a fan (represented by the stepper motor) with the speed modes Low, Med, and High. Control the speed of the fan depending on the temperature on the thermometer. If it is very hot, then the fan should be set to High. Change the mode according to the reflected temperature. If it is colder than 10 degrees, the fan should be turned off. Use the heater for raising the temperature. Add the LED display to write out the current temperature on the thermometer.

    willing mi mubayad, ayaw lang nang dako kay istudyante pa mi. hehe.

  2. #2

    Default Re: Help assembly language

    kinsa ngcode ani bro for thermo, LED display and stepper motor?

    ask lng ko ni ntest na tanan ang codes nga ghatag sa inyo?

    better test it tagsa2x before pursue sa coding(iusa ang tanan)..and if nksabot ka sa ghatag nga codes maau...

    ky sa ako tan-aw, dli sd sayun ang iya gphimo..

    Actually, one way to test ana nga program is to have in embed in PLC, using programmer/circuit depend on the PLC type u gusto gamitun..naa na source ana sa net..

  3. #3

    Default Re: Help assembly language

    actually kay sa emu8086 na niya gikuha na code bro. nya ana xa na isumpay daw.
    mao lage, clueless jud kay mi ani na project.
    unsay diay nang PLC? wala jud mi idea. T.T

  4. #4

    Default Re: Help assembly language

    ah ok sa emu8086 microprocessor diay ni..

    PIC-programmable interface controller na boss..

    ok ra man na ky since the emu8086 ky naa man I/O na ang system(interface for ur PC, pwd sa imo parallel /serial port ipaagi ang output)..so pwd ra xa dayun ddto sample sa imo breadboard from output unit..

    i suggest try sa mo ug pasiga LED lng sa 3 ka program-to your dummy breadboard..before ninyo na i-usa ang programs..

    as i checked sa program, virtual device lng diay within emulator ang thermo..heheh..abe nko manual pa kuha sa reading..

    so dual output mo ani, screen(thermo) and interface(LED and stepper motor)....

    utilize lng cguro ang 8 bit address sa port(4 bit sa LED and 4 bit sa stepper motor)..

    sample(para sa half step):
    db 0000_0110b
    db 0000_0100b
    db 0000_0011b
    db 0000_0010b

    instead mao ni iya output(combination to LED)..

    db 0001_0110b
    db 0001_0100b
    db 0001_0011b
    db 0001_0010b

    design lng ug data combination(1's and 0's) para sa LED and stepper motor pareha sa taas..

  5. #5

    Default Re: Help assembly language

    wala man mi iconnect na mga hardware bro. virtual devices man lang amu gamiton. hehe. sige2, amu itry na imong advice. i'll post for any updates.

  6. #6

    Default Re: Help assembly language

    sa emu8086 ra ni padagon ilang code kay naa na man virtual devices nga built-in sa emulator (thermometer - port 125, heater - port 127, led display - port 199, stepper motor - port 7) plus wa pa jud sila idea unsay PLC

  7. #7

    Default Re: Help assembly language

    sakto ni nga solution sa problem? http://www.youtube.com/watch?v=mHvMEYA61mw&hd=1

    EDIT:
    since wa man gi-specify unsay range sa temperature para sa low, med, high - nagbuot2x nlang kog akoa anyway dali ra man ya na usbon...

    10 degrees to 30 degrees = low
    30 degrees to 50 degrees = med
    50 degrees to 70 degrees = high

    then automatic on/off ang heater para mosaka/kanaog pud ang temperature reading sa thermometer.

    according sa problem, ma-off ang stepper motor kung ubos na sa 10 degrees. ako nlang pud gi-on balik kung molapas na pud siya ug 10 degrees para demonstrate nga nag-andar na pud ang motor once mosaka na pud balik ang temp reading above 10 degrees.

  8. #8

    Default Re: Help assembly language

    yeah i checked the emu8086..built in na diay tanan..

    then it would be easy na man lng ky purely reading na lng ka output from this built-ins and used this output to manipulate in the program..

    good luck sa coding..

    my advice: sabta lng sa dagan sa ghatag nga code labi na sa mga registers and address nga ggamit..lisud2x baya na para sa ako sa una sa college pko ang assebly..

  9. #9

    Default Re: Help assembly language

    willing ko mo pay !!! i need the code today!! pls.....

  10. #10

    Default Re: Help assembly language

    add me in FB maddilex_90@yahoo.com!!!

  11.    Advertisement

Page 1 of 2 12 LastLast

Similar Threads

 
  1. help!configuring textpad for assembly language
    By cute_6423 in forum Programming
    Replies: 5
    Last Post: 09-29-2012, 06:02 PM
  2. assembly language Need help :D
    By matiasaznar in forum Programming
    Replies: 9
    Last Post: 11-03-2011, 09:39 PM
  3. help on assembly language
    By wailer in forum Programming
    Replies: 2
    Last Post: 04-30-2010, 11:30 AM
  4. Project Help with Assembly Language.
    By hakkai999 in forum Programming
    Replies: 1
    Last Post: 10-08-2009, 07:05 AM
  5. nid help for assembly language prog..
    By tanilong in forum Programming
    Replies: 1
    Last Post: 02-23-2006, 02:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top