sombruxo

Mayusculas

May 8th, 2026
81
0
Never
4
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASM (NASM) 3.08 KB | Source Code | 0 0
  1. /*
  2.  * ToUpper_USART0.asm
  3.  *
  4.  *  Created: 21/03/2014 15:51:30
  5.  *   Author: Administrador
  6.  */
  7.  
  8.  .EQU restaAMinuscula = 'a'-'A' ;to be subtracted from the lowercase to get the uppercase
  9.  .EQU Clock = 16000000  ;processor’s clock frequency, Hz
  10.  .EQU Baud = 9600 ;desired serial port baud rate (bits per second)
  11.  .EQU UBRRvalue = Clock/(Baud*16) -1 ;calculates value to be put in UBRR0H:L
  12.  
  13.  .DSEG
  14.     ; Aqui las declaraciones de variables. tipo:
  15.     caracter: .byte 1   ;esto es ejemplo, en este codigo no lo uso.
  16.  
  17.  .CSEG
  18.  .ORG 0x00000       ;reset interrupt vector
  19.       jmp MAIN
  20.  .ORG URXCaddr      ; 0x00024  -> interrupt vectors for USART0
  21.       jmp USART0_reception_completed
  22.  
  23.  .ORG INT_VECTORS_SIZE ;leave room for IRQ vectors
  24.  
  25.  
  26. MAIN:
  27.     ser r16
  28.     out ddrb, r16
  29.     clr r16
  30.     out portb, r16
  31.     ;configure USART0
  32.     RCALL init_USART0
  33.     SEI             ;enable interrupts globally
  34. Loop:
  35.     ;nothing to do here, just be alive
  36.     NOP
  37.     rjmp Loop
  38.  
  39.  
  40. ;------- initialize USART0 as 9600baud, asynchronous, 8 data bits, 1 stop bit, no parity -----
  41. init_USART0:
  42.     PUSH R16
  43.     LDI R16, LOW(UBRRvalue)
  44.     STS UBRR0L, R16   ;load the low byte
  45.     LDI R16, HIGH(UBRRvalue)
  46.     STS UBRR0H, R16   ;load the low byte
  47.     ; enable receive and transmit, enable USART0 interrupts (UDR empty, Tx finished, Rx finished)
  48.     LDI R16, (1<<RXEN0)|(1<< TXEN0)|(0<<UDRIE0)|(0<< TXCIE0)|(1<< RXCIE0)
  49.     STS UCSR0B, R16 ;set control register UCSR0B with the corresponding bits
  50.     ; configure USART 0 as asynchronous, set frame format: 8 data bits, 1 stop bit, no parity
  51.     LDI R16, (0<<UMSEL00) |(1<<UCSZ01)|(1<< UCSZ00) |(0<< USBS0)|(0<<UPM01)|(0<< UPM00)
  52.     STS UCSR0C, R16 ;set control register UCSR0C with the corresponding bits
  53.     POP R16
  54.     RET
  55.  
  56. ;----USART0_reception_completed handler --------------------------------------------------
  57. USART0_reception_completed:
  58.     PUSH R16            ;this handler routine will be automatically called every 61msec (in this example)
  59.     IN R16, SREG        ;Backup SREG. MANDATORY in interrupt handler routines
  60.     PUSH R16
  61.    
  62.     ;do the desired periodic task here
  63.     LDS R16, UDR0       ;pick up the byte received and do anything with it
  64.  
  65.     push r16                ; r16 = pasaMayusculas(R16)
  66.     call pasaMayusculas
  67.     pop r16
  68.  
  69.     STS UDR0, R16
  70.  
  71.     POP R16
  72.     OUT SREG, R16       ;Recover SREG from the previous backup
  73.     POP R16
  74.     RETI                ;RETI is MANDATORY when returning from an interrupt handling routine
  75.  
  76. ;=======================================================================
  77. pasaMayusculas:
  78.     ;------------------------- Siempre igual
  79.     push yh
  80.     push yl
  81.     in yh, sph
  82.     in yl, spl
  83.     ;punto2
  84.     ;------------------------- Casi siempre ugual
  85.     push r16
  86.     ldd r16, y+5    ;el primer parametro es SIEMPRE y+5, el segundo y+6, etc.
  87.     ;=========================
  88.     ;if(r16 < 'a)
  89.     cpi r16, 'a'
  90.     brlo sataConversion
  91.     ;if(r16 > 'z') => if(r16 >= 'z'+1)
  92.     cpi r16, 'z'+1      ;cpi r16, 122+1  -> cpi r16, 123
  93.     brsh sataConversion
  94.  
  95.     ;Codigo para pasar a minúsculas.
  96.     subi r16, restaAMinuscula
  97.     std y+5, r16
  98.     ;Punto 3
  99.  
  100.     sataConversion:
  101.  
  102.     ;=========================
  103.     pop r16
  104.     ;punto 4
  105.     ;-------------------------
  106.     pop yl
  107.     pop yh
  108.     ;-------------------------
  109.     ret
  110.  
  111. .EXIT
  112.  
  113.  
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • Idzonag
    23 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment