0 Пользователей и 4 Гостей просматривают эту тему.
begin Write('Hello, World!')end.
begin Write('Hello, World!');end.
; This is a "Hello World" program for Z80 and TMS9918 / TMS9928 / TMS9929 /; V9938 or V9958 VDP.; That means that this should work on SVI, MSX, Colecovision, Memotech,; and many other Z80 based home computers or game consoles.;; Because we don't know what system is used, we don't know where RAM; is, so we can't use stack in this program.;; This version of Hello World was written by Timo "NYYRIKKI" Soilamaa; 17.10.2001;;----------------------------------------------------------------------; Configure this part:DATAP: EQU #98 ; VDP Data port #98 works on all MSX models; (TMS9918/TMS9929/V9938 or V9958); #80 works on SVI ; (for other platforms you have to figure this out by your self)CMDP: EQU #99 ; VDP Command port #99 works on all MSX models; (TMS9918/TMS9929/V9938 or V9958); #81 works on SVI; (for other platforms you have to figure this out by your self);-----------------------------------------------------------------------; Program starts here:ORG 0 ; Z80 starts always from here when power is turned onDI ; We don't know, how interrupts works in this system, so we disable them.; Let's set VDP write address to #0000XOR AOUT (CMDP),ALD A,#40OUT (CMDP),A; Now let's clear first 16Kb of VDP memoryLD B,0LD HL,#3FFFLD C,DATAPCLEAR:OUT (C),BDEC HLLD A,HOR LNOP ; Let's wait 8 clock cycles just in case VDP is not quick enough.NOPJR NZ,CLEAR; Now it is time to set up VDP registers:;----------------------------------------; Register 0 to #0;; Set mode selection bit M3 (maybe also M4 & M5) to zero and ; disable external video & horizontal interruptLD C,CMDPLD E,#80OUT (C),AOUT (C),E;---------------------------------------- ; Register 1 to #50;; Select 40 column mode, enable screen and disable vertical interruptLD A,#50INC EOUT (C),AOUT (C),E;---------------------------------------- ; Register 2 to #0;; Set pattern name table to #0000XOR AINC EOUT (C),AOUT (C),E;---------------------------------------- ; Register 3 is ignored as 40 column mode does not need color table;INC E;---------------------------------------- ; Register 4 to #1; Set pattern generator table to #800INC AINC EOUT (C),AOUT (C),E;---------------------------------------- ; Registers 5 (Sprite attribute) & 6 (Sprite pattern) are ignored ; as 40 column mode does not have spritesINC EINC E;---------------------------------------- ; Register 7 to #F0; Set colors to white on blackLD A,#F0INC EOUT (C),AOUT (C),E;----------------------------------------; Let's set VDP write address to #808 so, that we can write; character set to memory; (No need to write SPACE it is clear char already)LD A,8OUT (C),ALD A,#48OUT (C),A; Let's copy character setLD HL,CHARSLD B, CHARS_END-CHARSCOPYCHARS:LD A,(HL)OUT (DATAP),AINC HLNOP ; Let's wait 8 clock cycles just in case VDP is not quick enough.NOPDJNZ COPYCHARS; Let's set write address to start of name tableXOR AOUT (C),ALD A,#40OUT (C),A; Let's put characters to screenLD HL,ORDERLD B,ORDER_END-ORDERCOPYORDER:LD A,(HL)OUT (DATAP),AINC HLJR OVERNMINOPNOP; Here is address #66, that is entry for NMIRETN ;Return from NMIOVERNMI:DJNZ COPYORDER; The endHALT; Character set:; --------------ORDER:DEFB 1,2,3,3,4,0,5,4,6,3,7ORDER_END:CHARS:; HDEFB %10001000DEFB %10001000DEFB %10001000DEFB %11111000DEFB %10001000DEFB %10001000DEFB %10001000DEFB %00000000; eDEFB %00000000DEFB %00000000DEFB %01110000DEFB %10001000DEFB %11111000DEFB %10000000DEFB %01110000DEFB %00000000; lDEFB %01100000DEFB %00100000DEFB %00100000DEFB %00100000DEFB %00100000DEFB %00100000DEFB %01110000DEFB %00000000; oDEFB %00000000DEFB %00000000DEFB %01110000DEFB %10001000DEFB %10001000DEFB %10001000DEFB %01110000DEFB %00000000; WDEFB %10001000DEFB %10001000DEFB %10001000DEFB %10101000DEFB %10101000DEFB %11011000DEFB %10001000DEFB %00000000; rDEFB %00000000DEFB %00000000DEFB %10110000DEFB %11001000DEFB %10000000DEFB %10000000DEFB %10000000DEFB %00000000; dDEFB %00001000DEFB %00001000DEFB %01101000DEFB %10011000DEFB %10001000DEFB %10011000DEFB %01101000DEFB %00000000chars_end:
врите('Хелло ворлд') и без точки с запятой канпелируеца
http://zgadnitca.narod.ru/prez_zvonit.swf
Давайте вообще сходку в Мск замутим.
Ок
Я на полном серьезе. Посидим где-нибудь в пицце, покумекаем. Или в кинцо.
кто-то хочет набить морду кому-то...
Знаете ли вы что такое пицца? Пицца - пласт теста на который крошат разную начинку, а потом все это прожаривают.
Посидим где-нибудь в пицце, прожаримся.