Copy Link
Add to Bookmark
Report

Machine Language - Part IV

by Lyle Giese (LYLEG)


Welcome to this month's instalment of how to talk to your computer in its own language! First of all, I know that at least one person reads my column!

Bill Brier (a.k.a. TROUBLESOME) reports that the KERNAL routine CHROUT($FFD2) does not corrupt the Accumulator even though CBM's Programmers Reference Guide says so. He has used that routine on the 64 and C-128 without ever seeing the Accumulator change. (Probably on one or more of the earlier PET's it did change the Accumulator's value and CBM made the KERNAL chart from some of the old PRG'S. But that's just speculation.)

This month's program will help us start doing I/O to the disk drive. My example will create a SEQ file on your disk and send it (what else but???) the alphabet. Here is the program:

         .A C000 LDA #$08 
.A C002 LDX #$08
.A C004 LDY #$08
.A C006 JSR $FFBA
.A C009 LDA #$08
.A C00B LDX #$45
.A C00D LDY #$C0
.A C00F JSR $FFBD
.A C012 JSR $FFC0
.A C015 BCC $C018
.A C017 RTS
.A C018 LDX #$08
.A C01A JSR $FFC9
.A C01D JSR $FFB7
.A C020 BEQ $C023
.A C022 RTS
.A C023 LDA #$41
.A C025 STA $FB
.A C027 JSR $FFD2
.A C02A JSR $FFB7
.A C02D BNE $C037
.A C02F INC $FB
.A C031 LDA $FB
.A C033 CMP #$5A
.A C035 BCC $C027
.A C037 LDA #$0D
.A C039 JSR $FFD2
.A C03C JSR $FFCC
.A C03F LDA #$08
.A C041 JSR $FFC3
.A C044 RTS
.M C045
:C045 54 45 53 54 2C 53 2C 57 TEST,S,W

A little larger than our previous programs, but we are doing a lot with it.

See you next month.

Lyle Giese (LYLEG)

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT