Jump to content

walker7

Members
  • Content Count

    41
  • Joined

  • Last visited

Everything posted by walker7

  1. This is how the data is stored in files on this type of computer. NOTE: This is a work in progress. I will be updating this post as I think of stuff to put on here. Bytes $20-$7F represent the standard ASCII character set. Character $7F represents the cursor symbol. Bytes $00-$1F are control codes. $00 - ROM Section Header $01 - Palette $02 - Graphics $03 - Mappings $04 - $05 - $06 - $07 - $08 - Set Tab Width $09 - Tab $0A - Line Feed $0B - Comment Tab $0C - $0D - Carriage Return (same as $0A) $0E - $0F - $10 - $11 - $12 - $13 - $14 - $15 - $16 - $17 - $18 - $19 - $1A - $1B - $1C - $1D - Change Label Line Color $1E - Change Label Line Toggle $1F - Toggle Show/Hide Labels Characters $80-$FF are more control codes. When the file is saved, it is compressed using LZSS.
  2. walker7

    The Best Assembly Computer

    These are all the components of a really good assembler.
  3. Creating data structures is an important part of programming. By pressing a certain key combo (such as CTRL+D), you could enter a screen that will let you make data structures for your program. Take a look at this screen. This is where you enter data structures. The cursor starts in the prefix field. You might want to type a prefix for all the elements in the structure. Whenever you enter a new element of the structure, the name field will start with this prefix already in it. If you don't want to enter a prefix, just press Enter to go straight to the data fields. For each element, type its name in the black box, the size in the red box, and the quantity in the blue box. For the size, you can type "B," "W," or "L." You can also use "1," "2," or "4." These correspond to 1-byte, 2-byte, or 4-byte elements, respectively. The structure is a 3-character field. If you want only one of this data field, type "1." If you want more, just type however many you want. If you type a quantity greater than 999, it will show an ASCII character in the hundreds digit. For example, entering 1024 will make it show ":24", but it still represents an array of 1,024 elements. As you input bigger numbers, the hundreds digit cycles through all the ASCII characters, then repeating with different colors. Here's an example. Say you want to make a structure for a music header. Assuming you're programming for the Sega Genesis, you know that there are 6 FM channels and 4 PSG channels. First, you might want to put the song's tempo. It is a 2-byte value. With the "mus_" already in the prefix box, you just need to type "Tempo" in the black box to complete the element name. Press Enter, and the cursor moves to the red box on the same line. Now, type "W" or "2" in the red box so the data field will be 2 bytes. A "2" will appear in the box, and the cursor moves to the blue box. Finally, type "1" in the blue box to indicate you only want one field for tempo. The entire line looks like this: After that, press Enter to add a second line. Repeat this procedure for as many fields as you need in your data structure. The remaining fields for the music header are: After tempo is a pointer to each FM channel's data. There should be 6 of these, one for each FM channel. Each is two bytes. A pointer for each PSG channel's data. There are 4 of them, each are two bytes. Volumes for each FM channel. Since the YM2612 has 7-bit volume levels, these could be represented in one byte. A packed 16-bit field for the PSG volumes. This could be thought of as four 4-bit fields packed into a single value. Indices for each FM channel's instrument. These could be one byte each. After entering all those data fields, the screen would look like this: After the data structure is entered, just press CTRL+Enter to exit the screen. The data structure appears at the point where your cursor was when you entered this screen. If you entered this screen by mistake, you could press ESC and go back to programming. Any data entered here will then be discarded. This post just mentions how you would declare data structures for a program. In a later post, I will mention how to actually enter the data.
  4. walker7

    Computer Food Coloring

    This album contains colors from various computer systems rendered in food coloring.
  5. From the album: Computer Food Coloring

    These are the 16 MSX/ColecoVision colors rendered in McCormick food coloring.
  6. This is the second installment in computer food coloring. This time, it's the MSX palette. It's also used on the ColecoVision, and the TI 99/4A. Therefore, it could be called the TI palette. It consists of 15 colors and a transparent color. Color 0 is Transparent. Black: 8 parts Black Medium Green: 9 parts Green Light Green: 5 parts Green Dark Blue: 7 parts Blue, 5 parts Neon Blue, 5 parts Neon Purple Light Blue: 2 parts Neon Blue, 2 parts Neon Purple Dark Red: 30 parts Red, 1 part Blue, 1 part Green Cyan: 3 parts Neon Blue Medium Red: 13 parts Red Light Red: 5 parts Red Dark Yellow: 8 parts Yellow, 3 parts Red, 2 parts Green Light Yellow: 3 parts Yellow Dark Green: 24 parts Green, 1 part Blue Magenta: 7 parts Neon Purple, 2 parts Green Gray: 2 parts Black White: None The transparent color was achieved by using plain water. The medium used was Sargent Art Art-Time white tempera paint, which is opaque. And here's how it turned out: That certainly looks cool! It's pretty accurate.
  7. This next section is a big one. Wouldn't it be great if you could test code as you programmed it? Well that's where Code-As-You-Go comes into play. The mode can be accessed with a dedicated button on a keyboard. It's labeled "CAYG." Take a look at this: That's the code as you go screen. On the panel at the right, you can enter the data you want to test. On the upper right of the screen is the address that the code will assemble to. In this example, the written code will compile at address $001404. You could instead have it display which line of the source code the code will go in. First, give the subroutine a name. In this example, we have a routine called "TetrisLFSR." This will be a Motorola 68000 version of the NES Tetris RNG routine. The NES version of Tetris iterates its RNG (a 16-bit LFSR) in the following manner: Set the output bit to the XOR of bits 1 and 9, and right-shift that input into the RNG. We will replicate this routine as we enter the code. For this test, enter the input in d0. We need to enter a 16-bit value. Using a mouse, click on the fourth-to-last digit of the d0 register, then type "7259." The digit highlighted in green is the cursor. Note that the register values are displayed in hexadecimal. If you enter an invalid hexadecimal digit, nothing happens. When you enter the last digit, the cursor stays there. (If it were an A-register, the cursor would be red.) Now, time for the first instruction. Type "move.b", tab, then "d0,d2", and hit Enter (if you hit Space, it will tab for you). When you press Enter, the last line of code you wrote is automatically executed in the CAYG window, and its machine language code appears in the window as well. In M68K assembly, the instruction "move.b d0,d2" is represented by $1400. The screen looks like this: Note that after you typed the code line, that instruction automatically executed. The last byte of d0 is $59, so the last byte of d2 is now also $59. The next two instructions are "move.w d0,d1" and "lsr.w #8,d1". These are necessary to retrieve the upper byte of a 16-bit value in d1. After the second line was typed, d1 became $7259. After the third line, it became $0072. In the machine code box is E049, which is the code for "lsr.w #8,d1." Remember, only the compiled code for the last line you typed appears in the machine code box. Next, we want to take the XOR of bits 1 and 9 of the bytes in d1 and d2. Since 1 and 9 differ by exactly 8, no shifting of either byte is needed. Just XOR the bytes by typing "eor.b d2,d1", then pressing Enter. Register d1 is now equal to $2B, which is the XOR of $72 and $59. It is bit 1 from this value we need to extract and get into the X (extend) flag. To do this, type "lsr.b #2,d1", and press Enter. The value in d1 became $0A. But more importantly, look at the X and C flags. They lit up, so their value is 1. Any flag that is clear appears as white-on-black, while a set flag is indicated by the opposite color scheme. Since the XOR of bits 1 and 9 of our 16-bit value was 1, a 1 will be right-shifted in to get the new RNG value. Here is the last piece of the puzzle. Now that we have our output bit in X (and C), we can use a "roxr" instruction to shift it in. Type "roxr.w #1,d0", and hit Enter. And there you have it. The new RNG value is $B92C. With the ability to see the code execute as you type it, coding will become as easy as pie. You could also toggle register updating off/on, and you could also move your cursor to any line in the code, and press a certain button to step through the code and see the results. After finishing the code, press the CAYG button again. All the code you wrote in the CAYG screen will be placed at the place in the source code you were at when you went to this screen. You can then edit it, delete it, or change it as normal. All in all, the code-as-you-go feature could be a breakthrough for future assemblers. No matter whether it's 6502, M68K, Z80, or anything else, it's the next innovation in coding.
  8. walker7

    Palettes

    From the album: The Best Assembly Computer

    A set of 7 different color palettes to use while programming.
  9. walker7

    Picture BG Menu

    From the album: The Best Assembly Computer

    This is the menu you would enter if you wanted to view a picture for a background while assembling.
  10. walker7

    Picture BG

    From the album: The Best Assembly Computer

    The same simulated assembler screenshot, but with a picture background.
×
×
  • Create New...