내 프로그램은 바이너리를 기본 64로 인코딩해야합니다. 모든 것이 EOF까지 작동합니다. 출력 문자열 끝에 '='을 추가하는 데 문제가 있습니다.Nasm Linux x64-86 | 올바른 기본 64 인코딩을 위해 파일 끝에 비트를 추가하십시오.
이것은 마지막 바이트가 읽혀질 때만 발생해야합니다. 빈 공간을 채워야합니다. 여기에 하나 또는 두 개의 '='를 추가해야 할 때마다 코드를 추출합니다. 내에서 그래서
Read:
mov eax,3 ; Specify sys_read call
mov ebx,0 ; Specify File Descriptor 0: Standard Input
mov ecx,Bytes ; Pass offset of the buffer to read to
mov edx,BYTESLEN ; Pass number of bytes to read at one pass
int 80h ; Call sys_read to fill the buffer
mov ebp,eax ; Save # of bytes read from file for later
cmp rax,1 ; If EAX=0, sys_read reached EOF on stdin
je MissingTwoByte ; Jump If Equal (to 1, from compare)
cmp rax,2 ; If EAX=0, sys_read reached EOF on stdin
je MissingOneByte ; Jump If Equal (to 2, from compare)
cmp eax,0 ; If EAX=0, sys_read reached EOF on stdin
je Done ; Jump If Equal (to 0, from compare)
: MissingOneByte과 : MissingTwoByte 기능, 난 지금 내 '='바이트를 추가해야합니까? 어떻게하면 될까요?
문제가 무엇인지 분명하지 않습니다. 확실히 당신은'mov [Bytes + 1], '=''등을 찾고 있지 않습니까? – Jester
아니, 설명하는 법을 모르겠다. 내 영어는 그렇게 좋지 않다. – Arkarr
32 비트 또는 64 비트입니까? –