• Viernes 29 de Marzo de 2024, 06:49

Autor Tema:  necesito de su colaboracion  (Leído 1231 veces)

aleksdegrift

  • Nuevo Miembro
  • *
  • Mensajes: 2
    • Ver Perfil
necesito de su colaboracion
« en: Jueves 28 de Mayo de 2009, 19:42 »
0
Necesito realizar una letra con asteriscos en assembler pero la verdad e intentado pero hasta el momento no me sale completa. la letra q quiero hacer es la A pero al reves y luego engrosarla. les agradeceria si me puden ayudar a encontrar el error garcias, la letra es mas o menos asi:
**********
*    *
*    *
*    *
*    *
**********
Código: ASM
  1.  
  2. .section  .text
  3.           .global  asm_main
  4.  
  5. asm_main:
  6.         enter   $0,$0               # setup routine
  7.         pusha
  8.  
  9.     call    print_nl
  10.         mov     $mensaje, %eax      # imprime el prompt
  11.         call    print_string
  12.     call    read_int
  13.     mov     %eax, valor
  14.     movl    $1, i
  15.     call    print_nl
  16. for_ext:
  17.     mov valor, %ebx
  18.     cmp %ebx, i
  19.         jae fin_for_ext
  20.  
  21.     movl    $1, j
  22. for_int:
  23.    
  24.     cmp %ebx, j  
  25.         jae fin_for_int
  26. if:
  27.    
  28.     cmp $1, i  
  29.     je  entonces
  30.  
  31.     #mov    $0, %eax
  32.     mov     i,  %eax
  33.     mov $0, %edx
  34.     mov     valor, %ebx
  35.     div %ebx
  36.     cmp $0, %edx  
  37.     je  entonces
  38.  
  39.    
  40.     cmp $1, j
  41.     je  entonces
  42.  
  43.     #mov    $0, %eax
  44.     mov $0, %edx
  45.     mov valor, %eax
  46.     mov $2, %ecx
  47.     div %ecx
  48.     add $1, %eax
  49.     cmp     %eax, j  
  50.     je  entonces
  51. else:
  52.     #mov    $0, %eax
  53.     mov     $bola, %eax
  54.     call    print_string
  55.     jmp fin_si
  56. entonces:
  57.     #mov    $0, %eax
  58.     mov     $asterisco, %eax
  59.     call    print_string
  60.     jmp fin_si 
  61. fin_si:
  62.     incl    j
  63.     jmp for_int
  64.    
  65. fin_for_int:
  66.  
  67.     call    print_nl
  68.     incl    i
  69.     #movl   $0, j
  70.     jmp     for_ext
  71. fin_for_ext:
  72.  
  73. call print_nl
  74.  
  75.     popa
  76.         mov     $0, %eax           # retorna a C
  77.         leave                    
  78.         ret
  79.  
  80.