🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.asm
Article #1072

Re: Własny program startowy

#1072
From: AdamW
Date: Fri, 20 Apr 2007 22:56
46 lines
2180 bytes
### CUT ###
from sys import argv, exit

def printc(c):
    print " movw $0x%x,%%ax" % (0x0e00+c)
    print " movw $0x7,%bx"
    print " int $0x10"


if len(argv) < 2:
    exit()

f=open(argv[1])

print ".code16"
print ".text"

print ".global _start"

print "_start:"
print "sti"
print " cld"
print " movw $0x1202,%ax"
print " movb $0x30,%bl"
print " int $0x10"
for c in f.read():
    c = ord(c)
    if c == 0xa:
        printc(0x20)
    if c == ord('\n'):
        printc(13)
        printc(10)
        printc(0)
    else:
        printc(c)

print "loop:"
print " jmp loop"
### CUT ###

Więc doszedłem sam do czego chciałem.
Jak z powyższego kodu korzystać pozostawiam już Wam do obmyślenia ;).
Dzięki za odpowiedź. Są może jakieś ciekawe materiały na temat
programowania "surowego" kompa?

Pozdrawiam
Technical Details
Message-ID: <1177109773.495471.65660@b75g2000hsg.googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!newsfeed00.sul.t-online.de!t-online.de!198.186.194.247.MISMATCH!news-out.readnews.com!news-xxxfer.readnews.com!postnews.google.com!b75g2000hsg.googlegroups.com!not-for-mail
References: <1177096138.997638.116250@b75g2000hsg.googlegroups.com> <4629018d$0$13205$f69f905@mamut2.aster.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!newsfeed00.sul.t-online.de!t-online.de!198.186.194.247.MISMATCH!news-out.readnews.com!news-xxxfer.readnews.com!postnews.google.com!b75g2000hsg.googlegroups.com!not-for-mail
From: AdamW <adam.wieckowski@gmail.com>
Newsgroups: pl.comp.lang.asm
Subject: Re: Własny program startowy
Date: 20 Apr 2007 15:56:13 -0700
Organization: http://groups.google.com
Lines: 49
Message-ID: <1177109773.495471.65660@b75g2000hsg.googlegroups.com>
References: <1177096138.997638.116250@b75g2000hsg.googlegroups.com>   <4629018d$0$13205$f69f905@mamut2.aster.pl>
NNTP-Posting-Host: 83.168.75.14
Mime-Version: 1.0
X-Trace: posting.google.com 1177109773 2909 127.0.0.1 (20 Apr 2007 22:56:13 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 20 Apr 2007 22:56:13 +0000 (UTC)
In-Reply-To: <4629018d$0$13205$f69f905@mamut2.aster.pl>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1.3) Gecko/20070404 Firefox/2.0.0.3,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: b75g2000hsg.googlegroups.com; posting-host=83.168.75.14;   posting-account=XJE0zA0AAABpHnPDh4hDbKe72S3LO8i0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit