Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re: Perl Operating System

by tachyon (Chancellor)
on Mar 26, 2004 at 00:09 UTC ( [id://339914]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl Operating System
in thread Perl Operating System

C might be a horrible language......there's no real alternative to C

MOV AH,02 MOV DL,"A" INT 21h MOV DL,"S" INT 21h MOV DL,"M" INT 21h MOV DL,"?" INT 21h MOV AH,04Ch MOV AL,00 INT 21h

When you look at the alternative C starts to look pretty damn good! The only advantage of ASM is that the binaries tent to be tiny ie 24 bytes for that example as opposed to 36K for the same thing compiled in C using cl.exe:

perl -e "print pack'H*','b402b241cd21b253cd21b24dcd21b23fcd21b44cb000c +d21'" > asm.com

cheers

tachyon

Replies are listed 'Best First'.
Re^3: Perl Operating System
by Aristotle (Chancellor) on Mar 26, 2004 at 06:21 UTC
    Though it would look less awful if you had used a string output function instead of one-character-at-a-time I/O. And been smaller, too. (Also: eww, DOS.)

    Makeshifts last the longest.

      Can we also fight over AT&T-style vs Intel-style mnemonics?

      Ahhhhh!!! Assembler GOLF! 21 bytes.... OK so I admit I did not try to make assembler look good. I have always liked the thought that C is a language with all the power of assembler, but with all the user friendliness of ..... assembler.

      jmp start msg db "ASM?$" start: mov ah,09 mv dx,offset msg int 21h mov ah,4ch mov al,00 int 21h

      cheers

      tachyon

        Oh my, it has been so many years…
        mov ah, 09h mov dx, offset msg int 21h ret msg db "ASM?$"
        (The ret is a CP/M remnant. There's an int 20h at the top of the program segment prefix and DOS puts a 0000 word on the stack before it passes control to the program. We are now deep in the dark ages of microcomputer "operating systems".)

        Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://339914]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-07-16 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.