In this lecture, Chris spoke about binary representation, the lowest level of data representation. I've always been enamored by graphical representation using bits and bytes, as I've dealt a lot with RGB for web development and graphic editing, so I was pleasantly surprised to see this topic. From what I learnt, several types of data may be encoded in binary: Binary uses 'bits', which stands for binary digits (that second part blew my mind!) either 0 or 1 resistant to errors Integers stored as groups of 8 bits, known as 'bytes' starting from right to left at 0, each bit represents a value of 2^(bit number) e.g. 10010111 = 1x2 7 + 0x2 6 + 0x2 5 + 1x2 4 + 0x2 3 + 1x2 2 + 1x2 1 + 1x2 0 = 151 Fixed-point encoded the same way as integers, but the bits to the right of the decimal point are 'fractional' Floating-point encoded in three parts: the sign bit, the mantissa, and the exponent 0 represents a positive sign bit, whereas 1 is negative common flo...
Hello everybody, and welcome to the third lab of SPO600. After studying 6502 directives last class, specifically DCB, we're going to use it this lab in our very first creative piece of work using 6502. The objective in this lab is to create a graphic animation using the 6502 emulator colors. We're given four options to achieve this: Bouncing Graphic Numeric Display Pong Kaleidoscope I've decided to go with the bouncing graphic. To achieve my design, I copied the code example to display a ball on the screen. This code sample uses DCB to pre-define all the locations and load them into the a register. define WIDTH 4 ; width of graphic define HEIGHT 4 ; height of graphic lda #$25 ; create a pointer at $10 sta $10 ; which points to where lda #$02 ; the graphic should be drawn sta $11 lda #$00 ; number of rows we've drawn sta $12 ; is stored in $12 ldx #$00 ; index for data ldy #$00 ; index for screen column draw: lda data,x sta ($10),y...
Hey guys, and welcome back to my SPO600 blog. In this class, we took a deeper dive into 6502 Assembler. This time, we learnt some directives. Directives are instructions that set behavior for how the compiler processes input. Here's a few examples. define This directive is a very simple text replacement, which stores a given value into any word you provide to it. For example, 'define WHITE $01' makes it so that any time you mention 'WHITE', it gets substituted with $01. This is really useful if some particular values are hard to remember. In this case, $01 refers to the white color, which is definitely easy to forget. DCB DCB (define constant byte) stores a value in memory, at the very end of the memory. Once that value is declared, it can be called from the main code using LDA. The value must be either a quoted string or a numeric expression that evaluates to an integer between 128 to 255. I was interested to see the parallels between 6502 directives and C++ direct...
Comments
Post a Comment