Programa para correr en el turbo debugger, tomaba el valor de un byte y lo convertia en una base especificada, entre las posibles opciones eran (Base 10, Base 16 , Base 5 , Base 8, Base 3)
1: .model small 2: .stack 64h 3: .data 4: datos db 32 dup (?) 5: base db 0,0,0,3,4,5,6,7,8,9,0,0,0,0,0,0,10,11,12,13,14,15,16 6: tabla10 db 0,1,2,3,4,5,6,7,8,9,10h,11h,12h,13h,14h,15h,16h,17h,18h,19h,20h,21h,22h,23h,24h 7: db 25h,16h,27h,28h,29h,30h,31h,32h,33h,34h,35h,36h,37h,38h 8: db 39h,40h,41h,42h,43h,44h,45h,46h,47h,48h,49h 9: db 50h,51h,52h,53h,54h,55h,56h,57h,58h,59h 10: db 60h,61h,62h,63h,64h,65h,66h,67h,68h,69h 11: db 70h,71h,72h,73h,74h,75h,76h,77h,78h,79h 12: db 80h,81h,82h,83h,84h,85h,86h,87h,88h,89h 13: db 90h,91h,92h,93h,94h,95h,96h,97h,98h,99h 14: db 100 dup (0) 15: tabla08 db 0,1,2,3,4,5,6,7,10h,11h,12h,13h,14h,15h,16h,17h 16: db 20h,21h,22h,23h,24h,25h,26h,27h 17: db 30h,31h,32h,33h,34h,35h,36h,37h 18: db 40h,41h,42h,43h,44h,45h,46h,47h 19: db 50h,51h,52h,53h,54h,55h,56h,57h 20: db 60h,61h,62h,63h,64h,65h,66h,67h 21: db 70h,71h,72h,73h,74h,75h,76h,77h 22: db 80h,81h,82h,83h,84h,85h,86h,87h 23: db 90h,91h,92h,93h,94h,95h,96h,97h 24: db 100 dup (0) 25: tabla05 db 0,1,2,3,4,10h,11h,12h,13h,14h,20h,21h,22h,23h,24h 26: db 30h,31h,32h,33h,34h,40h,41h,42h,43h,44h 27: db 50h,51h,52h,53h,54h,60h,61h,62h,63h,64h 28: db 70h,71h,72h,73h,74h,80h,81h,82h,83h,84h 29: db 90h,91h,92h,93h,94h 30: db 100 dup (0) 31: tabla03 db 0,1,2,10h,11h,12h,20h,21h,22h,30h,31h,32h,40h,41h,42h,50h,51h,52h 32: db 60h,61h,62h,70h,71h,72h,80h,81h,82h,90h,91h,92h 33: db 100 dup (0) 34: tabla16 db 100h dup (0) 35: numero db ? 36: 37: .code 38: mov ax,@data 39: mov ds,ax 40: mov es,ax 41: mov cx,255 42: lea si,tabla16 43: mov dl,0 44: lleno: mov [si],dl 45: inc si 46: inc dl47: loop lleno
48: 49: xor dx,dx
50: xor ax,ax
51: xor cx,cx
52: 53: lea si,datos 54: mov al,[si] 55: lea bx,base 56: xlat 57: mov dl,al 58: 59: mov al,[si+1]60: and al,11110000b
61: rol al,4 62: mul dl 63: mov numero,al64: xor ax,ax
65: mov al,[si+1]66: and al,00001111b
67: add numero,al 68: 69: mov al,[si+2] 70: cmp al,2 71: jne tres 72: jmp binario 73: tres: cmp al,3 74: jne cinco 75: lea bx,tabla03 76: jmp buscar 77: cinco: cmp al,5 78: jne ocho 79: lea bx,tabla05 80: jmp buscar 81: ocho: cmp al,8 82: jne diez 83: lea bx,tabla08 84: jmp buscar 85: diez: cmp al,10h 86: jne dieciseis 87: lea bx,tabla10 88: jmp buscar 89: dieciseis: cmp al,16h 90: jne salir 91: lea bx,tabla16 92: 93: buscar: mov al,numero 94: xlat 95: mov [si+3],al 96: 97: salir: mov ax,4c00h 98: int 21h 99: 100: binario: mov al,[si+1] 101: rcl al,1 102: jnc lazo15103: mov byte ptr [si+8],1
104: lazo15: rcl al,1 105: jnc lazo16106: mov byte ptr [si+9],1
107: lazo16: rcl al,1 108: jnc lazo17109: mov byte ptr [si+10],1
110: lazo17: rcl al,1 111: jnc lazo18112: mov byte ptr [si+11],1
113: lazo18: rcl al,1 114: jnc lazo19115: mov byte ptr [si+12],1
116: lazo19: rcl al,1 117: jnc lazo20118: mov byte ptr [si+13],1
119: lazo20: rcl al,1 120: jnc lazo21121: mov byte ptr [si+14],1
122: lazo21: rcl al,1 123: jnc lazo22124: mov byte ptr [si+15],1
125: lazo22: jmp salir 126: 127: end
No hay comentarios:
Publicar un comentario