Home arrow 8086 Assembly Programs arrow Convert ASCII to BCD Friday, 21 November 2008
Home
- - - - - - -
Contact me!
My Blog!
- - - - - - -
- - - - - - -
8086 Assembly Programs
Graphics
Java Servlets
Prolog
VHDL
- - - - - - -
Ubuntu Linux
- - - - - - -
Links
Statistics
Visitors: 42534

   
Convert ASCII to BCD
Written by Rohit   
Monday, 10 April 2006
  1. ;Program to covert an ASCII number to a packed BCD number
  2.  
  3. .model small
  4. .data
  5. datase segment
  6.     answer db 0
  7. datase ends
  8. .stack
  9. .code
  10. assume ds:datase
  11. main proc
  12. mov ax, datase
  13. mov ds, ax
  14. mov ah, 01h
  15. int 21h
  16. and al, 0fh
  17. mov answer, al
  18. mov ah, 01h
  19. int 21h
  20. and al, 0fh;
  21. mov cl, 04h
  22. rol al, cl
  23. or answer, al
  24. mov ah, 4ch
  25. int 21h
  26. main endp
  27. end main
 
< Prev   Next >

 

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.