Displaying a String

To display a string, say, "This is 86ASM", is very easy. In BASIC, all you have to do is:

Disp STRING

On the screen, you get "This is 86ASM"

Well, in ASM, you have to put the string into the register HL, and put it on the screen. To do that, you do this:

ld HL,STRING
call _puts

On the screen, you get "This is 86ASM"

It's the exact same thing on the screen...

You notice that there is a little bit of whitespace in front of the commands. That MUST be there, or you will get many errors from your compiler because whitespace is read as a command. No whitespace means that this is a label.

That's all it takes to display a string in ASM!