On Apr 16, 2010, at 8:30 AM, Justin Richards wrote: > This is one of the reasons why i feel more confident writing assembler > (not that I am great at that either) because addressing and indirect > addressing is by comparison straight forward in assembler. I have to agree that programming in assembler can be very helpful toward understanding pointers. > > mov ax,[bx + 100] > what could be simpler to understand. Especially on CISC-y computers :-) The PIC assembler to do this would not be so simple to understand. OTOH, I don't remember offhand whether x86 assembler (or machine language) uses the size of the datatype in the index calculations. If bx contains 1000, does this load ax from address 1400 because ax is of size 4, or from 1100 because of simpler assumptions? > temp_p = &timer mind you I dont think you need to do that in assembler > because you always have the address. Yes, but this is the difference between mov ax, myvariable and mov ax, offset myvariable or maybe mov ax, #myvariable > but perhaps if in c [alternate suggestion for pointer syntax] ... > on second thought that is worse. Yeah. It's just syntax. Once you get used to the C syntax I don't think it's particularly worse than any assembler... I used a language once that took the position that ALL variables were pointers, and if you wanted the values you had to dereference the pointers explicitly using the "." operator. So you'd have code that looked like: .var1 = .a + .b*2 It was ... interesting, I guess. But I'm glad it didn't catch on! BillW -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist