Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Hello World.

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
View previous topic :: View next topic  
Author Message
Bazza
LXF regular


Joined: Sat Mar 21, 2009 11:16 am
Posts: 1474
Location: Loughborough

PostPosted: Thu Dec 24, 2009 12:55 pm    Post subject: Hello World. Reply with quote

Hey 1sf (troll)...

As I know you wouldn`t be able to do it here is the code
to write "Hello World." directly to the CGA memory area.

This is free from MS-DOS interrupt routines/vectors.

The BIOS, INT 10 is not really needed but it DOES serve
TWO purposes, I`ll let you do some research and tell us
all on here what they are...

Fat chance of that ever happening...

Code:
;
;                   Standard TEXT mode 3 "Hello World." DEMO.
;                   -----------------------------------------
;
;  Copyright (C)1991-2009 B.Walker, (G0LCU). Email to:- wisecracker@tesco.net
;  --------------------------------------------------------------------------
;
;                              "DMA" Hello World.
;                               -----------------
;
;                Assume ORG 100 for MS-DOS and 32768 for MikeOS.
;
;                Assembled using the AD86 combination for MS-DOS.
;
;start:
        pushf                     ;Push all necessary registers.
        push   ax                 ;Note:- Totally 8088 compatible.
        push   cx                 ;
        push   dx                 ;
        push   es                 ;
        push   si                 ;
        push   di                 ;
        mov    ax,0003h           ;Set up video mode to "CGA" colour text.
        int    10h                ;Do it. This does two things in default mode.
        cld                       ;Clear direction flag.
        mov    ax,0b800h          ;Point to CGA memory area.
        mov    es,ax              ;Do it.
        mov    dx,0               ;Set up the end point for the transfer.
        mov    si,helloworld      ;Set source index to start of text to move.
        es:                       ;Shift to Extended Segment.
        mov    di,dx              ;Set the start if the destination index.
        mov    cx,12              ;Counter for the number of WORDs to be moved.
        repz                      ;Do it...
        movsw                     ;Print "Hello World." to the CGA memory...
        pop    di                 ;Replace all used registers.
        pop    si                 ;
        pop    es                 ;
        pop    dx                 ;
        pop    cx                 ;
        pop    ax                 ;
        popf                      ;
        ret                       ;
helloworld:
db 72,7,101,7,108,7,108,7,111,7,32,7,87,7,111,7,114,7,108,7,100,7,46,7


The sheer speed of writing directly to any one of the pages of
CGA memory area is breathtaking to say the least.

Have fun... 8-D

EDIT:

I forgot to add, once compiled open up an MS-DOS Prompt
Window, (only available in Vista and above), and see it
working for yourself...

OR, I will post the compiled HW.COM executable somewhere
for you to grab...
_________________
73...

Bazza, G0LCU...

Team AMIGA...
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast