please help me. i dont understand this:

Create routine to display * based on AL w CR
AL=07
CALL 120 & RET

output:
*****

my professor said cr is call routine, that's all, he didnt tell us what does that mean
help me please

Recommended Answers

All 7 Replies

That's pretty vague.
With no more instruction than that, I would do something like this:

mov al, '*'
;
   call myRoutine
   int 20h

myRoutine:
   mov ah, 09h ; function
   mov bl, 07h ; color
   mov cx, 0a  ; number of times
   int 10h     ; execute
   ret

That's pretty vague.
With no more instruction than that, I would do something like this:

mov al, '*'
;
   call myRoutine
   int 20h

myRoutine:
   mov ah, 09h ; function
   mov bl, 07h ; color
   mov cx, 0a  ; number of times
   int 10h     ; execute
   ret

why do i get an error when i typed and entered 'myRoutine:'
command prompt don't accept it

Did you compile it first?
You would never need to type 'myRoutine:' at the command-line.
What did you name your program?
If it is actually 'myRoutine', then you don't need the colon :
If you are compiling this with an old dos compiler, then the name is one char too long.

Did you compile it first?
You would never need to type 'myRoutine:' at the command-line.
What did you name your program?
If it is actually 'myRoutine', then you don't need the colon :
If you are compiling this with an old dos compiler, then the name is one char too long.

the attached picture shows my first error. its about the asterisk.

the other error would be the myRoutine.

i think the '*' should be replaced by 2A, a hexadecimal code that i saw from http://www.asciitable.com/. i'm not sure.

my program is not saved so it has no name. and what do you mean compile? is that the tasm thing?

the attached picture er1.jpg shows my first error. its about the asterisk.

the other error er2 is the myRoutine.

i replaced the '*' by 2A, a hexadecimal code that i saw from http://www.asciitable.com/. but i'm not sure of it.

and if im not going to type myRoutine in the commandline what should i type after 'call'? or should i just ommit that line? im sorry im slow on this.

Yes. You save your code in a text file with the extension .asm,
then convert that .asm file into a .com or .exe file by compiling it.

Tasm is a compiler that can be used to do that.
Once it is compiled, it will look as you expect in debug.

From what you said was command prompt I guess your on windows;
If your compiler makes a file with the .bin then find it's website and see about how to make it a exe.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.