Home > other >  Assembly language hurry hurry hurry
Assembly language hurry hurry hurry

Time:11-12

Shift instruction is used to implement the word variable values on the monitor in a hexadecimal display of W
Example: W are defined as follows:
W DW 4 a8bh
Output 4 a8b

The problem how to write a no ideas please bosses

CodePudding user response:

The two problems:
How one is A single output, such as 4, AL=4 how output, usually by 30 h + numerical Numbers into the corresponding display the characters of 4 + 30 h=34 h='4', hexadecimal character, also consider 0 ah is shown as' A ', can determine whether A value greater than 9, if more than 37 h + for 41 h='A', or, you can through the look-up table number to display character conversion,
The second is how to do more than the output, can through the cyclic shift, will be displayed displacement to the low four specific register, and then according to the above output,
 mov bx, 4 a8bh 
Cx, mov 4
L_4p:
Push cx
Mov cl, 4
Rol bx, cl
Mov dl, bl
Fh and dl, 0
The add dl, 30 h
CMP dl, 39 h
Jbe l_out
The add dl, 7
L_out:
Mov ah, 2
Int 21 h
Pop cx
Loop l_4p

CodePudding user response:

Hexadecimal output can be implemented look-up table and a few simple
  • Related