Chirurgia cranio-cerebrală minim invazivă
Tehnicile minim invazive impun utilizarea unei tehnologii ultramoderne. Endoscoapele operatorii de diverse tipuri, microscopul operator dedicat, neuronavigația, neuroelectrofiziologia, tehnicile avansate de anestezie, chirurgia cu pacientul treaz reprezintă armamentarium fără de care neurochirurgia prin "gaura cheii" nu ar fi posibilă. Folosind tehnicile de mai sus, tratăm un spectru larg de patologii cranio-cerebrale. www.neurohope.ro |
AVR Studio (asembler)
Last Updated: Aug 04 2008 02:12, Started by
dragos_22
, May 19 2008 10:37
·
0
#1
Posted 19 May 2008 - 10:37
buna,
am si eu o problemuta...vreau sa fac niste inmultiri si impartiri..in asembler..si nu prea gasesc exemple..... stie cineva unde as putea gasi..niste rutine..sa inteleg si eu cum se fac... mersi mult |
#3
Posted 20 May 2008 - 08:25
mov ecx, asize
mov eax, acnt imul ecx ; multiply count by BYTE size for string memory length mov lpmem, alloc(eax) ; allocate string memory asize,acnt si lpmem sunt variabile dublu word(32 biti) vezi helpul din pachetul masm32 +easycode de aici http://www.easycode.cat/
Edited by ciuly, 20 May 2008 - 19:43.
|
#4
Posted 20 May 2008 - 10:05
#5
Posted 20 May 2008 - 19:45
dragos_22, on May 19 2008, 11:37, said: buna, am si eu o problemuta...vreau sa fac niste inmultiri si impartiri..in asembler..si nu prea gasesc exemple..... stie cineva unde as putea gasi..niste rutine..sa inteleg si eu cum se fac... mersi mult Well... AVR nu e chiar ce crezi tu. AVR e ceva intre C si assembler, folosit pt programarea microcontroalelor. Instructiunile seamana cu assembler... dar nu e chiar acelasi lucru. incearca nasm, masm sau tasm. Asta e ce vrei tu. Parerea mea e sa incepi cu tasm... |
#6
Posted 21 May 2008 - 23:05
Am sa raspund la cazul general:
Eu lucrez PIC, daca reusiti sa le adaptati pentru AVR: ; Cam asta e tot ce pot sa va ajut daca reusiti sa scrieti in cod AVR algoritmul e acelasi ; Explic si catea instructiuni ; Inmultire ; Variables CBLOCK 0x020 Product:2 ; Finished Result Multiplicand, Multiplier:2 ; Values for Processing ; se definesc 2 variabile ENDC PAGE ; Mainline of Multiply org 0 ; inceput clrf Product ; Initialize Variables Product <- 0, starge valoarea variabilei clrf Product + 1 ; si urmatorul octet dupa el movlw 47 ; Value1 <- 47 ; face W<-47 da valoare lui W movwf Multiplier ; Multiplier <-W Pune valoarea lui W in Multiplier clrf Multiplier + 1 movlw 35 ; Value2 <- 35 movwf Multiplicand Loop: rrf Multiplicand, f ; Shift Down Multiplicand, Carry Loaded with LSB btfss STATUS, C ; Bit test file skip if set; tsteaza daca apare Carry, daca da nu eceuta urmatoarea instructiune goto AddSkip ; LSB was Zero, Skip Over Adding. movf Multiplier + 1, w ; Add MSByte First addwf Product + 1, f movf Multiplier, w ; Add LSByte Next addwf Product, f btfsc STATUS, C ; Carry Set from LSByte Add? incf Product + 1, f ; Yes, Increment the MSByte AddSkip: bcf STATUS, C ; Shift Up the Multiplier rlf Multiplier, f rlf Multiplier + 1, f movf Multiplicand, f ; Finished? btfss STATUS, Z ; Zero and it is goto Loop goto $ ; Finished, Loop Forever end ; Impartire : ; Variables CBLOCK 0x020 Remainder:2, Quotient:2 Divisor:2 BitShift:2 Temp ENDC PAGE ; Mainline of Divide org 0 movlw high 12345 ; Initialize Variables movwf Remainder + 1 movlw low 12345 movwf Remainder clrf Divisor + 1 movlw 47 movwf Divisor clrf Quotient + 1 clrf Quotient clrf BitShift + 1 movlw 1 movwf BitShift ShiftUpLoop: ; Move the Divisor Up bcf STATUS, C rlf Divisor, f rlf Divisor + 1, f bcf STATUS, C rlf BitShift, f rlf BitShift + 1, f btfss Divisor + 1, 7 ; Bit 7 Set? goto ShiftUpLoop DivideLoop: ; Loop Here for Each Shift Down of the Divisor movf Divisor, w ; Is Remainder >= Divisor? subwf Remainder, w movwf Temp movf Divisor + 1, w btfss STATUS, C addlw 1 subwf Remainder + 1, w btfss STATUS, C ; If Positive, Save the Value goto DivideShift movwf Remainder + 1 movf Temp, w movwf Remainder movf BitShift + 1, w ; Add to the Quotient addwf Quotient + 1, f movf BitShift, w addwf Quotient, f DivideShift: ; Now, Subtract down the Values bcf STATUS, C rrf Divisor + 1, f rrf Divisor, f bcf STATUS, C rrf BitShift + 1, f rrf BitShift, f btfss STATUS, C goto DivideLoop ; Shifting Down BitShift did not Set Carry goto $ ; Finished, Loop Forever end
Edited by ciuly, 22 May 2008 - 08:59.
|
#7
Posted 04 August 2008 - 02:12
despre avr assembler
http://www.atmel.com...nts/DOC1022.PDF http://www.atmel.com...nts/doc0856.pdf http://www.avr-asm-d...beginner_en.pdf http://www.avr-asm-t...calc/index.html Edited by danip00, 04 August 2008 - 02:14. |
Anunturi
▶ 0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users