0

I write a file asm and print value of FFFFFFFF-1=FFFFFFFE but it print ����. I try use vi command and :%!xxd but it don't exactly, it display 000000: efbf bf0a instead of feff ffff 0a, I too try with value of 0x12345678, surprise is it exactly, it print 0000000: 7756 3412 0a with vi hex editor. 0000000: 7756 3412 0a My code:

segment .bss
        num2 resb 4
section .text
        global _start
_start: 
        mov dword [num2], 0xFFFFFFFF
        sub [num2], dword 1  
        mov ecx, num2
        mov edx, 4
        mov eax, 4
        mov ebx, 1
        int 0x80  

        mov eax, 1
        int 0x80

Value of ���� are binary text? Is there a way to make exactly with value of ����?

Frank C.
  • 7,758
  • 4
  • 35
  • 45
QChí Nguyễn
  • 273
  • 6
  • 16
  • To print a hex number you need a to convert the binary (what is in the registers) to `ascii` equivalent. Look at disassembled `itoa` to get a feel for what is needed. – Frank C. Mar 22 '17 at 09:42
  • Possible duplicate of [Printing Hexadecimal Digits with Assembly](http://stackoverflow.com/questions/3853730/printing-hexadecimal-digits-with-assembly) – Frank C. Mar 22 '17 at 11:04

0 Answers0