Answer the question
In order to leave comments, you need to log in
How to write a program with the following algorithm (NASM assembler)?
1) display an invitation;
DONE
2) enter a string from the keyboard (it is assumed that it contains decimal digits and any letters);
DONE
3) find all the digits in the entered string and for each found digit set to "1" in the ax register the bit whose number is equal to this digit. Display the contents of the register ax in the form of zeros and ones;
NOT DONE
Sample program but I don't know how to make an algorithm for the task:
Please write assembly code Using NASM, LD, int 80h.
nasm -f elf -F dwarf -g file.asm
ld -m elf_i386 -o file file.o
SECTION .bss
num: resb 254
SECTION .data
hello: db 'Enter the string: ',0
helloLen: equ $-hello
output: db 'Output: ',0
outputlen: equ $-output
SECTION .text
GLOBAL _start
_start:
mov eax,4
mov ebx,1
mov ecx,hello
mov edx,helloLen
int 80h
mov eax,3
mov ebx,0
mov ecx,num
mov edx,254
int 80h
...
...
...
mov eax,4
mov ebx,1
mov ecx, ...
mov edx, ...
mov eax,1
mov ebx,0
int 80h
Answer the question
In order to leave comments, you need to log in
I don't know how to make an algorithm for the task
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question