Question about program 
Author Message
 Question about program

I am having a problem with a program:

Need to print out the ascii value of character in Binary:
all my program does is print 8 0's

Can someone help?

Dave



Wed, 31 Jul 2002 03:00:00 GMT  
 Question about program

Quote:
> Need to print out the ascii value of character in Binary:
> all my program does is print 8 0's

How about this:

MODEL   TINY
SEGMENT C2B
ASSUME  CS:C2B, DS:C2B
ORG     256
Start:  MOV CX,8
Label1: MOV DL,'0'
        ROL [MyChar],1 ; MSB to CF
        ADC DL,CH ; inc '0' to '1' if CF set
        MOV AH,2
        INT 21h ; put it out
        LOOP Label1 ; 8 times
        RET
MyChar  DB 'X' ; a character to display
ENDS    C2B
END     Start

--
Bye,
v
Sr.

Sent via Deja.com http://www.deja.com/
Before you buy.



Wed, 31 Jul 2002 03:00:00 GMT  
 Question about program

Get the binary value of say, 65.
Then put:
Bin db 1000110b (This is a made up value)

----------------------------------------------------------------
Team2000 PC/Palm Pilot Programming Team:
http://ppilot.homepage.com

Quote:

> I am having a problem with a program:

> Need to print out the ascii value of character in Binary:
> all my program does is print 8 0's

> Can someone help?

> Dave



Wed, 31 Jul 2002 03:00:00 GMT  
 Question about program

OOOPS...  I solved my own problem



Wed, 31 Jul 2002 03:00:00 GMT  
 Question about program


   >I am having a problem with a program:
   >Need to print out the ascii value of character in Binary:
   >all my program does is print 8 0's
   >Can someone help?
   >Dave
Can you post your program?

Net-Tamer V 1.08X - Test Drive



Wed, 31 Jul 2002 03:00:00 GMT  
 Question about program
Sorry, misunderstoof your question.
Quote:

> Get the binary value of say, 65.
> Then put:
> Bin db 1000110b (This is a made up value)

> ----------------------------------------------------------------
> Team2000 PC/Palm Pilot Programming Team:
> http://ppilot.homepage.com


> > I am having a problem with a program:

> > Need to print out the ascii value of character in Binary:
> > all my program does is print 8 0's

> > Can someone help?

> > Dave



Thu, 01 Aug 2002 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. question about programming with the append statement

2. quicky question: not programming or homework

3. VX-Rexx Question - Sample program

4. Object Rexx Questions (opening program objects

5. Philosophical Question about Programming

6. Question about program

7. Question on program execution, please help.

8. Question on Programming the 8259 chip

9. Question on Programming the 8259 chip

10. newbie question (gui programming)

11. novice question on programming with prolog.

12. A FORTRAN question (a program problem)

 

 
Powered by phpBB® Forum Software