The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,762 other followers

Archive for the ‘6502 Assembly’ Category

A refefernce to 6502 by “Remember that in a stack trace, the addresses are return addresses, not call addresses – The Old New Thing”

Posted by jpluimers on 2018/09/11

On x86/x64/ARM/…:

It’s where the function is going to return to, not where it came from.

And:

Bonus chatter: This reminds me of a quirk of the 6502 processor: When it pushed the return address onto the stack, it actually pushed the return address minus one. This is an artifact of the way the 6502 is implemented, but it results in the nice feature that the stack trace gives you the line number of the call instruction.

Of course, this is all hypothetical, because 6502 debuggers didn’t have fancy features like stack traces or line numbers.

Source: [WayBackRemember that in a stack trace, the addresses are return addresses, not call addresses – The Old New Thing

Which resulted in these comments at [WayBack] CC +mos6502 – Jeroen Wiert Pluimers – Google+:

  • mos6502: And don’t forget the crucial difference in PC on 6502 between RTS and RTI!
  • Jeroen Wiert Pluimers: +mos6502 I totally forgot about that one. Thanks for reminding me
    <<Note that unlike RTS, the return address on the stack is the actual address rather than the address-1.>>

References:

[WayBack6502.org: Tutorials and Aids – RTI

RTI retrieves the Processor Status Word (flags) and the Program Counter from the stack in that order (interrupts push the PC first and then the PSW).

Note that unlike RTS, the return address on the stack is the actual address rather than the address-1.

[WayBack6502.org: Tutorials and Aids – RTS

RTS pulls the top two bytes off the stack (low byte first) and transfers program control to that address+1. It is used, as expected, to exit a subroutine invoked via JSR which pushed the address-1.

RTS is frequently used to implement a jump table where addresses-1 are pushed onto the stack and accessed via RTS eg. to access the second of four routines.

–jeroen

Posted in 6502, 6502 Assembly, Assembly Language, Development, History, Software Development, The Old New Thing, Windows Development, x64, x86 | Leave a Comment »

The Codeless Code: Ancient code

Posted by jpluimers on 2016/08/10

something like: 100 PRINT “&F2&B&H3&W2Hello, world!”would select font #2, bold, with triple height and double width, and render “Hello!” on the high-res screen

Source: The Codeless Code: Ancient code – hand coded (on paper) 6502 assembly!

via: 6502 assemblerbeen there, done that – Thomas Mueller (dummzeuch) – Google+

–jeroen

Posted in //e, 6502, 6502 Assembly, Apple, Apple ][, Assembly Language, Development, History, Power User | Leave a Comment »

MOnSter 6502

Posted by jpluimers on 2016/05/16

This is so impressive: MOnSter 6502 basically a 6502 on a PC board running at 100s of kHz.

via:

–jeroen

Posted in 6502, 6502 Assembly, Assembly Language, Development, History | Leave a Comment »

Easy 6502 by skilldrick: an ebook tutorial to learn 6502 assembly with embedded simulator

Posted by jpluimers on 2015/08/04

A while ago, Alan Cox write a G+ post pointing me to Easy 6502 by skilldrick. The last couple of weeks I finally found time to play with it:

It is a tutorial ebook by Nick Morgan with examples and a play ground based on the adapted JavaScript 6502 assembler and simulator right integrated into a github.io site.

From the perspective of learning assembly language to get a grasp of thinking at the lowest computer abstraction, it is an ideal tutorial: the 6502 is a very simple 8-bit processor with only 3 registers. These restrictions make programming fun.

These are the topics covered:

This is what Alan thinks about it:

… some of the other 6502 tutorials

This one is really really neat – bit more basic than the bits I need to brush up on but really nicely done.

skilldrick.github.io/easy6502/Easy 6502.

via:

Posted in 6502, 6502 Assembly, Assembly Language, Development, History, JavaScript/ECMAScript, Scripting, Software Development | Leave a Comment »

2 More Old Micro Cornucopia issues on BitSavers from 1986 « The Wiert Corner – irregular stream of stuff

Posted by jpluimers on 2015/06/18

Almost two years ago, I wrote “the only issues missing are #28, #30 and #31.”. As of mid May any more:

All of them are from the 5th anniversary year.

–jeroen

via 2 More Old Micro Cornucopia issues on BitSavers from 1986 « The Wiert Corner – irregular stream of stuff.

Posted in 6502 Assembly, Assembly Language, BitSavers.org, C, C++, Development, History, Pascal, Software Development, Turbo Pascal | Leave a Comment »

 
%d bloggers like this: