Find Jobs
Hire Freelancers

Arithmetic routine

$15-20 USD

Concluído
Publicado há mais de 20 anos

$15-20 USD

Pago na entrega
The problem is to start an arithmetic routine package by writing a multiplication subroutine named mlt: mlt ; On input R2 and R3 contain two non-negative integers a (multiplicand) ;and b (multiplier) respectively, and on return R1 and R0 contain ; non-negative numbers h and l such the R1,R0 together contain the product ; of a and b : ; a * b = 2^15 * h + l . No other registers should be affected. ; On return R2 is trashed and R3 contains an error flag, which in this case ; is set iff either a or b is negative. ;EXAMPLE: multiply #1000 by #2000 to obtain #2000000 ; ld R2,M1000 ; address M1000 contains #1000 ; add R3,R2,R2 ; R3 <-- #2000 ; jsr mlt ; On return R3 is 0, R1 contains #61 and R0 contains #1152 since ; 2000000 = 2^15 * 61 + 1152 There are several algorithms for multiplication. One can be developed based on the binary place value system and noting that doubling a number (i.e.,adding it to itself) shifts the bits one place left. A simpler algorithm is based on adding R2 to itself R3 times. In this case it might be better to test the operands to make sure R2 contains the larger of a and b. (Adding 1000 to itself 3 times is much faster than adding 3 to itself 1000 times). The product of a and b need not fit into one word: Say you are adding R2 to R0. Remembering that the operands are all positive, a negative sum signifies overflow, so the msb must be cleared and R1 incremented; e.g.: ADD R0,R0,R2 BRzp mlt_goon ; go on if no overflow AND R0,R0,R4 ; R4 previously loaded with x7FFF = b0111111111111111 ADD R1,R1,#1 ; add in "carry" from R0 mlt_goon ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. ## Platform Windows assembler
ID do Projeto: 3006863

Sobre o projeto

3 propostas
Projeto remoto
Ativo há 21 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
Concedido a:
Avatar do Usuário
See private message.
$3 USD em 1 dia
5,0 (9 avaliações)
3,0
3,0
3 freelancers estão ofertando em média $11 USD for esse trabalho
Avatar do Usuário
See private message.
$14,45 USD em 1 dia
4,4 (5 avaliações)
2,8
2,8
Avatar do Usuário
See private message.
$17 USD em 1 dia
0,0 (0 avaliações)
0,0
0,0

Sobre o cliente

Bandeira do(a) UNITED STATES
United States
4,8
37
Membro desde nov. 10, 2003

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.