Hello World! on modern processors.

From: Sean 'Captain Napalm' Conner <spc_at_conman.org>
Date: Tue Aug 21 22:53:02 2001

It was thus said that the Great Jay West once stated:
>
> Yes, but per my earlier example.... are we shooting for less instructions in
> the program or less intructions executed in total for the program? (ie, your
> 23 byte example is calling dos system services, so.... lots of additional
> instructions there).

  Well, this all started when Iggy said there wasn't a PRINT language
element in Assembly, so I suppose it's the easiest way to get something
printed, which means using built in system support.

  Now, if you are doing this on an IBM PC the quickest way (assuming a CGA
card at minimum 8-) is possibly:

                org 0100h
                push cs
                pop ds
                mov ax,0b800h
                mov es,ax
                mov si,offset message
                xor di,di
                mov cx,12
                rep movsw
                ret
message db 'H',7,'e',7,'l',7,'l',7,'o',7,' ',7
                db 'w',7,'o',7,'r',7,'l',7,'d',7,'!',7
                end

  -spc (42 bytes, more if you want to be pedantic and check for MDA ... )
Received on Tue Aug 21 2001 - 22:53:02 BST

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:33:34 BST