Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8795119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:20:39+00:00 2026-06-13T23:20:39+00:00

I’m having some problems trying to solve this expression in assembler. `$`z=(5*a-b/7)/(3/b+a*a) I would

  • 0

I’m having some problems trying to solve this expression in assembler.

`$`z=(5*a-b/7)/(3/b+a*a) 

I would like to know how do you convert a word to a double word ( unsigned solution ) ,
do i have to use the cwb command or do i use AX:BX , if i do have to use those last registers ,
how do i properly write the command ?

I will be testing the code in Turbo Debugger under DosBox .
My full code

assume cs:code,ds:data 
data segment
;
a db ?
b db ?
rez dw ?
;
data ends
;
code segment
;
mov ax,data
mov ds,ax
;
;
;#####prima paranteza
;
mov al,a    ;ah=a
mul 5       ;ax=a*5
mov cx,ax   ;cx=ax
mov ah,b    ; il mut pe ah in b  ( pregatire pt conversie fara semn )
mov al,0    ; l-am convertit pe b in word ( pe 2 octeti )
div 7       ; am impartit double word-ul b la 7 , catul a ramas in ah , restul a ramas in al 
sub cx,ax   ; (am tinut cont de faptul ca in ax a ramas rezultatul dupa impartire )  , cx=cx-ax, a*5 - b/7
;
; ####a 2 a paranteza
;
mov ah,3    
mov al,0    ; conversie de la b la w  ( fara semn )
div b       ; ax=3/b
mov bx,ax   ; bx = ax
mov al,a    
mul a       ; ax = a * a 
add ax,bx   ; ax = ax + bx
;
;
; #### calcul final 
mov bx,ax   ; bx = ax ( rezultatul celei de a 2 a paranteze )
mov ax,cx   ; ax = cx ( rezultatul primei paranteze )
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:20:39+00:00Added an answer on June 13, 2026 at 11:20 pm

    word to double-word?

    Let’s see if I got you:

    word -> 8bit
    double-word -> 16bit

    AX, BX, CX and DX are 16 bit registers, and they are formed by two other 8-bit registers [ABCD]H and [ABCD]L, so, AX would be:

    AH                      AL
    |0|0|0|0|0|0|0|0| – |0|0|0|0|0|0|0|0|

    When you use AX, you’re using those two at the same time. So, if you want to convert a word to a double word, you just clear the whole [ABCD]X register, and then move your word to the [ABCD]L register, leaving [ABCD]X with the word value.

    Cheers

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I would like to count the length of a string with PHP. The string
I know there's a lot of other questions out there that deal with this
Does anyone know how can I replace this 2 symbol below from the string
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.