0

Can someone please help with these assembly language tasks

Write an assembly language program in PSEUDOCODE.

Task 1: Assign an arbitrary positive integer and a integer 2 through 9.

Task 2: Convert the positive integer into a base 2 through 9.

Task 3: Store the converted integer as a single number

So far I have something like this:

3. 

section .data 
m1 db 10,'Enter 32 bit no:' 
m1len equ $ -m1 

m2 db 10,'The entered 32 bit no is:-' 
m2len equ $ -m2 

section .bss 

num resd 10 
count resb 1 
cnt resb 1 
input resb 1 

section .text 
global _start 
_start: 

mov byte[count],10 
mov esi,num 

back: 
mov eax,4 
mov ebx,1 
mov ecx,m1 
mov edx,m1len 
int 80h 

mov eax,3 
mov ebx,0 
mov ecx,esi 
mov edx,4 
int 80h 


mov eax,3 
mov ebx,0 
mov ecx,input 
mov edx,1 
int 80h 

add esi,4 
dec byte[count] 
jnz back 

mov esi,num 
mov byte[count],10 

back1: 

mov eax,4 
mov ebx,1 
mov ecx,m2 
mov edx,m2len 
int 80h 

mov eax,4 
mov ebx,1 
mov ecx,esi 
mov edx,4 
int 80h 

add esi,4 
dec byte[count] 
jnz back1 

mov eax,1 
int 80h 

2.
Peggy
  • 31
  • 1
  • 4

0 Answers0