Writing a 'Hello
World!' program
With Borland Turbo Assembler
Step1:
Copy this sourcecode into a file called 'hello.asm' with your favorite text-editor:
;---------------------------------------------------
; Hello World !!! for V2_OS
; (c)1999 The V2_Lab
;---------------------------------------------------
.MODEL TINY ; Some compiler directives...
.386p
code32 segment para public use32 ; Declare the 32 Bit Code/DataSegment
code32 ends
code32 segment para public use32 ; Start the 32 Bit Code/DataSegment
assume cs:code32, ds:code32
ORG 100H ; Reserve 100h Bytes
HelloWorld: ; Program Starts here
jmp Start ; Skip the variable
declaration part
; Declare your variables
here...
Message DB 'Hello World !!!',13 ,10 ,0
; On with the code:
Start:
; Prepare the 'Print' Request
Mov AL, 4H ; System32 Service
Number 4 (Print Text)
Mov EDI, Offset Message ;
Point DS:EDI to the text
Int 20h ; Execute System32
Service
Mov AL, 23 ; System32 Service
Number 32 (Wait for a key)
Int 20H ; Execute System32
Service
RETF ; Return to System32
code32 ends ; End the 32Bit Code/DataSegment
END HelloWorld ; End the Sourcecode
Step2:
To compile this, make sure your in the path where you have stored 'hello.asm'.
Also, make sure your 'Environment Variables' point to the Tasm/bin directory. To verify
this, type 'path'. Your Tasm/Bin directory should be listed here. If it is not, please
check your Tasm Readme files to set this path.
If all this is verified, enter the following commands to compile and link 'hello.asm'
tasm hello
tlink hello /3 /x
Step3:
This should give you the 'hello.com' file. (if not, check the error messages from the
compiler and linker)
Insert a V2_OS formatted floppy in drive A:
Use the following command to copy your application to the V2_OS Floppy:
v2copy hello.com hello.app
Step4:
Boot a PC into the V2_OS, and insert your floppy
Now you can type:
run hello.app
...............................................................................................................
Problems ?
If your having problems with compiling and running hello.app, feel free to
contact us !