Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- displays: resb 4
- display: db 00111111b, 00000110b, 01011011b, 01001111b, 01100110b, 01101101b, 01111101b, 00000111b, 01111111b, 01100111b
- xor eax, eax
- mov al, [0x2]
- mov bl, [0x0]
- mov ecx, -1
- ciclo1:
- inc ecx
- cmp [ecx+display], al
- jne ciclo1
- mov eax, ecx
- mov ecx, -1
- ciclo2:
- inc ecx
- cmp [ecx+display], bl
- jne ciclo2
- mov ebx,ecx
- test [0x1], 01000000b
- jz soma
- neg ebx
- soma:
- add eax, ebx
- cmp eax, 9
- jg doubledigit
- cmp eax, 0
- jl negative
- mov bl,[eax+display]
- mov [0x0], bl
- mov [0x1], 00111111b
- mov [0x3], 01110011b
- jmp fim
- negative:
- neg eax
- mov bl,[eax+display]
- mov [0x0], bl
- mov [0x1], 00111111b
- mov [0x3], 1010100b
- jmp fim
- doubledigit:
- add eax, -10
- mov bl,[eax+display]
- mov [0x0], bl
- mov [0x1], 1
- mov [0x3], 01110011b
- fim:
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement