Inferno #01
31 декабря 2000 |
|
For Coderz - Pro ROM 48k Spectrum (# 0000 - # 1FFF).
RESTART ROM 48 (1982) (Programs and tables) (C) Shaitan / Stars of Keladan Recently, a lot is conversations about what the Spectrum was dying. All the speakers that there is little people and no one is trying to do whatever way they prevlech. So we decided to fill this gap. After all, the beginner programmer must first understand the basic principles, which, incidentally, yet no where have not been described. It so we decided to describe the ROM with all (Or most) entry points and parameters necessary to create a more or less a quality product. So, let's begin. Part One All numbers are in hexadecimal system. Immediately say, that all information was taken from the periodical press, books Publishers "Peter" and "Solon", as well as of their developments. 0000 START On the appeal to this address made the initial launch. Prohibited masked interrupts, clears the register A register pair DE takes the value FFFF and is transition to address 11CB. Refer to this procedure can be as CALL 0 and RST 8 0008 ERROR error handler for the issuance Message in A register must be kept message serial number in the table -1. Before working stack is cleared and receive the message. Appeal made the team RST 8 0010 Print a Character This procedure used for printing the character in the current channel code symbols must first be entered in the register A. Appeal made the team RST 10. In this part of the program made the transition address 15F3 0018 Collect character. Treatment produced a team of RST 1918 0020 Collect next character. Treatment made the team RST 1920 0028 Calculator name says it all for themselves. With this procedure, you able to produce various arithmetic operations on numbers. In this piece of memory made the transition to Address 335B. Treatment produced a team of RST 1928 0030 Make BC spacer. This prtseduroy made allocation participate in memory workspace. In this piece made the transition to address 169E. Treatment made the team RST 1930 0038 Maskable interrupt. Maskable interrupt processing program of the first kind. Real-time clock updated and by scanning the keyboard at 02BF. Forced this procedure can cause a team RST 1938 0053 ERRROR 2 0066 Non mask interrupt. Nonmaskable interrupt handler. In this procedure, the developers made a mistake. This program should work follows. If on any external device came nonmaskable interrupt signal, then, if at 5CB0 contains the address of your procedure nonmaskable interrupt processing, then made the transition by her, and after its execution returns to the interrupted procedure. If the given address contains 0, then produce an instant access to the interrupted procedure. 0074 CH-ADD +1 007D Skip - over 0095 Token tables Table keywords 0205 Key tables Table keys. There are 6 tables, 1 for each mode. The most important first table that contains values in the ASCII code for large letters and numbers. 028E Keyboard skanning. Key value returned in the register pair DE. Flag Z is reset, if it was odnovremmeno pressed more than 2 keys. Register E indicates the number of the pressed key (0-27) and register D, the register in which was This key is pressed. 02BF KEYBOARD 0310 Repating key 031F K - TEST 0333 Keyboard decoding Last 4 treatments carry the possibility of recurrence and decode the value of the pressed key code to obtain the necessary letters. If a key is pressed, the code is copied to the system variable LAST-K and bit 5 FLAG is set to signal that a key is pressed. After reading the key code, 5 th bit variable FLAG to reset. 03B5 BEEPER The input register pair HL contains the pitch trubuemoy notes, and DE contains the note itself, ie HL = (437.500 / f) -30.125 DE = f * t where f-frequency notes in Hz, t-time playing music. 03F8 BEEP This procedure is similar to the preceding, but differs in that it very extensive use of calculator 046E Semi-tone table Table for halftone 04C2 SAVE - BYTES Number of Passes bytes specified in the pair DE, starts at address stored in register IX into a tape recorder with a starting address and byte parity. 053F SAVE LOAD RETURN 0556 LOAD - BYTES program read / data comparison, the number of which set out in a pair of DE, since the address specified in the IX. If before starting carry flag is cleared, then made comparison, otherwise the load data. 05E3 LOAD - EDGE - 2 0605 S A V E - E T C. The entry point to all programs work with a tape recorder 07CB VERIFY Control 0802 LOAD (data block) 0808 LOAD Control 08B6 MERGE Control 0970 SAVE Control Program discharge data. Posleee startup screen appears on the need to run tape and press any key, and then begin unloading the data with the headline 09A1 CASSETE MESSAGES messages related to work with a tape recorder Next, go to work from a screen printer. If the 1-st bit variable FLAGS is set, the work is done with the printer, otherwise the screen. 09F4 PRINT - OUT Determination of Governors Character 0A11 Control-character table table control characters 0A23 CYRSOR Left 0A3D Carriade return 0A5F PRINT COMMAND 0A69 PRINT a guestion mark 0A6D Control character with operand 0AD9 Position table 0ADC Position store procedure for determining the current position 0B03 Position fetch 0B24 PRINT any character 0B7F PRINT all character The latter two are to display the text on the screen / printer. On entrance to the HL contains the initial position print, BC contain the current values rows and columns, and register A contains character code. During operation, analyzed the permission of the modes INVERSE and OVER. 0BDB Set attribute byte Set the attributes of a character after printing 0C0A Messadge printing software print messages. At the entrance register pair DE must contain the address of the beginning of the table messages, and register a number of messages starting from scratch. Features of construction table is that the last pechatuemy character must have a fixed MSB. 0C10 Messadge printing software print keywords. The register must contain a number of words in the table. 0C3B Position save 0C41 TABLE search 0C55 TEST for scroll check the current print position to the output of the screen. If position along the lines went off the screen, then displays a message and waits any key 0CF8 "SCROLL?" messadge 0D4D Temporary color items Program temporal attributes. 0D6B CLS Command Command CLS, and the installation of the current flow 1 0D6E CLS2 program clears the service screen, the attributes for which are set in conformance with the system variable BORDCR 0DAF Clearning the whole display area 0DD9 CL - SET 0DFE SCROLING2 Program scrolling screen on one line 0E00 SCROLLING Program scrolling a certain number of lines that is located in the Regitra B. 0E44 Clear lines Cleanup certain number of rows that should be in register B. The countdown starts from the bottom lines of the screen 0E88 CL - ATTR 0E9B CL - ADDR 0EAC COPY COMMAND Command COPY 0ECD COPY - BUFF buffer content is transferred to the printer printer 0EF4 COPY LINE own work with the printer 0F2C EDITOR program for a set of strings in BASIC on the editorial board. Each time you press printable character or a keyword is added to the edited row 0F81 ADD - CHAR program additions symbol or keyword in the edited row 0FA0 Editing keys table table keys editing Next is located routines for processing editing keys and handling syntax 0FF3 CURSOR down editing 1007 CURSOR LEFT editing 100C CURSOR RIGHT editing 1015 DELETE editing 101E ED IGNORE 1024 ENTER editing 1031 ED - EDGE 1059 CURSOR up editing 1076 ED SYMBOL 107F ED ERRORS 1097 CLEAR - SP 10A8 Keyboard INPUT Sub collects values from the LAST-K for as long as Bit 5 FLAGS shows that pushed the new key. If the code is printed, then set the carry flag and Z flag 10DD Caps Lock key pressed handling Caps Lock key 10E9 Ext. Input Processing Keystroke Ext. Mode, Graphics, Caps / Symbol Shift 10FA Number Key Processing pressing the numeric keys. Followed by three routines to build in an editorial or workspace editorial line or the input line, flashing on the screen 111D Lower screen copying 1190 SET - HL 11A7 REMOVE - FP 11B7 NEW Command Command NEW. 11CB Main entry (Initioalisation). When if the input register A = 0, then performed full restart, if A = FF, then only the command NEW 11CC ClearScr Clear the screen, the installation standard attribute 11D0 Imer Setting the standard vector Interrupt 11DA RAM - CHECK. Program testing memory on the suitability of starting at the address 4000 to RAMTOP. The output of the pair HL is the address of the last usable cell 11F0 Init2 Setting system variables P-RAMT, RASP, PIP, UDG in the initial state. Performed in the exercise Team NEW 1200 Init3 program is used in initial startup. UDG characters are copied to the appropriate area of memory pereinitsializiruyutsya system variables PIP, RASP, UDG 1219 Imer3 address setting tekusheyu font organized stack installed first mode interrupt register IY is set to 5C3A 1235 Channel Downloading information on channels 1244 Systems establish some System Variables 127C Stream Elementary stream data is copied 14 Address STRMS. They represent flows from -3 to +3. 1286 Clear defecating printer buffer, the screen and displays a firm salute 12A2 Main execution loop main loop to enter the program syntax check 12E2 Execution Interpretation introductions line 1391 REPORT messages Table messages Error 1555 Main ADD program copies lines from the editor in the appropriate place in the program area 15AF Initial cannel information Initial data table feed 15C6 Initial stream data the initial table of data on stream 15DE WAIT - KEY wait for keystroke 15E6 INPUT - AD Analysis of the key pressed 15EF Main printing Printing figures contained in the register A in the range 0 ... 9 15F2 Main printing 2 Printing introduced keyword or re-recruited symbol 1601 CHAN - OPEN opens a channel number, which is contained in register A. 1615 CHAN - FLAG 162D Channel code look-up table 1634 Channel K flag 1642 Channel S flag 164D Channel P flag 1652 ONE - SPACE allocation in a production or editing of a row BASIC. MAKE ROOM 1655 the allocation of memory from the address in HL, with length specified in the register pair BC. 1664 POINTERS change some system variables 168F Coll a line number Sub collection line number. For this address beginning of the row number of the line is going to register E. 169E RESERVE The required size of made available in the workspace 16B0 SET - MIN cleaned editorial line, a temporary workspace 16C5 SET - MIN 2 cleaned Stack Calculator 16D4 reclaim the edit line 16DB INDEXER program for indexing search data in tables 16E5 CLOSE # Command to Run CLOSE # 1716 CLOSE stream look-up table 171E Stream data 1736 OPEN # Command to Run OPEN # 177A OPEN stream look-up table 1793 CAT, ERASE, FORMAT, MOVE Command Executing commands CAT, ERASE, FORMAT, MOVE 1795 LIST '& LLIST program output listing 17D5 AUTO - LIST Program develop an automatic listing 17F5 LLIST a listing to the printer 17F9 LIST Displays a listing on screen 1855 PRINT A whole BASIC line program O-line 17B6 NUMBER procedure for deriving rates line 18C1 PRINT line cursor Analysis Program need to print the row cursor 18E1 PRINT CURSOR Print cursor line 190E LN - FETCH The search start address line in the program 1925 Printing characters in BASIC line Program printing directly Body line 196E LINE - ADDR 1980 Compare line numbers Procedure comparison of numbers of rows and edited located directly in the body of the program 1988 Find each statement 19B8 NEXT - ONE Specifies the address of the next line 19DD DIFFERENCE 19E5 RECLAIMING 19FB E - LINE - NO line number to check the correctness 1A1B Report '& lint numbers printing Sub-print number, located in the register pair Sun 1A4B SYNTAX table syntax table teams 1B17 Main parser (Basic Interpreter) Interpreter 1B28 Statement loop Syntax Check one operator 1B52 SCAN - LOOP 1B76 STMT - RET 1B8A LINE-RUN Neposradstvennaya Interpretation 1B8F SEPARATOR Define a class team 1B9E LINE - NEW Go to the next line 1BB2 REM Command The command REM 1BB3 LINE - END 1 Output of procedure check the syntax of the line 1BBF LINE - USE 1BD1 NEXT - LINE 1BEE CHECK - END 1BF4 STMT - NEXT 1C01 COMMAND Classtable Table Class teams Further presentation of the program of classes teams 1C0D Command Classes 00,03,05 1C16 JUMP - C - R 1C1F Command Classes 01, 02, 04 1C22 VERIABLE in Assignment 1C56 FETCH a VALUE 1C79 Expect numeric / string expressions 1C96 Set permanent colors (class 07) 1CBE Command Classes 09 1CDE Command Classes 0B 1CED FETCH a NUMBER 1CEE STOP Command to Run STOP 1CF0 IF Command Command IF 1D03 FOR Command Command FOR 1D86 LOOK - PROG View program the loop FOR TO NEXT 1DAB NEXT Command Command NEXT 1DDA NEXT - LOOP Go to the top of the loop with a new parameter 1DEC READ Command Command READ 1E27 DATA Command Command DATA 1E39 PASS - BY 1E42 RESTORE Command Command RESTORE 1E4F RANDOMIZE Command Command RANDOMIZE 1E5F CONTINUE Command Command CONTINUE 1E67 GO TO Command Command GO TO 1E7A OUT Command Command OUT 1E80 POKE Command Command POKE 1E85 TWO - PARAMETERS Sub-reading the second parameter 1E94 Find Integer program search for a Part number 1EA1 RUN Command to Run RUN 1EAC CLEAR Command Command CLEAR 1EED GO SUB Command Command GO SUB 1F05 TEST - ROM 1F1A FREE MEMORY Program definition availability of free memory for the next Basic Line 1F23 RETURN Command Command RETURN 1F3A PAUSE Command Command PAUSE in register pair should contain a number of Sun 1/50-h to which neobodimo suspend 1F54 BREAK - KEY test pressing BREAK. If a key is pressed, the flag is set on C 1F60 DEF FN Command Command DEF FN 1FC3 UNSTACK - 2 1FC9 LPRINT Command Command LPRINT 1FCF PRINT Command to Run PRINT 1FF5 PRINT a carriage RETURN 1FFC PRINT ITEMS
Other articles:
Similar articles:
В этот день... 21 November