Programming for 1980's
computers in 2020
1
Serhii Bykov
Cocoa Engineer, Setapp
Slide 2
Slide 2 text
November, 2019
2
Slide 3
Slide 3 text
Realism about hacking
• Hardware and physical tools
• Software
• Social engineering
3
Slide 4
Slide 4 text
S4E11- Scene
4
Slide 5
Slide 5 text
S4E11 - Splash screen
5
Slide 6
Slide 6 text
S4E11 - Level
6
Slide 7
Slide 7 text
eXit have counterpart IRL too
7
https://www.whoismrrobot.com/exit/
Slide 8
Slide 8 text
Is this fabricated?
8
Slide 9
Slide 9 text
Website and TV show comparison
Apple //e application wanna-be
(Mr. Robot S4E11)
Web-version of application
(http://whoismrrobot.com/exit/)
9
Slide 10
Slide 10 text
Apple //e boot and TV show comparison
Apple //e application wanna-be
(Mr. Robot S4E11)
Apple //e boot sequence video from user `Neon Onion`
(https://www.youtube.com/watch?v=R7FAveqrhjs)
10
Slide 11
Slide 11 text
You’re busted, Sam
11
Slide 12
Slide 12 text
Can I possible recreate same program
from TV show for Apple //e?
12
Slide 13
Slide 13 text
R&D
• Emulators
• OS’es
• Programming languages
13
microM8
• Free
• Cross-platform
• Custom shell over emulation
w/ internet bridge (useful for
development)
• Multiple devices for emulation
(Apple ][, Apple ][+, Apple //e)
• A lot of demo apps
16
Slide 17
Slide 17 text
Operating Systems
17
Slide 18
Slide 18 text
Operating Systems
• Apple DOS
• Apple SOS
• Apple ProDOS
18
Slide 19
Slide 19 text
Apple DOS
DOS - Disk Operating System
19
Slide 20
Slide 20 text
Apple SOS
SOS - Sophisticated Operating System
20
Slide 21
Slide 21 text
Apple ProDOS
ProDOS - Professional Disk Operating System
21
Slide 22
Slide 22 text
ProDOS - 30+ years of support
22
Slide 23
Slide 23 text
Programming languages
23
Slide 24
Slide 24 text
List of programming languages
• Basic
• Fortran
• Pascal
• C
• ASM
• Other
24
Slide 25
Slide 25 text
Actual list of programming languages
• Applesoft Basic, Apple Integer Basic, MD Basic
• Apple Fortran
• Apple Pascal, UCSD Pascal, Orca (ByteWorks) Pascal, Kyan Pascal
• Aztec C, Orca/C
• ASM
• Terrapin Logo, Apple Logo
25
Slide 26
Slide 26 text
Built-in programming languages
• Applesoft Basic, Apple Integer Basic, MD Basic
• Apple Fortran
• Apple Pascal, UCSD Pascal, Orca (ByteWorks) Pascal, Kyan Pascal
• Aztec C, Orca/C
• ASM
• Terrapin Logo, Apple Logo
26
Working with conditions
41
10 INPUT A$
20 IF A$ = "TRUE" THEN GOTO 30
21 IF A$ >< "TRUE" THEN GOTO 40
30 PRINT "A IS `TRUE`" : GOTO 50
40 PRINT "A IS NOT `TRUE`"
50 PRINT "FINISH"
Sleep function
44
1010 POKE 768,169: POKE 770,76
1020 POKE 771,168: POKE 772,252
1025 LET A = 256
1040 IF A < 1 OR A > 256 THEN 30
1050 POKE 769,(A < 256) * A
1060 LET C = (26 + 27 * A + 5 * A ^ 2) / 2
1095 CALL 768: CALL 768: CALL 768: CALL 768: CALL 768: CALL 768: CALL 768:
1096 CALL 768: CALL 768: CALL 768: CALL 768: CALL 768: CALL 768: CALL 768:
1100 RETURN
Slide 45
Slide 45 text
Sample Code
340 HOME:HGR:D$=CHR$(4):PRINT D$;"BLOAD img6.HGR”
350 VTAB 21:PRINT "In the water you see a boat. What do you do?":INPUT "> “;A$
360 IF A$ = "Get on the boat" THEN GOTO 390
370 PRINT "" : PRINT "> ";A$;"" : PRINT "You can't do that here"
375 GOSUB 1000
380 GOTO 340
45
Slide 46
Slide 46 text
Sample Code - Splitted
340 HOME:HGR:D$=CHR$(4):PRINT D$;"BLOAD img6.HGR”
350 VTAB 21:PRINT "In the water you see a boat. What do you do?":INPUT "> “;A$
360 IF A$ = "Get on the boat" THEN GOTO 390
370 PRINT "" : PRINT "> ";A$;"" : PRINT "You can't do that here"
375 GOSUB 1000
380 GOTO 340
46
Slide 47
Slide 47 text
Loading Image
340 HOME:HGR:D$=CHR$(4):PRINT D$;"BLOAD img6.HGR"
• HOME - clears the text screen
• HGR - clears the HGR page
• Image loading magic
47
Slide 48
Slide 48 text
Printing message and asking for input
350 VTAB 21:PRINT "In the water you see a boat. What do you do?":INPUT "> ";A$
• VTAB 21 - put text on 21 row
• PRINT - text
• INPUT - write input to variable $A
48
Slide 49
Slide 49 text
Handling input
• Condition on variable `A`
• If condition is true
• Perform GOTO (to next question)
49
360 IF A$ = "Get on the boat" THEN GOTO 390
370 PRINT "" : PRINT "> ";A$;"" : PRINT "You can't do that here"
375 GOSUB 1000
380 GOTO 340
Slide 50
Slide 50 text
Handling input
360 IF A$ = "Get on the boat" THEN GOTO 390
370 PRINT "" : PRINT "> ";A$;"" : PRINT "You can't do that here"
375 GOSUB 1000
380 GOTO 340
• Condition on variable `A`
• If condition is false
• Perform print operations
• GOSUB - go subroutine on row 1000 (sleep function)
• GOTO - go to row 340 (ask question again)
50
AppleCommander - Used Commands
54
➜ ~ applecommander --help
AppleCommander command line options [1.6.0]:
-p [[$|0x]] put stdin
-n change volume name (ProDOS or Pascal).
-pro140
create a 140K ProDOS image.
-bas import an AppleSoft basic file from text
back to its tokenized format.
Slide 55
Slide 55 text
Build script
cp ${empty_disk_path} ${result_disk_path}
applecommander -n ${result_disk_path} "eXit"
src=("STARTUP" "SPLASH" "EXIT")
for i in "${src[@]}"
do
cat ${src_path}/${i}.bas | applecommander -bas ${result_disk_path} ${i}
done
images=("img0" "img1" "img2" "img3" "img4" "img5" "img6" "img7" "img8")
for i in "${images[@]}"
do
${bin_path}/tohgr ${images_path}/${i}_280x192.png &>/dev/null
mv ${images_path}/${i}_280x192.hgr ${images_path}/${i}.hgr
rm ${images_path}/${i}_280x192_hgr.png
applecommander -p ${result_disk_path} ${i}.HGR BIN 0x2000 < ${images_path}/${i}.HGR;
rm -rf ${images_path}/${i}.hgr
done
55
Slide 56
Slide 56 text
Build script
cp ${empty_disk_path} ${result_disk_path}
applecommander -n ${result_disk_path} "eXit"
src=("STARTUP" "SPLASH" "EXIT")
for i in "${src[@]}"
do
cat ${src_path}/${i}.bas | applecommander -bas ${result_disk_path} ${i}
done
images=("img0" "img1" "img2" "img3" "img4" "img5" "img6" "img7" "img8")
for i in "${images[@]}"
do
${bin_path}/tohgr ${images_path}/${i}_280x192.png &>/dev/null
mv ${images_path}/${i}_280x192.hgr ${images_path}/${i}.hgr
rm ${images_path}/${i}_280x192_hgr.png
applecommander -p ${result_disk_path} ${i}.HGR BIN 0x2000 < ${images_path}/${i}.HGR;
rm -rf ${images_path}/${i}.hgr
done
56
Slide 57
Slide 57 text
Build script
cp ${empty_disk_path} ${result_disk_path}
applecommander -n ${result_disk_path} "eXit"
src=("STARTUP" "SPLASH" "EXIT")
for i in "${src[@]}"
do
cat ${src_path}/${i}.bas | applecommander -bas ${result_disk_path} ${i}
done
images=("img0" "img1" "img2" "img3" "img4" "img5" "img6" "img7" "img8")
for i in "${images[@]}"
do
${bin_path}/tohgr ${images_path}/${i}_280x192.png &>/dev/null
mv ${images_path}/${i}_280x192.hgr ${images_path}/${i}.hgr
rm ${images_path}/${i}_280x192_hgr.png
applecommander -p ${result_disk_path} ${i}.HGR BIN 0x2000 < ${images_path}/${i}.HGR;
rm -rf ${images_path}/${i}.hgr
done
57
Slide 58
Slide 58 text
Build script
cp ${empty_disk_path} ${result_disk_path}
applecommander -n ${result_disk_path} "eXit"
src=("STARTUP" "SPLASH" "EXIT")
for i in "${src[@]}"
do
cat ${src_path}/${i}.bas | applecommander -bas ${result_disk_path} ${i}
done
images=("img0" "img1" "img2" "img3" "img4" "img5" "img6" "img7" "img8")
for i in "${images[@]}"
do
${bin_path}/tohgr ${images_path}/${i}_280x192.png &>/dev/null
mv ${images_path}/${i}_280x192.hgr ${images_path}/${i}.hgr
rm ${images_path}/${i}_280x192_hgr.png
applecommander -p ${result_disk_path} ${i}.HGR BIN 0x2000 < ${images_path}/${i}.HGR;
rm -rf ${images_path}/${i}.hgr
done
58
Slide 59
Slide 59 text
Build script
cp ${empty_disk_path} ${result_disk_path}
applecommander -n ${result_disk_path} "eXit"
src=("STARTUP" "SPLASH" "EXIT")
for i in "${src[@]}"
do
cat ${src_path}/${i}.bas | applecommander -bas ${result_disk_path} ${i}
done
images=("img0" "img1" "img2" "img3" "img4" "img5" "img6" "img7" "img8")
for i in "${images[@]}"
do
${bin_path}/tohgr ${images_path}/${i}_280x192.png &>/dev/null
mv ${images_path}/${i}_280x192.hgr ${images_path}/${i}.hgr
rm ${images_path}/${i}_280x192_hgr.png
applecommander -p ${result_disk_path} ${i}.HGR BIN 0x2000 < ${images_path}/${i}.HGR;
rm -rf ${images_path}/${i}.hgr
done
59
Slide 60
Slide 60 text
Build script
cp ${empty_disk_path} ${result_disk_path}
applecommander -n ${result_disk_path} "eXit"
src=("STARTUP" "SPLASH" "EXIT")
for i in "${src[@]}"
do
cat ${src_path}/${i}.bas | applecommander -bas ${result_disk_path} ${i}
done
images=("img0" "img1" "img2" "img3" "img4" "img5" "img6" "img7" "img8")
for i in "${images[@]}"
do
${bin_path}/tohgr ${images_path}/${i}_280x192.png &>/dev/null
mv ${images_path}/${i}_280x192.hgr ${images_path}/${i}.hgr
rm ${images_path}/${i}_280x192_hgr.png
applecommander -p ${result_disk_path} ${i}.HGR BIN 0x2000 < ${images_path}/${i}.HGR;
rm -rf ${images_path}/${i}.hgr
done
60
Slide 61
Slide 61 text
Build script
cp ${empty_disk_path} ${result_disk_path}
applecommander -n ${result_disk_path} "eXit"
src=("STARTUP" "SPLASH" "EXIT")
for i in "${src[@]}"
do
cat ${src_path}/${i}.bas | applecommander -bas ${result_disk_path} ${i}
done
images=("img0" "img1" "img2" "img3" "img4" "img5" "img6" "img7" "img8")
for i in "${images[@]}"
do
${bin_path}/tohgr ${images_path}/${i}_280x192.png &>/dev/null
mv ${images_path}/${i}_280x192.hgr ${images_path}/${i}.hgr
rm ${images_path}/${i}_280x192_hgr.png
applecommander -p ${result_disk_path} ${i}.HGR BIN 0x2000 < ${images_path}/${i}.HGR;
rm -rf ${images_path}/${i}.hgr
done
61
Slide 62
Slide 62 text
March, 2020
62
Slide 63
Slide 63 text
63
November, 2020
Slide 64
Slide 64 text
Apple //e
• Pros
• Exact machine as used in TV series
• Working machine in our museum
• Cons
• No internal floppy drive (cannot run
program without floppy drive)
64
Slide 65
Slide 65 text
Apple IIc
• Pros
• Internal floppy drive
• Cons
• Not working
65
Slide 66
Slide 66 text
Apple III
• Pros
• Working machine available in museum
(oldest device in our museum - 1980)
• Floppy drive
• Cons
• Not same machine as used in Mr. Robot
66
Slide 67
Slide 67 text
Connect old computer
67
https://adtpro.com
Slide 68
Slide 68 text
Apple III - Rear Panel
68
Slide 69
Slide 69 text
Apple III - Connectors
DB-25 to DE-9 connector
69
DB-25 to DE-9 connector
Slide 70
Slide 70 text
Special Request - Question
70
Slide 71
Slide 71 text
Special Request - Answer
71
Slide 72
Slide 72 text
Delivery - Connectors
RS-232 to USB
DB-25 to RS-232
72
Slide 73
Slide 73 text
Delivery - Extras
73
Slide 74
Slide 74 text
Apple III - First Run
74
Slide 75
Slide 75 text
Apple III - Burning Image
75
Slide 76
Slide 76 text
Apple III - Diskettes
76
Slide 77
Slide 77 text
Apple III - Diskettes
77
Slide 78
Slide 78 text
Apple III - Something doesn’t work
78
Slide 79
Slide 79 text
Apple III - Something work
79
TODO: Apple III game
Slide 80
Slide 80 text
Apple III - Expectations
• New hardware - 2x performance
• New OS
• Backward compatibility
80
Slide 81
Slide 81 text
Apple III - Reality
• Hardware stability issues
• Very limited backward compatibility
81
Slide 82
Slide 82 text
Randy Wigginton, Apple Computer #6 employee
“The Apple III was kind of like a baby conceived during a group orgy,
and [later] everybody had this bad headache and there's this bastard
child, and everyone says, ‘It's not mine.’”
82
Slide 83
Slide 83 text
Apple III - Cannot be used
83
Slide 84
Slide 84 text
I think I can find something useful
84
Slide 85
Slide 85 text
Museum Warehouse List
85
Slide 86
Slide 86 text
Working Apple //e
Apple //e with controller card
86
Slide 87
Slide 87 text
Apple 5.25 Controller
87
Slide 88
Slide 88 text
Apple 5.25 Drive
88
Slide 89
Slide 89 text
IT’S HAPPENING
89
Slide 90
Slide 90 text
Post on /r/MrRobot subreddit
90
Slide 91
Slide 91 text
Tried to mention Mr. Robot producer
91
Slide 92
Slide 92 text
Open Source?
92
Slide 93
Slide 93 text
Why Not?
93
Slide 94
Slide 94 text
eXit is open-sourced
94
https://github.com/esphynox/eXit