Created
December 7, 2017 20:04
-
-
Save shirriff/b74680bc4825fcfc8ecd026471e57aa6 to your computer and use it in GitHub Desktop.
IBM 1401 assembly code to print a Christmas card
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job card.s | |
ctl 6641 | |
org 087 | |
X1 dcw 000 * Index 1, pointer to text | |
dc 00 | |
org 333 | |
start sw 1 | |
sbr x1, buf+80 | |
rloop r * Read cards into page buffer | |
bce rhs, 1, - | |
mcw 80, 0&x1 * Copy card image to page buffer | |
bce write, 1, $ * Stop reading when $ card reached, start printing | |
sbr x1, 132&x1 * Advance x1 | |
b rloop * Read next card | |
rhs cs 1 | |
sw 1 | |
mcw 80, 66&x1 * Move card image to right half of page buffer | |
sbr x1, 132&x1 | |
b rloop | |
write sbr x1, buf * Print buffer | |
sw 201 | |
wloop mcw 132&x1, 332 * Load card into 201 to 332 | |
bce done, 201, $ | |
w | |
sbr x1, 132&x1 | |
b wloop * Loop | |
done cc 1 * eject page | |
h * Halt: print again if start pushed | |
b write | |
buf equ 1000 | |
end start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment