4 ms·
My first programming experience was on the 6502 in the BBC micro, absolutely loved it, especially the programming manual where it gave you the number of clock
by Guthur 7y ago
My first programming experience was on the 6502 in the BBC micro, absolutely loved it, especially the programming manual where it gave you the number of clock cycles for each instruction.
- billpg 7y agoI remember seeing that the "zero page" instructions were all significantly faster and thinking "This Changes EVERYTHING!" As if I could rewrite my code to run in only 256 bytes of working memory.
- forinti 7y agoYou would put only your data (or the most frequently used values, at least) in the zero page. Your code would then be smaller and faster. You would save a byte every time you had to load/save a value from zero page into/from a register. BBC Basic puts the work area for maths functions in the zero page.
- bonzini 7y agoYou can check at http://commodore64.se/wiki/index.php/Commodore_64_Memory_Map http://commodore64.se/wiki/index.php/Commodore_64_Memory_Map what kind of stuff goes in the zero page for Commodore's kernal and Basic. In particular, Basic puts the whole "get next byte" routine there at $0073. It is self-modifying code where the address of the next program byte is the operand of an LDA instruction. Placing the whole routine in zero page saves enough cycles on incrementing the next program byte that it's worth spending 5% of the whole zero page on it.
- forinti 7y agoCool stuff. I've seen something similar for handling interrupts when reading from floppies. It didn't use the zero page, but it could have.
- schlupa 7y ago65C816 and also Motorola 6809 could set any page as 0 page (called direct page).
- sizzzzlerz 7y agoI was programming professionally in Fortran but, when I got my Apple II+, I became totally caught up in learning how to program it in both Apple Basic and assembly. A Apple-centric magazine at the time published an assembler which I laboriously typed in, corrected mistakes, and finally got working. The opcodes were easy to learn and Woz had printed the ROM code he wrote at the back of the manual so that served as a great way to learn the language. What I learned from that helped me later when I had to do some assembly program on the Motorola 680x0, a DEC PDP/11, the Intel processors, and on an IBM main frame.