WIDTH IS 320 Gr"o"se der Bitmap HEIGHT IS 240 LOC Data_Segment PREFIX :Bmp: GREG @ LOC ((@+3)&-4)+2 Alignment! BMFile BYTE "BM" Size TETRA 0 File size res TETRA 0 reserved bdoff TETRA 0 bitmap data offset hsize TETRA #28000000 bitmap header size width TETRA 0 height TETRA 0 planes WYDE #0100 bpp WYDE #0100 1 Bit per pixel (monochrom) comp TETRA 0 compression dasize TETRA 0 bitmap data size hres TETRA 0 Aufl"osung: irrelevant vres TETRA 0 dto. color TETRA 0 colors icolor TETRA 0 important colors (0=alle) palette TETRA #8000FF00,#0 data LOC @+:WIDTH*:HEIGHT/8 endbm BYTE 0 8H IS @ LOC #100 $*$ Unterprogramm: einen einzelnen Punkt setzen. $*$ Koordinaten kommen in {\tt \$0} und {\tt \$1}. PREFIX Point: x IS $0 y IS $1 off IS $2 temp IS $3 vtet IS $4 bit IS $5 BMBase IS $6 Zeiger auf Bitmap-Daten :Point LDA BMBase,:Bmp:data Adresse der Daten MUL off,y,:WIDTH/8 so viele Byte bis $y$ DIV temp,x,8 ADD off,off,temp LDB vtet,BMBase,off GET temp,:rR Maske mit gesetztem Bit SET bit,#80 an Pos. x mod 8 bauen SR bit,bit,temp OR vtet,vtet,bit Bit setzen STB vtet,BMBase,off POP 0,0 $*$ Hauptprogramm:\label{bmp3} PREFIX : Base IS $0 Data IS $1 Off IS $2 temp IS $3 OFile IS 3 6H OCTA #0102040810204080 magische Zahl Main LDA Base,:Bmp:BMFile $*$ File Size setzen SET Data,:Bmp:endbm-:Bmp:BMFile LDA Off,:Bmp:Size 1H STBU Data,Off SRU Data,Data,8 INCL Off,1 BNZ Data,1B $*$ Bitmap Data Offset setzen SETL Data,:Bmp:data-:Bmp:BMFile GETA $255,6B LDO temp,$255,0 MOR Data,Data,temp STHT Data,:Bmp:bdoff SET Data,:WIDTH H"ohe und Breite setzen MOR Data,Data,temp STHT Data,:Bmp:width SET Data,:HEIGHT MOR Data,Data,temp STHT Data,:Bmp:height $*$ Linie (0, 0) nach (100, 100) zeichnen max IS $9 SET max,100 1H SET $11,max SET $12,max PUSHJ $10,:Point SUBU max,max,1 PBP max,1B $*$ Bitmap auf Datei schreiben 9H LOC 8B GREG @ 1H BYTE "bild.bmp",0 OpnArg OCTA 1B,BinaryWrite WArg OCTA :Bmp:BMFile OCTA :Bmp:endbm-:Bmp:BMFile 8H LOC 9B LDA $255,OpnArg TRAP 0,Fopen,OFile LDA $255,WArg TRAP 0,Fwrite,OFile