Confused about variables
|
02-26-2016, 09:58 PM
(This post was last modified: 02-27-2016 10:13 PM by smp.)
Post: #5
|
|||
|
|||
RE: Confused about variables
Tim and Cyrille, thank you very much for your advice.
I have started to get some of my arithmetic code to work properly by using the R->B() command and using the #xx:16h notation on numbers when I perform initialization. Currently, I am using LOCAL variables for my 8080 registers and flags. I am initializing my them like this: Code:
I am setting up M1 as a one-column array (or vector) for simulating the memory so I can retrieve instructions like this: Code:
I am incrementing the program counter like this: Code:
The bit of code that I've been playing with this afternoon is this: Code:
I have my t1 (temporary) register initialized larger than 16 bits so I can capture the carry from 16 bit arithmetic. The combining of the H and L registers into one 16 bit register, the 16 bit addition with the SP register, and the masking of the H and L registers after the addition are all working properly, BUT h and l both become 17 bit variables. The 16 bit addition with the result going into the 17 bit t1 variable shows a 17 bit result in the case of a carry overflow, so then I can test t1 for being greater than FFFF as you see. This is working as it should. I'm happy to be making progress, but I am still learning... Thanks very much for all your attention and assistance. smp |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Confused about variables - smp - 02-24-2016, 12:31 PM
RE: Confused about variables - Tim Wessman - 02-24-2016, 03:05 PM
RE: Confused about variables - smp - 02-25-2016, 12:55 AM
RE: Confused about variables - cyrille de brébisson - 02-25-2016, 06:22 AM
RE: Confused about variables - smp - 02-26-2016 09:58 PM
RE: Confused about variables - cyrille de brébisson - 02-29-2016, 06:14 AM
RE: Confused about variables - smp - 02-29-2016, 05:25 PM
|
User(s) browsing this thread: 2 Guest(s)