You could do about anything like this, though it would be quite useless and none too pretty to read. I'm not quite sure if this would work with any other languages, either - though I'm interested to see if you could cram three or four in one file.
This code is as follows:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; /*Hello World | |
; For fun!*/public class HloWrld/* | |
.MODEL SMALL | |
.STACK 100H | |
.DATA | |
Greeting db 'Hello world!',13,10,'$' | |
.CODE;*/{ | |
;public static void main(String[] args) { | |
;/* | |
MAIN PROC | |
; Initialize DS register | |
mov ax,@data ; initialize data segment address | |
mov ds,ax ; initialize ds | |
; display message using DOS function | |
;*/System.out.println("Hello world!"); | |
;/* | |
mov ah,9 ; print string function | |
mov dx,offset Greeting ; DS:DX points to string | |
int 21h | |
;*/}/* | |
; Exit | |
mov ah,4ch | |
int 21h | |
main endp | |
end MAIN | |
;*/} |