Let us say some file "file.txt" has the contents
56
21
f6
ad
the contents of the above file are in hexadecimal when i am reading them from the file and stored them in a buffer "arr" in the below code Now when I try to read from the buffer "arr" the values stored as char which should be expected. Is there any way I can read hexadecimal values directly in the buffer?
my intention is to read 5 as 5(base 10) ,read 6 as 6(base 10) ,read 2 as 2(base 10) ,read 1 as 1(base 10) ,read f as 15(base 10) ,read 6 as 6(base 10) ,read a as 10(base 10) ,read d as 14(base 10) one by one . Is there any way to do that?
%include "io.mac"
.DATA
File_name db "file.txt",0
.UDATA
file_pointer resd 1
arr resb 4
.CODE
.STARTUP
mov EAX,5 ;opening the file "file.txt"
mov EBX,File_name
mov ECX,0
mov EDX,0o777
int 0x80
mov [file_pointer],EAX
mov EAX,3 ;reading from the file "file.txt"
mov EBX,[file_pointer]
mov ECX,arr
mov EDX,4
int 0x80
.END