Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
6 views

1) Procedura Care Primeste in X Adresa Unui Sir de Caractere Si Intoarce in R20 Nr. de Caractere Din Sir Aflate Intre Paranteze

1) A procedure that receives a string of characters in address X and returns in R20 the number of characters from the string that are between parentheses. For example, for the string "ab(cd)efg(hij)1" it would return 5. 2) A procedure that calculates in bit 0 of R17 the following expression: R16.0 AND (R16.1 OR R16.2). It moves values from R16 to other registers, performs logical operations, and returns the result in R17.

Uploaded by

Alex Vlad
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

1) Procedura Care Primeste in X Adresa Unui Sir de Caractere Si Intoarce in R20 Nr. de Caractere Din Sir Aflate Intre Paranteze

1) A procedure that receives a string of characters in address X and returns in R20 the number of characters from the string that are between parentheses. For example, for the string "ab(cd)efg(hij)1" it would return 5. 2) A procedure that calculates in bit 0 of R17 the following expression: R16.0 AND (R16.1 OR R16.2). It moves values from R16 to other registers, performs logical operations, and returns the result in R17.

Uploaded by

Alex Vlad
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

1) Procedura care primeste in X adresa unui sir de caractere si intoarce in R20 nr.

de caractere din sir aflate intre paranteze. Ex.: ab(cd)efg(hij)1 => 5 caractere PROC: ldi R20, 0 ldi R17,0 PROC1: ld R16, X+ cpi R16,0 breq GATA cpi R16, ( breq PARANTEZA_DESCHISA cpi R16, ) breq PARANTEZA_INCHISA add R20, R17 rjmp PROC1 GATA: ret PARANTEZA_DESCHISA: ldi R17,1 rjmp PROC1 PARANTEZA_INCHISA: ldi R17,0 rjmp PROC1

2) Procedura care calculeaza in bitul 0 din R17 urmatoarea expresie: R16.0 AND ( R16.1 OR R16.2 ) EXPRESIE: mov R17,R16 lsr R17 or R17, R16 mov R18,R16 lsl R18 and R18,R17 ldi R17,0 andi R18, 0b00000010 breq EXPRESIE1 ldi R17, 0b00000001 EXPRESIE1: ret

You might also like