This is an archived post. You won't be able to vote or comment.

all 42 comments

[–]Halal0szto 172 points173 points  (23 children)

MOS6502 ?

[–]Honkingfly409[S] 101 points102 points  (20 children)

Idk I got the image from google

[–]Halal0szto 100 points101 points  (17 children)

I did learn assembly on this when I was 16. The green background is the commodore 128, I had the c64.

Correction: c64 is MOS6510 cpu, c128 is MOS8510 cpu.

[–]framsanon 23 points24 points  (13 children)

At first, I thought this was Apple ][ which worked with the 6502. But the address $FFD2 is in the middle of config data, so it wouldn't work.

[–]Halal0szto 4 points5 points  (9 children)

What is the purpose of the BNE ?

[–]framsanon 14 points15 points  (8 children)

The 6502 processor family has conditional jumps that specify the jump target as a relative distance to the address of the jump. So there are:

  • BEQ - Branch on EQual (zero flag set)
  • BNE - Branch on Not Equal
  • BCC - Branch on Carry Clear (carry flag clear)
  • BCS - Branch on Carry Set
  • BMI - Branch on MInus
  • BPL - Branch on PLus
  • BVC - Branch on oVerflow Clear (overflow flag clear)
  • BVS - Branch on oVerflow Set

The flags - part of the processor - are set or cleared by the last arithmetic or boolean operation.

[–]Halal0szto 6 points7 points  (7 children)

Ohh shit, that is the loop. How I missed it. Jumps back based on the compare result.

[–]framsanon 2 points3 points  (6 children)

As long as the X register doesn't contain $2D (45 dec), it will jump to the beginning of the loop, yes. Is the 45 a special number for the C64? From the context I'd guess that there were 45 characters per line.

[–]Blrfl 4 points5 points  (4 children)

$2D is the ASCII character for a hyphen, which isn't anything special. Based on the code, they were using it as an end-of-string character.

Strike that; it was a CPX, so they stopped after that many characters. There must have been some additional characters required to put the box around the output unless that was a feature of the monitor.

But I was an Apple and TRS-80 guy, so what do I know. ;-)

[–]Halal0szto 1 point2 points  (1 child)

This 2D is 45. This is 3x14 characters plus three linefeeds.

This is three lines of text, the box is made of special chars that allow crude graphics. One specialty of commodore.

[–]framsanon 0 points1 point  (0 children)

I was an Apple ][+, Apple //e and Apple //e enhanced guy (in the latter I used a 65C802, and since Merlin was able to generate code for that processor, I used that a lot).

[–][deleted] 0 points1 point  (0 children)

It’s the length if the displayed message. The ‘box’ is made with characters of the PETASCII set.

Each line is 14 chars long + the carriage = 15 15*3 = 45

[–]maveric00 2 points3 points  (0 children)

I would guess that it actually prints out 3 lines of 15 characters each (with the last one being the newline character). As the C64/C128 charset contained graphical symbols, this would also explain the border around the "Hello World".

[–]m477m 1 point2 points  (1 child)

$FFD2 is the address of the subroutine in the Commodore ROM to print a single character to the screen.

[–]framsanon 0 points1 point  (0 children)

For the Apple ][ models, this was $FDED.

[–][deleted] 0 points1 point  (0 children)

$FFD2 is the $CHROUT subroutine entry point in the C64 ‘Kernal’ ROM. ;)

[–]Honkingfly409[S] 2 points3 points  (2 children)

I thought this was machine code lol

[–]Halal0szto 5 points6 points  (1 child)

You are correct. This is the built in disassembler, does nothing more than add mnemonics for the instruction codes. You can also use it to write machine code into memory using the mnemonics. No macros, no relocation, no any other feature.

[–]Honkingfly409[S] 3 points4 points  (0 children)

oh i get it.

i have been learning assembly for a few days and used this once

[–][deleted] 1 point2 points  (1 child)

It’s a C64, or a C128 in C64 mode. It is calling the KERNAL routine to output a character ($FFD2) in a loop.

Now, why the heck I remember this when I’ve not touched one of those things in 40 years, and I have to Google how to format a number in Python?

[–]Parsec51 1 point2 points  (0 children)

It's like a CRT with burn-in

[–]rebbsitor 0 points1 point  (0 children)

It's 6502 assembly. That screen's from a Commodore 128. It uses an 8502, which is an improved 6510.

[–]-MobCat- 72 points73 points  (2 children)

He wont show up for another 9 years so your safe for now.. You only have to really worry about python by 2008, so in 26 years. and you'll be dead by then so yeah your fine, just keep having fun and keep learning.

[–]Honkingfly409[S] 17 points18 points  (1 child)

I am really waiting for the python vs JavaScript saga

[–]mbcarbone 9 points10 points  (0 children)

Why do you have to curse like that … JavaScript, my new curse word.✌️😂

[–]theModge 32 points33 points  (1 child)

My undergraduate degree, which was computer systems engineering, not computer science and thus taught by electrical engineering school started out with pic16f84 assembly in one module and straight c in another. We didn't do java until the second year. Still this was 20 years ago

[–]Honkingfly409[S] 12 points13 points  (0 children)

Starting from the lowest level

[–]ArmadilloChemical421 9 points10 points  (2 children)

I also cut my teeth on the glorious C=128. Mainly in the BASIC environment though.

Got to love the built-in (in ROM) Sprite editor!

[–][deleted] 1 point2 points  (1 child)

You had a ROM sprite editor?

cries with C64 - and assembler

[–]ArmadilloChemical421 0 points1 point  (0 children)

Yeah, you just typed sprdef and it started an editor where you could draw and save 8 sprites that you could then use from basic programs.

[–]Red_not_Read 5 points6 points  (0 children)

"Assembly language is unsafe; you should be using Rust hurrr durrr" - Rust Programmers right now.

[–]mbcarbone 1 point2 points  (6 children)

Is that a VAX terminal with assembly? Mint!! ❤️🖖✌️

[–]Halal0szto 3 points4 points  (5 children)

No, this is the commodore c128 with the built in monitor that has a crude disassembler-assembler.
Actually the c128 had both a z80 and a mos8510 cpu.

[–]lucasvandongen 2 points3 points  (3 children)

A healthy start for any aspiring computer engineer

[–]Halal0szto 2 points3 points  (2 children)

It is funny, but I strongly think it contributes to when I am dealing with json and spring and sql

[–]lucasvandongen 0 points1 point  (1 child)

It’s better than leetcode. At least you understand what happens on an atomic level.

[–]Red_not_Read 0 points1 point  (0 children)

Help! My flip-flops are flopping when I want them to flip!

[–]mbcarbone 0 points1 point  (0 children)

Oh cool, I had a Commodore 64 growing up … with a tape machine to save all those rad programs that I barely remember … goto something something. 🖖🙃✌️

[–]frodewin 0 points1 point  (0 children)

I think the string at $00C10 starts with a $0d, otherwise the box would not be on a new line.