Bienvenido: Ingresar
location: attachment:igualarlargo_ex1.s de WebHome/TrabajosPracticos/PracticoASM4

Adjunto 'igualarlargo_ex1.s'

Descargar

   1 .arm
   2 .global _start
   3 _start:
   4         b reset
   5         b loop
   6         b loop
   7         b loop
   8         b loop
   9         nop
  10         b loop
  11         b loop
  12 
  13 /* ==============================
  14 *  TEST CODE
  15 *  igualar las palabra de una cadena a la mas larga
  16 *  ==============================
  17 */
  18 reset:
  19         ldr r1,=CADENA
  20         ldr r2,=SALIDA
  21  
  22         mov r5,#0 @maxima longitud
  23 	mov r4,#0 @contador longitud
  24 otro:   ldrb r3,[r1],#1
  25         cmp r3,#0
  26         beq salir1
  27         cmp r3,#' ' 
  28         beq salir1
  29         add r4,#1
  30         b otro
  31 salir1: cmp r4,r5
  32 	movhi r5,r4
  33  	mov r4,#0
  34 	cmp r3,#0
  35 	bne otro
  36 
  37         ldr r1,=CADENA
  38 	ldr r2,=SALIDA
  39 	
  40 otro2:  ldrb r3,[r1],#1
  41     	cmp r3,#0
  42         beq salir2
  43         cmp r3,#' ' 
  44         beq salir2
  45 	strb r3,[r2],#1
  46 	add r4,#1
  47 	b otro2
  48 salir2: cmp r4,#0 @si es otro espacio seguido no completo con '_'
  49 	beq seguir
  50 otro3:  cmp r4,r5
  51 	beq seguir
  52 	mov r6,#'_'
  53 	strb r6,[r2],#1
  54 	add r4,#1
  55 	b otro3
  56 seguir: strb r3,[r2],#1
  57 	mov r4,#0
  58 	cmp r3,#0
  59 	bne otro2
  60 
  61 
  62 loop:   b loop
  63         .ltorg
  64 
  65 /* ==============================
  66 *  CONTANTES
  67 *  ==============================
  68 */
  69 CADENA:  .asciz "igualar el largo de las palabras"
  70 SALIDA:  .space(200)
  71 
  72         .balign 4
  73         .end

Archivos adjuntos

Para referirse a los adjuntos de una página, usa attachment:nombredelarchivo, como se muestra abajo en la lista de archivos. NO uses la URL del enlace [get], ya que puede cambiar fácilmente y dejar de funcionar.
  • [obtener | ver] (2019-09-02 11:56:14, 110.6 KB) [[attachment:ARM_Instruction_Set.pdf]]
  • [obtener | ver] (2019-09-02 11:56:14, 1.1 KB) [[attachment:Makefile]]
  • [obtener | ver] (2019-09-02 11:56:14, 0.4 KB) [[attachment:alarma_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 0.5 KB) [[attachment:alarma_s_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 2.3 KB) [[attachment:anumero1_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 2.9 KB) [[attachment:anumero2_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 0.6 KB) [[attachment:cadena_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 1.2 KB) [[attachment:cercano_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 0.8 KB) [[attachment:clave_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 1.4 KB) [[attachment:compara_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 2.2 KB) [[attachment:contarletrasrep_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 1.5 KB) [[attachment:contarrep_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 1.2 KB) [[attachment:criba_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 2.3 KB) [[attachment:extraenum_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 1.2 KB) [[attachment:igualarlargo_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 1.7 KB) [[attachment:inspalabra_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 0.9 KB) [[attachment:invertir_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 0.9 KB) [[attachment:may_min_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 0.6 KB) [[attachment:multip_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 0.6 KB) [[attachment:potencia_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 0.8 KB) [[attachment:potencia_ex1.s,v]]
  • [obtener | ver] (2019-09-02 11:56:14, 0.8 KB) [[attachment:prom_vector_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 0.6 KB) [[attachment:promedio_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 0.8 KB) [[attachment:promedio_ex1.s,v]]
  • [obtener | ver] (2019-09-02 11:56:14, 0.7 KB) [[attachment:punt_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 0.8 KB) [[attachment:punt_ex1.s,v]]
  • [obtener | ver] (2019-09-02 11:56:14, 1.9 KB) [[attachment:separa_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 472.2 KB) [[attachment:slides.pdf]]
  • [obtener | ver] (2019-09-02 11:56:14, 0.5 KB) [[attachment:suma100_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 0.6 KB) [[attachment:suma64_ex1.s]]
  • [obtener | ver] (2019-09-02 11:56:14, 0.8 KB) [[attachment:suma64_ex1.s,v]]
  • [obtener | ver] (2019-09-02 11:56:14, 160.3 KB) [[attachment:tp1.pdf]]
  • [obtener | ver] (2019-09-02 11:56:14, 167.3 KB) [[attachment:tp3.pdf]]
 All files | Selected Files: delete move to page copy to page

No tienes permisos para adjuntar un archivo a esta página.